115 Commits

Author SHA1 Message Date
Patrik Svensson
13ac38ed04 Fix color system mapping bug
Closes #342
2021-04-08 12:18:54 -04:00
Phil Scott
8cf7794852 Adding unit tests for settings constructor 2021-04-06 22:48:51 +02:00
Christian Wischenbart
be45a0ff4e Fix AnsiConsoleBackend.Clear
1. Add an ED3 command to clear the scroll buffer.

This command is not in the original ANSI terminal control sequences but
was added later to XTerm to account for the fact that most modern
terminals have a scroll-buffer.

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-J.1C8A

This command is now awailable in basically
all terminals with scroll-buffers

2. Change CUP coordinates to 1, 1

The coordinates 0, 0 also worked, but strictly speaking they are outside
the available screen area and are capped to 1, 1 anyways.

This commit fixes #337
2021-04-06 22:42:03 +02:00
Patrik Svensson
693e1fa170 Update links, references and copyright 2021-04-05 16:59:09 +02:00
Phil Scott
254880e93a Replaces emoji regex with ReadOnlySpan implementation
The RegEx runtime perf was never anything noticeable - it was the startup time that was eating over a third of time during initialization.

This shaves 200ms off the startup time.
2021-04-04 04:10:25 +02:00
Patrik Svensson
6f16081f42 Add support for indeterminate progress
This commit also changes the behavior of ProgressContext.IsFinished.
Only tasks that have been started will be taken into consideration,
and not indeterminate tasks.

Closes #329
Closes #331
2021-04-03 09:42:49 -04:00
Patrik Svensson
1ed7e65fcb Make VT-100 sequences easier to understand 2021-03-28 12:51:19 -04:00
Patrik Svensson
20650f1e7e Change IAnsiConsole to render IRenderable
This makes it possible for encoders to output better representation
of the actual objects instead of working with chopped up segments.

* IAnsiConsole.Write now takes an IRenderable instead of segments
* Calculating cell width does no longer require a render context
* Removed RenderContext.LegacyConsole
* Removed RenderContext.Encoding
* Added Capabilities.Unicode
2021-03-28 09:06:06 -04:00
Patrik Svensson
9502aaf2b9 Allow markup in selection prompts
Closes #221
2021-03-14 21:27:44 -04:00
Christopher-Marcel Esser
2540f48622 Hide examples of hidden commands 2021-03-13 23:21:48 +01:00
Phil Scott
e4dda283bb Adds overloads for MarkUp methods without args
These methods don't require a string.format call so we'll directly call the Render method without a call to string.format.

Added bonus of a a couple fewer allocations too.
2021-03-08 15:04:55 +01:00
stf
ef08c5bf2b Improve the unit test around HideCompleted 2021-03-04 07:47:00 -05:00
stf
1c769c6610 Add Progress.HideCompleted 2021-03-04 07:47:00 -05:00
Oskar Klintrot
c64884854f Make it possible to set Value directly 2021-02-25 11:56:32 +01:00
Phil Scott
3a42c0a119 Adds DotSettings and tweaks editoconfigs for tests
R# and Rider have quite a bit of noise related to documentation in the testing projects so this disables those warnings.

In the main projects, R# and Rider complain loudly about the namespaces not matching the file structure. The DotSettings file disables that warning.

Once you get rid of that noise there are quite a few opportunities for trimming out redundant code that R# points out especially with the nullable support enabled, plus there are some bugs related to multiple enumerations worth looking into I think.
2021-02-23 22:34:33 +01:00
Phil Scott
04d0e663d5 Extends maximum size of remaining and elapsed time displayed, plus a failsafe
Elapsed and remaining now support > 9 hours, and if a timespan can't be rendered in that size **:**:** will be displayed
2021-02-16 23:31:55 +01:00
Patrik Svensson
102e2dc38d Allow formatting breakdown charts with lambda expr
Relates to #252
2021-02-13 17:09:51 +01:00
Patrik Svensson
705cf745ea Add formatting support for breakdown chart values
Closes #252
2021-02-05 11:53:55 +01:00
Patrik Svensson
b64e016e8c Add breakdown chart support
This also cleans up the bar chart code slightly and fixes
some minor bugs that were detected in related code.

