Commit Graph

7238 Commits

Author SHA1 Message Date
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
Dave Pearson
ccc3e7a791 Merge pull request #3298 from davep/command-palette-visual-tweaks
Command palette visual tweaks
2023-09-13 22:10:16 +01:00
Dave Pearson
26e9833144 Merge pull request #3300 from davep/remove-screen-assert
Remove assertion that the calling screen is not None
2023-09-13 22:09:54 +01:00
Dave Pearson
9368e9e8ed Merge pull request #3297 from davep/remove-unused-match-style
Remove unused grab of the match component style
2023-09-13 22:09:21 +01:00
Dave Pearson
767990eabe Merge pull request #3296 from davep/remove-unused-command-import
Remove an unused import from command.py
2023-09-13 22:09:00 +01:00
Dave Pearson
5c9c6fcded Update snapshits (redux) 2023-09-13 21:57:29 +01:00
Dave Pearson
0c75239ebc Remove assertion that the calling screen is not None
The assert was for the benefit of type checkers; the code that needed that
hint was moved elsewhere by the recent tweak; but this wasn't tidied up.

This tidies that up.
2023-09-13 21:43:57 +01:00
Dave Pearson
60edeffff6 Update snapshits 2023-09-13 21:41:56 +01:00
Dave Pearson
22fa22e3a9 Make the placeholder text of the input more specific 2023-09-13 21:24:57 +01:00
Dave Pearson
460603aa43 Make the borders of the command palette more subtle 2023-09-13 21:23:49 +01:00
Dave Pearson
5cd020ed7c Remove unused grab of the match component style
The recent tweak of the command palette code moved the acquisition of the
match style component class elsewhere, but seems to have left this dangling.
2023-09-13 21:10:03 +01:00
Dave Pearson
4445ce392b Remove an unused import from command.py
Presumably a hangover from the recent tweak session.
2023-09-13 21:06:56 +01:00
Dave Pearson
1a471fd19c Merge pull request #3293 from davep/undocument-optionlist-default-css
Remove the docstring for `OptionList.DEFAULT_CSS`
2023-09-13 17:08:31 +01:00
Dave Pearson
6dfe017c52 Remove the docstring for OptionList.DEFAULT_CSS
We really don't need to document anything like this, I'll have done it by
habit, and having it there pulls it into the docs which then pollutes the
search results if someone is searching for what DEFAULT_CSS is all about.
2023-09-13 16:51:40 +01:00
Will McGugan
5d6a95dec5 Command Palette tweaks and docs (#3289)
* renames to command palette and docs

* docs

* simplifyt

* note

* docstring

* Update src/textual/command.py

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

* Update docs/examples/guide/command_palette/command01.py

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

* populate text

* screen commands

* Update docs/guide/command_palette.md

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

* Update docs/guide/command_palette.md

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

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Dave Pearson <davep@davep.org>
2023-09-13 15:03:25 +01:00
Dave Pearson
0a14bf0549 Merge pull request #3287 from davep/blog-metadata-update
Update the blog author metadata.

WARNING: Be sure to do an update of dependencies before serving or building docs from this point on!
2023-09-12 14:18:38 +01:00
Dave Pearson
8e315a1cd1 Update the blog author metadata
As per the warning if you use the latest release of mkdocs-material:

WARNING -  Action required: the format of the authors file changed.
           All authors must now be located under the 'authors' key.
           Please adjust 'docs/blog/.authors.yml' to match:

           authors:
             squidfunk:
               avatar: https://avatars.githubusercontent.com/u/932156
               description: Creator
               name: Martin Donath

Note that this is for after:

  Updating mkdocs-material (8.5.9+insiders.4.26.2
  /Users/davep/develop/python/mkdocs-material-insiders -> 9.2.7)

It's also worth noting that our docs should now build regardless of
insiders' edition or not now; given that the blog module is part of the
mainstream release.
2023-09-12 13:04:49 +01:00
Dave Pearson
6d1967be7a Merge pull request #3276 from TomJGooding/docs-add-datatable-supplementary-classes
docs: add datatable supplementary classes
2023-09-12 12:57:32 +01:00
Dave Pearson
0f9d189978 Merge pull request #3244 from davep/markdown-anchor-jump
Fix Markdown anchor load crash, and support going to an heading on document load
2023-09-12 12:38:47 +01:00
Dave Pearson
f19ed898ff Merge pull request #3285 from TomJGooding/test-remove-dupe-directory-tree-test
test: remove dupe directory tree test
2023-09-12 12:38:21 +01:00
TomJGooding
0f18453b44 test: remove dupe directory tree test 2023-09-12 11:12:49 +01:00
Dave Pearson
31636e7679 Merge branch 'main' into markdown-anchor-jump 2023-09-12 11:10:31 +01:00
Dave Pearson
a83954e122 Actually link to the relevant PR 2023-09-12 11:08:13 +01:00
Rodrigo Girão Serrão
d31fb82239 Merge pull request #3203 from TomJGooding/feat-directory-tree-add-directory-selected-message
feat(directory tree): add directory selected message
2023-09-12 10:29:13 +01:00
TomJGooding
25ff8e791d Merge branch 'main' into feat-directory-tree-add-directory-selected-message 2023-09-11 21:24:12 +01:00
Dave Pearson
460bbbad8d Merge branch 'main' into markdown-anchor-jump 2023-09-11 20:18:53 +01:00
Dave Pearson
7ca5dd69ef Merge pull request #3058 from davep/M-x
Command palette
2023-09-11 15:09:03 +01:00
Will McGugan
9ca0929099 Merge branch 'main' into M-x 2023-09-11 14:49:28 +01:00
Rodrigo Girão Serrão
cc8adeaba0 Merge pull request #3193 from Textualize/input-blur-validation
Customisable input validation (& validation on blur events)
2023-09-11 14:38:06 +01:00
Rodrigo Girão Serrão
d39c0c3a89 Improve documentation. 2023-09-11 14:28:23 +01:00
Rodrigo Girão Serrão
0c23aefcc0 Merge branch 'main' into input-blur-validation 2023-09-11 14:27:31 +01:00
Rodrigo Girão Serrão
7d4a47b253 Merge pull request #3199 from Textualize/screen-title-sub-title
Add title and sub-title to screens.
2023-09-11 13:49:28 +01:00
Will McGugan
9e29982ebb Make notify thread-safe (#3275)
* Make notify thread-safe

* test fixes

* docstring

* Update tests/notifications/test_app_notifications.py

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

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-09-11 13:25:31 +01:00
TomJGooding
3d7f5e2c74 docs: add datatable supplementary classes 2023-09-11 13:16:07 +01:00
Rodrigo Girão Serrão
5a15e9c8aa Add docstrings to properties.
Related comment: https://github.com/Textualize/textual/pull/3199#discussion_r1321288977
2023-09-11 11:37:44 +01:00
Rodrigo Girão Serrão
63ace0715e Merge branch 'main' into input-blur-validation 2023-09-11 11:30:38 +01:00
Rodrigo Girão Serrão
a263072781 Invert logic to specify events for input validation.
Related review comment: https://github.com/Textualize/textual/pull/3193#discussion_r1321250339.
2023-09-11 11:30:00 +01:00
David Hallas
550f647e0f Fixes missing fileno function (#3111) (#3239)
Adds missing fileno function to _PrintCapture class. This is needed
because _PrintCapture behaves like a normal stdin/stdout/stderr class
which provides this method.
2023-09-11 10:39:05 +01:00
Rodrigo Girão Serrão
53125ec7d4 Merge branch 'main' into screen-title-sub-title 2023-09-11 10:31:29 +01:00
Will McGugan
b9e1521835 Merge branch 'main' into feat-directory-tree-add-directory-selected-message 2023-09-11 10:30:02 +01:00
Rodrigo Girão Serrão
5ec3feafc7 Type Screen.(SUB_)TITLE as class var.
Related review comment: https://github.com/Textualize/textual/pull/3199/files#r1321216368.
2023-09-11 10:28:50 +01:00
Rodrigo Girão Serrão
4ed93d45c1 Add screen_(sub_)title properties to header.
Related review comment: https://github.com/Textualize/textual/pull/3199/files#r1321226453.
2023-09-11 10:27:24 +01:00
Dave Pearson
60d5005a68 Merge pull request #3274 from davep/fix-optionlist-hover-remove-crash
Fix an OptionList crash when removing an option during mouse hover
2023-09-11 09:59:27 +01:00
Dave Pearson
a107218064 Fix an OptionList crash when removing an option during mouse hover
If the mouse is hovering over the last option in an OptionList, and an
option is removed, the application will crash with an IndexError. The
problem was that the record of the hovered option needed to be cleared when
an option is removed (as it is during other changes).

Fixes #3270
2023-09-11 09:22:24 +01:00
Darren Burns
74aa90f5ac Add Python 3.12 to CI suite (#3255) 2023-09-10 14:58:33 +01:00
Dave Pearson
1d120d91fc Fix being asked to go to an anchor with no filename given
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
2023-09-08 07:57:20 +01:00
Dave Pearson
4ac8df2574 Improve the test for file and string markdown viewing
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
2023-09-07 17:24:53 +01:00
Dave Pearson
ea832b8a9a Add tests for clicking on a link when markdown is from a string
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
2023-09-07 16:43:09 +01:00
Dave Pearson
3b0e86bfef Add more testing of clicking on links 2023-09-07 16:39:47 +01:00
TomJGooding
362684b63e merge main and resolve changelog conflict 2023-09-07 16:08:46 +01:00