Commit Graph

33 Commits

Author SHA1 Message Date
Isaiah Odhner
dd982f18b2 Update textual to 0.38.1 2023-09-21 16:14:02 -04:00
Isaiah Odhner
4cb9b96ce3 Update rich to 13.4.2
The next version, 13.5.0, affects the centering of tool icons.
2023-09-19 00:01:17 -04:00
Isaiah Odhner
2162ddd125 Update textual to 0.37.1 2023-09-18 22:44:55 -04:00
Isaiah Odhner
268380a0c6 Update textual to 0.36.0
All tests pass... but pyright shows the signature for app.exit changed.
2023-09-18 22:37:01 -04:00
Isaiah Odhner
e435e0a53f Update textual to 0.35.0
All tests are passing, moving on...
2023-09-18 11:50:54 -04:00
Isaiah Odhner
0225ea8780 Update textual to 0.34.0
Tests all pass.
2023-09-18 01:18:49 -04:00
Isaiah Odhner
35a6845ab5 Update textual to 0.33.0
I had to fix the layout of a few dialogs where elements decided they
wanted to start expanding a lot more than before.
I'm guessing this has to do with the changelog entry:
    "Fixed relative units not always expanding auto containers"
    https://github.com/Textualize/textual/pull/3059

The snapshot changes are basically bogus. The before and after are
visually identical, with the difference view showing all black.

Since there were a lot of switches to toggle and I had to wait for the
snapshot tests to run (slow!), I wrote a little automation to toggle
"Show difference" for all the results:

    document.querySelectorAll("#flexSwitchCheckDefault").forEach((element)=> element.click())

