Commit Graph

7203 Commits

Author SHA1 Message Date
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
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
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
Will McGugan
85970972d9 blog post (#3248)
* blog post

* bump timestamp

* words
2023-09-06 17:53:31 +01:00
Dave Pearson
63cbc52952 Remove screenshot as a system command for the command palette
While it's kinda cool... it's not really very helpful if you're doing things
via textual-web; all you're going to do is start to use storage on the host
machine, not the client machine (unless they're the same thing, of course).
2023-09-06 14:51:26 +01:00
Dave Pearson
5a272c539d Bump predicted command palette escape to the wild to 0.37.0 2023-09-06 14:48:06 +01:00
Dave Pearson
85a3af320a Merge branch 'main' into M-x 2023-09-06 14:46:33 +01:00
Dave Pearson
1c1836e7f4 Handle locations that are *just* the anchor
If just an anchor is given, it is assumed that we'll be finding it within
the current document.
2023-09-06 14:06:13 +01:00
Dave Pearson
db2a5853d8 Make sanitize_location a public API method 2023-09-06 13:29:52 +01:00
Dave Pearson
284a5b973f Make goto_anchor public 2023-09-06 13:19:56 +01:00
Dave Pearson
a70235e42d Update the CHANGELOG
Co-authored-by: Chakib Benziane <contact@blob42.xyz>
2023-09-06 10:18:47 +01:00
Dave Pearson
738eb7b9b7 After loading a Markdown document, jump to any matching anchor
Co-authored-by: Chakib Benziane <contact@blob42.xyz>
2023-09-06 10:13:37 +01:00
Dave Pearson
798f67f01d Allow loading a different file into the markdown example
Not getting carried away with this -- frogmouth exists after all -- but
allowing passing a different file on the command line does make it easier to
quickly test the Markdown widget.
2023-09-06 09:27:22 +01:00
Dave Pearson
7f40287691 Persist the table of contents in the Markdown widget 2023-09-05 16:20:05 +01:00
Dave Pearson
fa7f6b3066 Remove any anchor that's included in a filename to load from a Markdown file
Fixes the issue reported in #3094.

There's more to come on this, as rather than just fix that error, we'd also
like to go to the header that the anchor relates to. See #3094 for an
initial approach to this. This PR builds on the idea in a different way.

But before doing that wider part, this simply starts out by fixing the
reported bug.
2023-09-05 15:35:24 +01:00
Dave Pearson
ac57633146 Add tests for loading a markdown file with an anchor included
Tests the problem reported in #3094
2023-09-05 15:33:50 +01:00
Dave Pearson
eb1fe6db71 Merge pull request #3236 from davep/markdown-homeless-snails
Add utility code for generating Markdown-oriented slugs
2023-09-05 14:36:31 +01:00
Will McGugan
2891fce71a date in changelog 2023-09-05 13:57:08 +01:00
Will McGugan
11ba91a275 version bump (#3235) v0.36.0 2023-09-05 13:54:56 +01:00
Dave Pearson
70ab4c7763 Add URL quoting as the final act of slugging 2023-09-05 13:51:17 +01:00
Dave Pearson
f50f4e1125 Docstring tidy 2023-09-05 12:43:12 +01:00
Dave Pearson
edc0420a5a Simplify and improve the slugging code
This isn't 100% how GitHub's approach works, but the edge cases I can find
appear to be bugs or issues with how GitHub handle the more interesting
emoji when they appear in headers.

Long story short: they appear to just strip emoji for the most part, but if
an emoji is modified in some interesting way (think shrugging person vs
shrugging light-skinned woman with black hair) it looks like the final
codepoint "leaks" into the slug; nothing about this looks intentional, and
it's such a remote issue that it's hardly worth supporting.
2023-09-05 12:33:13 +01:00
Dave Pearson
418819c94e General code tidying 2023-09-05 09:09:26 +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
Will McGugan
cbed79c7eb Modes docs (#3233)
* Modes docs

* Added current mode

* fix docstring

* diagrams

* Update docs/guide/screens.md

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

* Update docs/guide/screens.md

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

* words

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-09-04 17:40:40 +01:00
Dave Pearson
4cbb4af807 Merge branch 'main' into markdown-homeless-snails 2023-09-04 16:40:53 +01:00
Dave Pearson
1fcf259e6d Merge branch 'main' into M-x 2023-09-04 16:40:32 +01:00
Dave Pearson
80821155a6 Add a test for accents 2023-09-04 16:19:19 +01:00
Dave Pearson
6d4fcaa4c6 Merge pull request #3232 from davep/see-also-focus-blur
Add see-also entries to the various blur/focus messages
2023-09-04 15:46:48 +01:00
Dave Pearson
9f83145d70 Boring sort rather than exciting sort
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-09-04 15:40:33 +01:00
Dave Pearson
cd1b29fb2b Add see-also entries to the various blur/focus messages
This question crops up from time to time, often with people looking for
"focus" or "blur" and wondering why they don't bubble and so then wondering
how they can catch such events in ancestors in the DOM.

The Descendant prefix isn't obvious (I always forget what it is and need to
go hunting), so having the focus and blur events link to the descendant
events should help make them easier to discover.
2023-09-04 15:33:44 +01:00