Commit graph

137 commits

Author SHA1 Message Date
Will McGugan
297bc78741 snapshot tests 2025-03-25 17:02:00 +00:00
Will McGugan
fd26e24130 update docs with syntax extras 2025-02-26 16:36:27 +00:00
Will McGugan
661ffd13ce style and components fixes 2025-02-10 20:02:43 +00:00
Darren Burns
54c6f78d60
Snapshot fixes 2024-10-29 11:16:49 +00:00
Darren Burns
a274129081
Fixing yet more tests 2024-10-28 16:17:04 +00:00
Darren Burns
796a6ae73b
Merge branch 'main' of github.com:Textualize/textual into themes 2024-10-28 10:04:46 +00:00
Will McGugan
6298acb2a2 link widget 2024-10-13 18:44:33 +01:00
Darren Burns
8e895f321d
Fix tree widget example typing 2024-10-09 11:53:32 +01:00
Will McGugan
584dd0c7ad
Merge branch 'main' into masked_input 2024-08-27 12:32:14 +01:00
Will McGugan
142ca7485c Remove classic footer 2024-08-22 13:29:50 +01:00
Angelo Mottola
e437bf5bbe Introduced MaskedInput widget 2024-07-22 00:38:41 +02:00
Will McGugan
896b64fbe5 gradients and tests 2024-07-18 14:56:18 +01:00
Charles Merriam
b5e165f533
Improvements to Widget DataTable documentation (#4706)
* Preamble.  Mention commonly searched for capabilities missing, e.g., formatting and filtering.

* Clarify zebra_stripes as using alternating styles.

* Expand Cursors section to mention None type of cursor, clarify keyboard and mouse events, and that row indices start at one.  Expand example for No Cursor option.

Also minor typos to previous two commits (preamble wording and zebra stripes).

* Expand sorting section for clarity.

Minor typos in Labeled Rows and Cursors sections.

* In Keys section, mention functions taking coordinates.

Fix typo in Sorting section.

* Minor changes

---------

Co-authored-by: Darren Burns <darrenb900@gmail.com>
2024-07-10 16:38:05 +01:00
Will McGugan
374f742be4 new footer 2024-05-21 16:47:37 +01:00
Will McGugan
cc19158a9a inline docs 2024-03-30 13:21:29 +00:00
Will McGugan
5cff594512 tests 2024-03-10 15:16:38 +00:00
Will McGugan
ea8e75661a snapshot 2024-03-09 12:44:22 +00:00
TomJGooding
ca2c11bdb8
docs(text area): fix syntax highlighting in examples (#4099)
* docs(text area): fix syntax highlighting in examples

* revert text_area_extended.py

* fix class method

* fix extended text area example
2024-02-05 10:33:22 +00:00
Dave Pearson
758547b5dd
Add a note to the docs about styling tabs
Note that I can't tell if this comes out as I'd like, as right at the moment
I can't locally serve the docs due to an error during documentation
generation (an issue confirmed by @rodrigogiraoserrao).
2023-12-07 15:02:39 +00:00
azinneck0485
87ef1bbcc1
Add Select.from_values class method for initializing with iterator (#3743)
* prototype to use class method to initialize Select object using an iterator

* add docstring and optional arguments to Select.from_values()

* add test widget for Select.from_values() and update documentation to include an example for its use

* add snapshot tests to Select.from_values() class method and update snapshots to include results

* address review comments

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-12-05 14:17:25 +00:00
Rodrigo Girão Serrão
3f54a93ef4
Merge branch 'main' into select-improvements 2023-11-14 16:19:00 +00:00
Will McGugan
c0f299b593
input restriction (#3657)
* input restriction

* types

* tweak

* tests

* docstring

* fix lock

* words

* add valid empty

* another test

* fix regex

* doc

* name change

* Fix regex

* force initial value

* force reactive

* test fix

* add plus

* input type literal

* export InputType
2023-11-10 16:16:42 +00:00
Rodrigo Girão Serrão
eb9b4bcb00
Merge branch 'main' into select-improvements 2023-11-09 12:59:56 +00:00
Rodrigo Girão Serrão
c19ffe3f92
Merge pull request #3595 from Textualize/pre-commit
Add more pre-commit hooks.
2023-11-01 14:48:02 +00:00
Rodrigo Girão Serrão
e73181680f
Merge branch 'main' into select-improvements 2023-11-01 14:35:14 +00:00
Rodrigo Girão Serrão
8997615430
Improve Select.
Use a special value to flag a blank selection, add methods is_blank and clear, slightly refactor the way the widget is setup to avoid having attributes _initial_options and _options.
Implement exceptions to be raised when the widget is entering bad state.
2023-11-01 14:08:44 +00:00
Josh Duncan
4f95d30619
DataTable sort by function (or other callable) (#3090)
* DataTable sort by function (or other callable)

The `DataTable` widget now takes the `by` argument instead of `columns`, allowing the table to also be sorted using a custom function (or other callable). This is a breaking change since it requires all calls to the `sort` method to include an iterable of key(s) (or a singular function/callable). Covers #2261 using [suggested function signature](https://github.com/Textualize/textual/pull/2512#issuecomment-1580277771) from @darrenburns on PR #2512.

* argument change and functionaloty update

Changed back to orinal `columns` argument and added a new `key` argument
which takes a function (or other callable). This allows the PR to NOT BE
a breaking change.

* better example for docs

- Updated the example file for the docs to better show the functionality
of the change (especially when using `columns` and `key` together).
- Added one new tests to cover a similar situation to the example
  changes

* removed unecessary code from example

- the sort by clicked column function was bloat in my opinion

* requested changes

* simplify method and terminology

* combine key_wrapper and default sort

* Removing some tests from DataTable.sort as duplicates. Ensure there is test coverage of the case where a key, but no columns, is passed to DataTable.sort.

* Remove unused import

* Fix merge issues in CHANGELOG, update DataTable sort-by-key changelog PR link

---------

Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>
Co-authored-by: Darren Burns <darrenb900@gmail.com>
2023-10-31 13:14:47 +00:00
Rodrigo Girão Serrão
6f00943c14
Fix imports. 2023-10-26 12:15:55 +01:00
Darren Burns
bbde62fc57
Text area (#2931)
* Add docstring and switch to tree-sitter-languages wheels - although the wheels arent working

* Adding highlights files

* Fix index error on SyntaxAwareDocument

* Narrowing highlighting scope

* Adding basic highlights for Markdown

* Using utf-8 byte length instead of codepoint count in syntax aware doc

* Start creating an ABC defining functionality required by Document impls

* Simplify tree-sitter logic

* Extracting more ABC

* Fix width calculation, add SyntaxTheme

* Ensure the highlight line style goes right to the very end

* Updating a docstring

* Renaming, and adding document width guide

* Ensuring that line number column toggling refreshes virtual size

* Ensuring that line number column toggling refreshes virtual size

* Width guide

* Fix focus event stopping

* Use release_mouse

* Improving a docstring

* Remove bash

* TextArea language snapshot testing

* Updating snapshots for TextArea since we now highlight more nodes

* Typing fixes

* Testing

* Adding tests

* Fixing language selection

* Refresh size on indent width change

* Testing, renaming, fixing display of selection

* Fix multibyte highlight glitch

* Fix deleting right with selection at end of document in TextArea

* Fixing utf-8 multibyte character issues

* Default location of text insertion is cursor position, add cursor_location properties

* Removing some debugging code

* Cursor location tests

* Updating snapshots

* Cached utf8 encoding

* TextArea selection snapshot testing

* Tidying docstrings and queries

* Updating selection snapshot output

* Binding for ESC to shift focus

* Only build the tree-sitter query once!

* Expand cursor scroll horizontal leeway in TextArea

* Property setter for cursor_location in TextArea shouldnt return value

* Avoiding NamedTuple subclassing - using type aliasing instead

* Tidying API, docstrings etc.

* Tidying the API and docstrings

* TextArea additional cursor tests

* Testing pageup and pagedown in TextArea

* Fix a faulty test

* Docstring in a test for TextArea edit

* Stop using DEFAULT_SYNTAX_THEME

* Docstrings

* Change cursor_destination to move_cursor, add more tests

* Remove faulty assertion

* Tidying cursor movement

* Tidying up, adding docstrings for component classes

* Fix a broken selection test

* Remove some unused highlighting machinery

* Fix some Python highlighting issues

* Make HTML syntax highlight nicely

* Create tag name for mismatching HTML end tag

* Add styling for YAML, update boolean styling

* Stylising toml types

* Styling floats

* JSON syntax highlighting

* Updating snapshots

* Syntax highlighting datetimes in TOML

* Namespace TOML errors in highlighting

* Add a move_cursor_relative method

* Update TOML TextArea snapshot for datetime highlighting support

* Adjusting selections

* At TextArea widget level, delete_range is insert_range of empty string

* Refactoring

* Dunder all, docstring fix

* Fix XFAIL

* Remove unused import

* More tests, tidying up

* Cleaning the API

* Docstrings for TextArea

* A bunch of docstrings, delete unused code

* More tidying and docstrings

* Cursor origin on document load, correctly handle delete word left/right when selection is non-empty, fix delete_line when selection spans multiple lines and is in reverse direction

* Moving things around

* Fixing dunder all to export DocumentBase

* Add docstring

* Record cursor width on programmatic insert since it can result in the cursor moving

* Typing fixes

* Fixing remaining typing issues with TextArea

* Add tree-sitter-languages stubs and fix typing issues in documents

* Fixing remaining typing issues with document

* Updating Syntax themes

* Improve highlighting, add initial TextArea docs page

* Add TextArea indent note

* Start TextArea guide inside reference

* Add TextArea to widget gallery

* Fleshing out TextArea docs

* Add note

* Fix TextArea programmatic insert/cursor interaction

* Improve a test

* Testing replacement within selection

* Testing double-width character keyboard navigation and deletion keybinds with active selections

* Testing "delete to start of line" TextArea binding

* Testing TextArea delete line methods and delete to end of line

* Testing shift selecting using keyboard in vertical direction

* Expand tests for home and end keybinds in TextArea

* Renaming tests, testing empty replace and insert

* Testing delete word left via API

* Testing delete word left via API

* Testing delete_word_left with tabs, and delete_word_right

* Remove unused variables

* Remove debugging width guide

* Fix snapshot report path

* Deleting word left/right interaction with line ends fixes, ensure cursor width recorded on all edits

* Docstring fixes

* Unpin textual snapshot library dependency (issue is fixed)

* Docstring fixes

* Fix recording cursor width

* Fix a docstring

* Add select_all to TextArea

* Remove unused tree-sitter stuff from .gitignore

* Line select

* Make word pattern private in TextArea

* Add blinking cursor to TextArea

* Renaming, adding missing return typing

* Add selection bindings

* Moving cursor left/right by word while selecting

* Change escape keybind description, TextArea

* Stripping whitespace when going word left/right

* Add missing annotation

* Cursor word right and left parity with PyCharm

* Use repaint=False for cursor blink

* Improve focus/blur styling

* A whole bunch of TextArea testing

* Simplify delete_left and delete_right

* Testing hiding line numbers in snapshot

* Adding snapshot test for unfocus styling

* Create initial snapshot for text-area unfocused

* Support shift+home, shift+end

* Document shift+home, shift+end

* Add Dracula syntax highlighting theme

* Small change to delete_line behaviour when multiple lines selected to match vscode/pycharm behaviour

* Add test for new delete line logic

* Delete line improvement

* Add extra test for delete_line multiple selection

* Test cursor "smart" home behaviour

* Fix typo

* Highlight matching brackets

* Update snapshot

* Update snapshot

* Fix xfails

* Simplify delete_word_left

* Catch correct exception to ensure support for Python 3.7

* Add styling for Markdown

* Add styles for Dracula for Markdown

* Remove unused _fix_direction.py

* Add docstring to EditResult

* Use default=0 in max inside Document

* Remove redundant actions

* Use cell-width aware expand tabs implementation from @willmcgugan

* Construct strip with cell length

* Some TextArea keyword-only arguments

* Begin moving over to TextAreaTheme #skipci

* Prepare queries inside document #skip-ci

* Add comment

* Refactoring

* TextAreaTheme styling

* Setting width of blank selected lines

* Building the highlight map in the text area

* Remove unused default css from TextArea

* Moving highlighting stylize into widget

* Moving syntax highlighting into TextArea widget

* Remove unused code

* Optimise imports

* Fix highlighting when initial text supplied to TextArea

* Rebuild highlight map when the theme changes

* Extending

* Restore themes

* Remove old comment, fix docstring

* Fixing docstrings

* Fixing mypy

* Fixing mypy issues in document

* Tidying things

* Updating version

* Add theme

* Fix VSCode theme bracket matching

* Only match brackets when theres no selection

* Highlighting tidying

* Fix markdown header highlighting

* Setting theme correctly in background

* Tidying module interface

* Merging main

* Fixing a bunch of typing problems

* Fixing more typing problems

* Correctly setting theme object

* mypy

* Small fix to bracket matching

* Improve a docstring

* Fix docstring

* Testing builtin and custom languages

* Unit testing theme stuff

* Reworking themes

* Error handling

* Improve error message

* Testing new theme setting approach, error handling

* Improvements/tests for theme and language setting

* Remove unused TextArea unfocus snapshot

* Update snapshot file

* Adding theme snapshot tests

* Add `function.call` style binding in dark vscode theme

* Renaming a test file

* Making active line clearer on vscode theme

* Renaming tests

* A whole lot of docs for TextArea

* Update wording in docs

* A bit more docs

* Example on adding Java as a custom language

* More custom language docs

* Finishing up custom themeing/syntax highlighting guide for TextArea

* Add note on potential issue

* Fix wording

* Add note on Apple Silicon Python 3.7 fallback

* Add another note on Apple Silicon Python 3.7 fallback

* Fix class names in example files

* Add some documentation for useful TextArea APIs

* TextArea docs improvements

* TextArea docs typo fix

* Note about extending TextArea

* Tab-stop support when spaces used for indent

* Docs update

* Text area blog post (#3356)

* Start blog post

* Add demo script to blog post

* Continuing the blog post

* Yet more writing for TextArea blog post

* Working on closing section

* Finishing up

* Update docs/blog/posts/text-area-learnings.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Update docs/blog/posts/text-area-learnings.md

Co-authored-by: Dave Pearson <davep@davep.org>

* Typo fix

* Update docs/blog/posts/text-area-learnings.md

Co-authored-by: Dave Pearson <davep@davep.org>

---------

Co-authored-by: Dave Pearson <davep@davep.org>

* Remove redundant pass

* Add docstring

* Docs fix

* Simplify docs

* Improve docstring

* Add links in docstrings

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-09-21 11:10:14 +01:00
Will McGugan
9431890a7d
Collapsible style tweak (#3306)
* tweaks to style

* changelog

* snapshot

* add additional space for nested widgets

* tweak to nested collapsibles and snapshots

* remove superfluous rules
2023-09-14 17:34:15 +01:00
Will McGugan
1db9ecb302
Update Collapsible (#3305)
* Update Collapsible

* snapshot tests

* word

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* simplify render

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-09-14 16:26:41 +01:00
Sunyoung Yoo
3b2b9aaaf5
Widget collapsible (#2989)
* Collapsible container widget.

* Expose collapsible widget.

* Add collapsible container example

* Rename member variables as label and apply formatting

* Apply hover effect

* Apply formatting

* Add collapsible construction example with children.

* Wrap contents within Container and move _collapsed flag to Collapsible class from  Summary for easier access.

* Add collapsible example that is expanded by default.

* Update collapsed property to be reactive

* Add footer to collapse and expand all with bound keys.

* Expose summary property of Collapsible

* Assign ids of ollapsed, expanded label instead of classes

* Add unit tests of Collapsible

* Rename class Summary to Title

* Rename variables of expanded/collapsed symbols and add it to arguments..

* Add documentation for Collapsible

* Update symbol ids of Collapsible title

* Update src/textual/widgets/_collapsible.py

Correct import path

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Sort module names in alphabetical order

* Clarify that collapsible is non-focusable in documentation.

* Add version hint

* Fix documentation of Collapsible.

* Add snapshot test for collapsible widget

* Stop on click event from Collapsible.

* Handle Title.Toggle event to prevent event in Contents from propagating to the children or parents Collapsible widgets.

* Update Collapsible default css to have 1 fraction of width instead of 100%

* Update Collapsible custom symbol snapshot

* Add Collapsible custom symbol snapshot as an example

* Update docs/widgets/collapsible.md

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Update src/textual/widgets/_collapsible.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Fix typo in Collapsible docs

* Rework collapsible documentation.

---------

Co-authored-by: Sunyoung Yoo <luysunyoung@aifactory.page>
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-09-14 13:10:21 +01:00
TomJGooding
06b6426750
feat: add rule widget (#3209)
* feat: add rule widget

* add star to init

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* remove unnecessary validations

* update rule styles

* add tests for invalid rules

* add minimum heights and widths

* tidy up examples

* remove old example

* move examples styling to tcss

* modify examples to fit docs screenshots

* add docs first draft

* add snapshot tests

* add rule to widget gallery

* make non-widget rule classes available

* tentatively update changelog

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-09-04 17:57:10 +01:00
Rodrigo Girão Serrão
5ee0ebfef4
Rename CSS files to TCSS.
Related issue: #3137.
2023-08-22 13:21:17 +01:00
Dave Pearson
30bd82e25e
Link the Header docs to App.title and App.sub_title
Closes #3103.
2023-08-21 12:57:16 +01:00
Will McGugan
49281b3f27
Digits (#3073)
* Digits

* digits widget

* update requires str

* digits docs

* simplify

* tweak docs

* snapshot test

* change name

* simplify

* docs

* Update _digits.py superfluous import

* Update _digits.py docstring

* address review

* formatting

* Update tests/snapshot_tests/snapshot_apps/digits.py

Co-authored-by: Dave Pearson <davep@davep.org>

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-08-09 10:25:17 +01:00
Will McGugan
879c985296
Rich log (#3046)
* log

* tests

* snapshot tests

* change to richlog

* keep raw lines

* disable highlighting by default

* simplify

* superfluous test

* optimization

* update cell length

* add refresh

* write method

* version bump

* doc fix link

* makes lines private

* docstring

* relax dev dependancy

* remove superfluous code [skip ci]

* added FAQ [skipci]

* fix code in faq [skipci]

* fix typo

* max lines fix
2023-08-03 10:11:17 +01:00
Dave Pearson
ca8eb3df7b
Notifications (#2866)
* Add a notification class and a class to hold notifications

This provides the core classes for holding information on a single
notification, and then on top of that a class for managing a collection of
notifications.

* WiP: End of day/week commit to pick up post-holiday

* Ask permission rather than forgiveness

Yes, this does go against all things Pythonic, but in this case it's likely
less costly to do the check first; moreover it works around the problem I
ran in to: https://github.com/Textualize/textual/issues/2863

* Move the handling of "I've seen this" into the toast rack

This way the interface becomes "here's a bunch of notifications, you go work
this out".

* Add a notify method to all widgets

* The removal time for a toast should be the time left

When it was per-screen, it made sense that it was the timeout; now that
we're carrying them over between screens we're going to make sure they're
only around for as long as they need to be.

* Carry notifications between screens

* Remove the test code

* Drop the borders from the toasts

Except for the title, keep that.

* Provide access to the notification timeout

* Remove the title panel from a Toast if the title is empty

* Make the Toast CSS classes "private"

Prefix with a - to reduce the chance of a clash with userspace.

* Refresh a docstring

* Stop widget leakage

The Toasts were removing themselves, but they're wrapped inside a helper
container that keeps them aligned right. So the problem was that the
alignment containers were leaking. This ensures that when a Toast goes away
it takes its parent with it.

* Make the alignment container hidden

This doesn't really make any difference, but it feels like it makes sense to
hide it if there's nothing to show -- it's purely for alignment.

* 🚚 Rename the toast container

This is about getting the toasts to align correctly (even when you do align
things, they don't really align as expected due to the way that a container
aligns the bounding box of all if its children, not the individual
children). However, I had this named after where it aligned them to; someone
using the system may wish to change that, so let's make the name more
generic.

* Improve ToastRack._toast_id

Add a docstring, and also change the format of the identity somewhat so that
it's even "more internal".

* Add some initial low-level notification testing

* Add initial testing of notifications within an application

* Add tests for notifying from the 3 main levels within the DOM

* Add a toast example to the docs and a snapshot test

This might not be the final form, but it'll do for the moment. I want to get
the snapshot test in place at least.

* Add a snapshot test for notifications persisting between screens

* Add some documentation for a Toast

This isn't going into the index, just yet. This is *technically* an internal
widget so I'm not sure how and where it makes sense to document it; if at
all. But let's get some documentation in here anyway.

* Flesh out the docstrings for the notify methods

* Add a missing docstring to the Notifications __init__ method

* Add snapshot tests for persisting notifications through mode switches

* Remove unused import

Looks like eglot/pyright tried to be "helpful" at some point and I didn't
notice.

* Correct the Toast severity level classes in the docs

Originally they weren't in the "internal" namespace, then I decided that
they should be so there's less chance of a clash with dev-space code; but I
forgot to reflect this in the docs.

This fixes that.

* Make the removal of notifications/toasts a two way thing

The addition of the ability to dismiss a toast by clicking on it had a flaw:
the notification->toast code had been written with things being one way. The
expiration of notifications happened in the notification handler, and the
expiration of Toasts was done in the Toast system, on purpose (notifications
might end up being routed via elsewhere so this needs to be done).

But... this meant that hand-removed Toasts kept coming back from the dead
when a new notification was raised iff the hand-removed ones hadn't yet
expired.

So here I add the ability the remove a notification from the notification
collection.

* Remove an unhelpful comment

Sort of a hangover from what was initially looking like it was going to be a
longer body of code. It doesn't really need explaining any more.

* Add in support to the notification collection

* Change the toast rack adder to be a general "show" method

This turns the method into one that further aids making the connection
between the notifications and the toasts two way. Now it makes sense that if
there are toasts for notifications that no longer exist, they also get
removed.

This makes it easier to add all sorts of clear options later on.

* Add a method to clear notifications

* Add an App method for clearing all existing notifications

* Add a missing docstring to _refresh_notifications

* Return the notification from the notify methods

It can be seen as, and used as, a handle of sorts (see unnotify); so return
it so people can use it.

* Add some more notifications unit testing

* Add some more app-level notification unit testing

* Style tweaks

* docs

* added notifications

* snapshots

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-07-17 11:47:17 +01:00
Will McGugan
2889a437f2
Style review (#2777)
* further tweaks

* button tweaks

* style tweaks

* style tweaks

* tests

* test fixes

* tidy css
2023-06-14 13:04:24 +01:00
Will McGugan
065effbebd doc fixes 2023-06-01 17:41:08 +01:00
Will McGugan
58a9cb1909
blog post new release (#2712)
* blog post new release

* update words

* Update docs/blog/posts/release0-27-0.md

Co-authored-by: Dave Pearson <davep@davep.org>

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-06-01 11:33:54 +01:00
Rodrigo Girão Serrão
78db024c01
Add sparkline widget. (#2631)
* Sparkline widget proof of concept.

* Address review comment.

Related comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1202894414

* Blend background colours.

* Add widget sparkline.

* Add snapshot tests.

* Add documentation.

* Update roadmap.

* Address review feedback.

Relevant comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1210394532, https://github.com/Textualize/textual/pull/2631\#discussion_r1210442013

* Improve docs.

Relevant comments: https://github.com/Textualize/textual/pull/2631\#issuecomment-1568529074

* Update snapshot app titles.

* Don't init summary function with None

Related comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1211666076

* Apply suggestions from code review

Co-authored-by: Dave Pearson <davep@davep.org>

* Improve wording.

* Improve wording.

* Simplify example.

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-06-01 09:34:33 +01:00
darrenburns
ca17d8194e
Add docs for Pretty, fix some reference issues in docs (#2678) 2023-05-29 17:11:39 +01:00
Dave Pearson
93c3c3652b
Merge branch 'main' into multiselect 2023-05-25 13:59:34 +01:00
darrenburns
62fcefbd2d
Validation (#2600)
* A few different types of validation

* Rename

* Fix test

* Updating validation framework

* Update lockfile

* Ensure validators can be None

* Reworking the API a little

* Convert Input.Changed to dataclass

* Add utility for getting failures as strings

* Update an example in Validator docstring

* Remove some redundant `pass`es

* Renaming variables

* Validating Input on submit, attaching result to Submitted event

* Testing various validation features

* Update snapshots and deps

* Styling unfocused -invalid Input differently

* Add snapshot test around input validation and associated styles

* Validation docs

* Tidying validation docs in Input widget reference

* Fix mypy issues

* Remove __bool__ from Failure, make validator field required

* Code review changes

* Improving error messages in Validators
2023-05-25 13:29:33 +01:00
Dave Pearson
02c4f4d69b
Add an example of using SelectionList.SelectedChanged 2023-05-25 09:35:37 +01:00
Dave Pearson
fe26b89803
Add some more hints about type hinting
Also add a couple more useful links in the area I'm editing.
2023-05-25 09:12:57 +01:00
Dave Pearson
2d544ca697
Rename the tuples selection list example to mention tuples
Making this one look like it was *the* canonical example wasn't a good idea.
2023-05-25 08:58:45 +01:00
Dave Pearson
a9100988b4
Make a start on the SelectionList example apps 2023-05-24 21:36:14 +01:00
Will McGugan
dc102563e9
changelog and release post (#2513)
* changelog and release post

* fix version

* link Select

* remove superfluous css

* Update docs/blog/posts/release2-24-0.md

Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>

* Update docs/blog/posts/release2-24-0.md

Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>

---------

Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2023-05-08 17:45:06 +01:00