Closes #244
2021-02-01 01:03:39 +01:00
Patrik Svensson
a23bec4082 Add profile support
Closes #231
2021-01-19 17:53:03 +01:00
Matt Constable
994540d97f
Add cycle detection to tree rendering 2021-01-14 18:37:22 +01:00
Thomas Freudenberg
dee3c01629 mask default value when prompt is a secret 2021-01-14 17:44:18 +01:00
Patrik Svensson
07db28bb6f Add enhancements to progress widget
* Adds TransferSpeedColumn
* Adds DownloadedColumn
* Adds ElapsedTimeColumn
* Minor enhancements to existing columns
2021-01-12 14:10:07 +01:00
Patrik Svensson
8261b25e5c Fix tree rendering
Fixes some tree rendering problems where lines were not properly drawn
at some levels during some circumstances.

* Change the API back to only allow one root.
* Now uses a stack based approach to rendering instead of recursion.
* Removes the need for measuring the whole tree in advance.
  Leave this up to each child to render.
2021-01-10 15:55:11 +01:00
Patrik Svensson
11e192e750 Update Canvas tests 2021-01-06 09:54:45 +01:00
Matt Constable
5b553a4106
Added canvas unit tests & fix canvas scaling bug 2021-01-05 14:00:04 +01:00
Patrik Svensson
1bb0b9ccc6 Fix expectation structure 2021-01-05 11:09:35 +01:00
Patrik Svensson
87e6b42409 Add tree example 2021-01-03 23:28:55 +01:00
Patrik Svensson
1aa958ced3 Add support for multiple tree roots 2021-01-03 23:28:55 +01:00
Patrik Svensson
4bfb24bfcb Streamline tree API a bit 2021-01-03 23:28:55 +01:00
Matt Constable
b136d0299b
Add tree widget 2021-01-02 10:01:16 +01:00
Patrik Svensson
179e243214 Clean up table rendering a bit 2021-01-02 09:33:22 +01:00
Patrik Svensson
b81739567b Fix argument order in help
Closes #188
2021-01-01 13:43:28 +01:00
Patrik Svensson
5cf41725a5 Do not split remaining args on space
Closes #186
2021-01-01 12:19:37 +01:00
Patrik Svensson
79742ce9e3 Parse quoted strings correctly
When parsing quoted strings, space was not handled
properly in remaining arguments.

Fixes #186
2020-12-30 18:43:29 +01:00
Patrik Svensson
241423dd16 Do not truncate command table
Temporary fix for commands not showing up if they
are missing a description. This is really a bug in the table
rendering and should be fixed there at some point.

Closes #192
2020-12-30 18:43:29 +01:00
Patrik Svensson
0ae419326d Add Spectre.Cli to Spectre.Console
* Renames Spectre.Cli to Spectre.Console.Cli.
* Now uses Verify with Spectre.Console.Cli tests.
* Removes some duplicate definitions.

Closes #168
2020-12-28 17:28:03 +01:00
Thomas Freudenberg
0bbf9b81a9
Adds optional function to get the display string for TextPrompt choices 2020-12-26 18:17:46 +01:00
Simon Cropp
f417e297cd update test refs
the latest of shouldy has better nullable attributes
2020-12-26 18:13:35 +01:00
Patrik Svensson
7dccb310f3 Add support for bar charts
Closes #103
2020-12-23 10:05:08 +01:00
Patrik Svensson
1cf30f62fc Add autocomplete for text prompt
Closes #166
2020-12-22 11:31:22 +01:00
Patrik Svensson
6932c95731 Fix bug when splitting text containing CJK chars
In Segment.Split, we didn't take cell width into account
when calculating the offset, which resulted in some "fun" bugs.
I've added a new overload for Segment.Split and obsoleted the old one.

Closes #150
2020-12-17 00:02:00 +01:00
Patrik Svensson
63abcc92ba Set max value for progress task properly
Also clamp the task value if it's greater than the max value.

Closes #163
2020-12-12 17:29:07 +01:00
Patrik Svensson
501db5d287 Add status support 2020-12-09 00:07:02 +01:00
Patrik Svensson
3c504155bc Fix progress rendering bug 2020-12-04 10:19:09 +01:00
Patrik Svensson
ae32785f21 Add progress task list support 2020-12-04 07:29:48 +01:00
Patrik Svensson
4f6eca4fcb Fix rendering of exceptions with generic params
Closes #145
2020-11-24 22:16:17 +01:00
Patrik Svensson
a59e0dcb21 Add FIGlet text support
Closes #97
2020-11-22 03:09:42 +01:00
Simon Cropp
bde61cc6ff
Verify: Use custom test directory 2020-11-20 23:27:35 +01:00
Simon Cropp
5c33b87a9c
Add Verify for testing 2020-11-20 16:22:23 +01:00