Commit Graph

6277 Commits

Author SHA1 Message Date
Will McGugan
41dbc66b23 optimize focus (#2460)
* optimize focus

* immediate call

* update previews

* snapshot
2023-05-03 11:48:56 +01:00
Dave Pearson
9e15dc45aa Link the non-issue-related DirectoryTree change back the PR 2023-05-03 11:30:44 +01:00
Dave Pearson
4250912a28 Don't reassign the path when watching the path
Bit of a thinko happening there.
2023-05-03 10:44:45 +01:00
Dave Pearson
af0ed17ebd Merge branch 'main' into directory-tree-redux 2023-05-03 10:06:30 +01:00
Dave Pearson
c4e2144207 Update the CHANGELOG 2023-05-03 09:59:35 +01:00
Dave Pearson
23d6c3611a Add DirectoryTree.reload
This is a general reload; reloading the whole tree.
2023-05-03 09:34:55 +01:00
Dave Pearson
3d6fd7ef4c Add a docstring to _load_directory 2023-05-03 09:13:42 +01:00
Dave Pearson
f509767141 Don't cast a DirEntry.path to a Path any more
It's always a Path now.
2023-05-03 09:13:11 +01:00
Dave Pearson
8311f837b8 Add a docstring to render_label
Well, okay, borrow the same from Tree.
2023-05-03 09:08:21 +01:00
Dave Pearson
d1d435d68b Flesh out the docstring for validate_path 2023-05-03 09:02:49 +01:00
Dave Pearson
e4c0517cc6 Add the node to the FileSelected message
Until now it wasn't really possible to know *which* DirectoryTree widget had
sent a given message; this makes it available by providing the `node`, which
in turn will provide the `tree`.
2023-05-03 08:58:11 +01:00
Dave Pearson
465f522ef3 Add a reminder to add the node to the FileSelected message 2023-05-02 16:48:06 +01:00
Dave Pearson
5f22cf8e7b Remove empty rule from DirectoryTree.DEFAULT_CSS 2023-05-02 16:46:07 +01:00
Dave Pearson
40e042d7e3 Make _load_directory private 2023-05-02 16:45:18 +01:00
Will McGugan
90d9693168 typo 2023-05-02 16:36:41 +01:00
Dave Pearson
d4af9d239f Add a path reactive to DirectoryTree so the path it views can be changed
A couple of things come with this, at least one being a breaking change of
sorts:

- DirectoryTree now has a path attribute
- DirectoryTree.path is a reactive
- When DirectoryTree.path is assigned to it rebuilds the tree content
- DirectoryTree.path can be assigned a str or Path but always evaluates to a Path
- DirEntry.path is now typed as a Path
- DirEntry drops is_dir (Directory.path.is_dir() does that job)
- DirectoryTree.FileSelected.path is now always a Path

This is the first of what might be a few changes here; the main thrust of
this commit being to allow changing a DirectoryTree to view a different
directory, and also to move to a Path-first approach.
2023-05-02 16:33:22 +01:00
Dave Pearson
922934597d Sort the component classes to match the docs 2023-05-02 16:30:16 +01:00
Will McGugan
a2aef3da0d updated call_from_thread API docs 2023-05-02 16:28:12 +01:00
Will McGugan
aedac6a9b9 update roadmap 2023-05-02 16:20:16 +01:00
Will McGugan
91a9d570a4 On decorator (#2453)
* Add on decorator

* decorator code

* docs for on decorator

* Examples

* test errors

* simplify listing

* words

* changelog

* Update docs/guide/events.md

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

* Update docs/guide/events.md

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

* Update docs/examples/events/on_decorator.css

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

* Update docs/guide/events.md

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

* rewording

* comment

* clarification

* Added note

---------

Co-authored-by: Dave Pearson <davep@davep.org>
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-05-02 16:17:40 +01:00
Dave Pearson
83c09b3cfd Add a missing type hint
Looks like this has been missing since DirectoryTree was first written.
2023-05-02 15:51:18 +01:00
Dave Pearson
d0639a0cc1 Correct the type of the TreeExpanded event
This looks to have been a slight typing bug all along.
2023-05-02 15:29:36 +01:00
Rodrigo Girão Serrão
914e50a70f Export types & doc improvements (#2329)
* Export types used in app.py

* Export more linked types/errors/classes.

* Remove custom template.

* Address review comments.

We need to have explicit 'Returns:' sections in properties if we want to link to the return type while https://github.com/mkdocstrings/python/issues/65 is open.

* Improve docs.
2023-05-02 15:12:53 +01:00
Dave Pearson
911ffdb144 Merge pull request #2455 from davep/snapshit-speedup
Remove the bytewise diffing of failed snapshots
2023-05-02 14:55:47 +01:00
Dave Pearson
d67b516707 Merge pull request #2454 from davep/ci-test-only-code-changes
Attempt to narrow CI/test trigger to just code changes
2023-05-02 14:55:17 +01:00
Dave Pearson
16931a8563 Move DirectoryTree.FileSelected.path's doc to inline style
This brings it in line with the documentation for other widgets and their
messages.
2023-05-02 14:19:55 +01:00
Dave Pearson
2ad3903d43 Remove the bytewise diffing of failed snapshots
In doing so this removes the file similarity value, and as such the key that
the failure report was sorted on. This was done because, given how many
snapshot tests we have now, if lots failed, it would take a long time (often
many minutes) to compile the report.

The report is now sorted on the test name.

Now, no matter how many snapshots fail, the report should be produced pretty
much instantly.
2023-05-02 13:47:18 +01:00
Dave Pearson
9dda90ea75 Extend testing to some more files
In this case the snapshot data, the lock file and the Makefile.
2023-05-02 13:07:47 +01:00
Dave Pearson
7152adfdf5 Remove the test change
That seemed to do the trick!
2023-05-02 13:07:30 +01:00
Dave Pearson
aa9f6392c3 Make a change to a py file to see if CI will kick off tests 2023-05-02 12:57:08 +01:00
Dave Pearson
a8d2724873 Attempt to narrow CI/test trigger to just code changes
Looking at
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
I *think* this might be the approach to take. Consider this an experimental
change that will very likely get rolled back.

See #2404
2023-05-02 12:52:51 +01:00
Dave Pearson
8a29c7ea2c Merge pull request #2452 from davep/outline-top-bottom-colour-glitch
Fix outline-top and outline-bottom not handling colour alpha
2023-05-02 11:45:26 +01:00
Dave Pearson
16ca3e10d1 Merge branch 'main' into outline-top-bottom-colour-glitch 2023-05-02 11:34:14 +01:00
Dave Pearson
d34d1b19b2 Merge pull request #2444 from davep/overall-important
Make `!important` apply to rules that have "sub-rules"
2023-05-02 11:33:05 +01:00
Dave Pearson
9c26c6ef32 Merge branch 'main' into outline-top-bottom-colour-glitch 2023-05-02 11:05:52 +01:00
Dave Pearson
7e570df4f4 Fix outline-top and outline-bottom not handling colour alpha
See #2371.
2023-05-02 11:03:54 +01:00
Dave Pearson
87847cea4c Update the CHANGELOG 2023-05-02 10:16:45 +01:00
Dave Pearson
16d62dfb20 Distribute !important on scrollbar size 2023-05-02 10:13:24 +01:00
Dave Pearson
cbe418de18 Distribute !important on overflow 2023-05-02 10:12:18 +01:00
Will McGugan
e1a8f28f8d update to log docs (#2451) 2023-05-02 10:09:32 +01:00
Dave Pearson
ad37b6809a Distribute !important on content-align 2023-05-02 10:08:33 +01:00
Dave Pearson
763f9b012f Distribute !important on align 2023-05-02 10:06:17 +01:00
Dave Pearson
8fc6e195e1 Change the importance distribution method to be more generic 2023-05-02 09:49:06 +01:00
Dave Pearson
27ca4969a8 Add tests for styles that have "sub-styles" and !important
This is a series of tests for checking styles that have sub-styles, or
sub-parts, or whatever the correct name would be; the testing being that if
!important is applied to the whole, that it works.

Starting with #2420 it became apparent that this didn't work as intended,
and once that work started it became obvious that it affected more than just
border.

So these tests test all of the styles that can be specified as a single
whole, or as a set of parts (sides, directions, etc).
2023-05-02 09:36:08 +01:00
Dave Pearson
4ab9ba9268 Merge branch 'main' into overall-important 2023-05-02 08:46:52 +01:00
Will McGugan
83b1fcc102 raise attribute error (#2443)
* raise attribute error

* fix compute defaults
2023-05-01 16:57:40 +01:00
Will McGugan
ba90657559 update changelog 2023-05-01 16:36:05 +01:00
Will McGugan
20a1612361 Invalid pseudo selectors (#2445)
* token error

* error on bad pseudo selectors
2023-05-01 16:22:35 +01:00
Dave Pearson
60dc38c5cd Merge branch 'main' into overall-important 2023-05-01 16:22:09 +01:00
Dave Pearson
08de9a0fca Merge pull request #2442 from davep/private-watcher
Add support for private watch methods
2023-05-01 16:19:24 +01:00