It would be good to have this ability in the snapshot report UI itself,
maybe even replacing the individual toggles, although I'm not sure about
that, especially since it might be laggy toggling the blend modes with
a lot of test results. (I suppose if that was really an issue, it could
toggle all the visible test results and then toggle others as they come
into view, though that's a bit more complex.)

As for understanding the structural changes to the snapshots, I tried
making a visualization using hue, coloring according to the position
of a rect within the list of rects:

    const richTerminals = document.querySelectorAll(".rich-terminal");
    
    richTerminals.forEach(function(terminal) {
        const rectElements = terminal.querySelectorAll("rect");
        
        rectElements.forEach(function(rect, index) {
            const fraction = index / (rectElements.length - 1);
            const cycles = 40;
            const hue = fraction * cycles * 360;
            rect.style.fill = `hsl(${hue}, 100%, 50%)`;
        });
    });

This shows some difference, but it isn't very elucidating, since the
structural changes only show as gradual shifts in the hue, and affect
other rects even if said rects are identical, so it's subtle and messy.

Coloring based on a hash proves to actually highlight differences:

    const richTerminals = document.querySelectorAll(".rich-terminal");
    
    richTerminals.forEach(function(terminal) {
        const rectElements = terminal.querySelectorAll("rect");
        
        rectElements.forEach(function(rect, index) {
            const hash = hash(rect.outerHTML);
            const hue = (hash % 360 + 360) % 360;
            rect.style.fill = `hsl(${hue}, 100%, 50%)`;
        });
    });
    
    function hash(s) {
        let hash = 0;
        for (let i = 0; i < s.length; i++) {
            const char = s.charCodeAt(i);
            hash = (hash << 5) - hash + char;
        }
        return hash;
    }

As for analyzing the differences now visible, eh, "maybe later."
2023-09-18 01:08:22 -04:00
Isaiah Odhner
dd9da9cfb1 Update textual to 0.32.0
No changes seem to be needed here.
I'm updating textual-dev too just because it's compatible now.
2023-09-17 00:57:00 -04:00
Isaiah Odhner
3944a6e404 Update textual to 0.31.0
DataTable now has `max-height: 100%` by default, which breaks my layout.
2023-09-17 00:56:49 -04:00
Isaiah Odhner
938a320391 Update textual to 0.30.0
This seems fine.
2023-09-17 00:56:41 -04:00
Isaiah Odhner
28d9a2ff04 Update textual to 0.29.0
This only slightly affects the exact lightness of the grayed out radio button labels, at least as far as the tests cover.
2023-09-17 00:56:21 -04:00
Isaiah Odhner
faa9c76ba8 Test file drag-and-drop handling 2023-09-14 02:03:52 -04:00
Isaiah Odhner
7f91138a63 Use pyfakefs for file dialog tests
- The app's directory structure is not a constant, and shouldn't play into this test. Aside from codebase restructuring, directories like `__pycache__` can come and go.
- Even if a temporary directory were created with files enough to fill the view, the scrollbar would still change based on the folder structure outside of the temporary folder.
- pyfakefs is one way to ensure a consistent view of a folder structure for testing. It allows adding real folders in a readonly way. It's more complicated than I thought it would be going in, since I had to add workarounds for pyfiglet and pytest-textual-snapshot, and handle an edge case in my EnhancedDirectoryTree (which got an error which seems to be swallowed?), not to mention pyfakefs raises an error saying "No such file or directory in the fake filesystem" when actually it's the real directory not existing when trying to add it to the fake filesystem, and VS Code was hiding stack frames and refusing to step into library code, and it turned out that I was resolving the absolute path wrong, but it looked right to me because the only part that was missing was "textual-paint", when, at a glance it seemed present, since the "textual_paint" part was present. Ay-ay-ay!
- I don't know if this will fix the problem I saw where these tests' snapshots all changed with no visual or even structural changes, just the IDs of elements changing. I don't know what caused that.

Oh yeah and this is still actually a problem:
============================================= short test summary info ==============================================
FAILED tests/test_snapshots.py::test_paint_open_dialog[light_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_open_dialog[dark_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_open_dialog[light_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_open_dialog[dark_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[light_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[dark_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[light_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[dark_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
========================== 8 failed, 56 passed, 1 xfailed, 1 warning in 152.86s (0:02:32) ==========================
It worked when running in debug, but not when running normally.
2023-09-12 19:45:41 -04:00
Isaiah Odhner
ed97f0afb0 WIP: set up snapshot testing 2023-09-07 15:19:10 -04:00
Isaiah Odhner
f81e5d8250 Bump textual to 0.28.0, needed for pytest-textual-snapshot 2023-09-07 15:13:47 -04:00
Isaiah Odhner
8626fa775c Update note about watchdog
It's no longer required, since commit "Make watchdog properly optional" da0e5e52da
2023-09-06 00:05:26 -04:00
Isaiah Odhner
1c64fdb78c Fix Python rocket icon showing in dock on macOS after Set As Wallpaper 2023-07-18 18:32:32 -04:00
Isaiah Odhner
eb0f781ca8 Get screen size with tkinter instead
screeninfo caused a bouncing python rocket in the dock on mac, and didn't work.
2023-07-18 14:15:36 -04:00
Isaiah Odhner
7f3fe53d3e Get screen size properly, with screeninfo module 2023-07-18 14:03:51 -04:00
Isaiah Odhner
033e86f4e7 Make psutil optional
It's hard to install on Windows, and this seems to be misleading:

    ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects
2023-07-17 19:18:31 -04:00
Isaiah Odhner
9c8c035d14 Add type stubs for Pillow and psutil 2023-07-15 21:53:09 -04:00
Isaiah Odhner
a8bb2b253e Update Textual to 0.27.0
(Gonna use some tooltips!)
2023-06-04 15:28:14 -04:00
Isaiah Odhner
e9755637d6 Update Textual to 0.26.0
Both issues I opened have been fixed! :)
2023-05-21 22:00:39 -04:00
Isaiah Odhner
498b4ccd0a Update textual to 0.24.1
Gonna use the new `@on` decorator, and Select widget.
2023-05-17 10:47:44 -04:00
Isaiah Odhner
e1245aa9e9 Load FIGlet font format 2023-05-16 20:14:17 -04:00
Isaiah Odhner
4dbaf5145e Open and save image files with Pillow 2023-05-15 00:46:08 -04:00
Isaiah Odhner
6cf59cd79a Tweak requirements.txt so I can actually install from it
I'm setting up a virtual environment for the first time, and, trying
to install my dependencies, I ran into errors, 1. because of appscript
which is only intended for Mac, 2. PyGObject which IS for Linux, but
fails to install, missing "libgirepository1.0-dev", but it's optional,
it's just for wallpaper support. pyxgd is also for wallpaper support,
so maybe I should comment it out too.
And finally, [dev] is needed in order to use the `textual` command.

I don't know how well this can install on other systems, but at least
I can install it now, on Ubuntu.

Also, when the version numbers in my requirements.txt were bumped
when regenerating it, I'm guessing now that the dependencies weren't
actually upgraded, since `textual --version` gave me "0.19.1" up until
I set up my virtual environment (.venv), and now it matches the
requirements.txt version of "0.22.3". I still don't know why the version
numbers were bumped, or for sure that they weren't installed at those
versions somewhere in my filesystem. (I hope virtualenv makes things
more comprehensible, rather than more confusing...)

Also, now that I'm using textual 0.22.3, the radio button set has
arrow key navigation. Seeing this feature missing was what prompted me
to set up the virtual environment and (sort of implicitly) upgrade.
However, it doesn't work correctly, for the flipped horiz./vert. layout.
2023-05-05 00:54:52 -04:00
Isaiah Odhner
8b220efee8 Update requirements.txt
- This includes dependencies that are only for wallpaper support.
- I still don't know when or how my dependencies are getting updated.
2023-04-29 19:48:11 -04:00
Isaiah Odhner
0c3cc45ddd Start implementing copy/paste with pyperclip 2023-04-26 12:28:42 -04:00
Isaiah Odhner
140ff15ff1 Restart the app on changes 2023-04-19 14:27:12 -04:00
Isaiah Odhner
34aa35ec8b Update dependencies
I'm new to python package management, so I don't really know when these
packages got updated, but I'm updating this file with this command:

    python3 -m pipreqs.pipreqs --ignore .history --force
2023-04-19 02:42:54 -04:00
Isaiah Odhner
30cddbbde5 Save and load ANSI files 2023-04-11 21:18:11 -04:00
Isaiah Odhner
66bb55afd2 Create requirements.txt 2023-04-11 21:14:23 -04:00