Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
86c6eb2 to
2057121
Compare
…, its cursor and its ring The tested core of Keyboard in Sidebar, with no caller yet: which row the keys are on, what each key asks of it, and how the mode ends. Its tests draw a stand-in sidebar the way the real one will call it. Four things the tests found: a header that a key folded or unfolded is noted as it is now, so a second key in the next frame does not undo the first; the mode's "just came on" memory is reset when the mode goes off, so the frame it comes on in takes no key on every entry (before, only on the first); the starting cursor is placed before the keys are read, so a key in the first frame that has rows acts from the shown row instead of being dropped; and a sidebar that was not drawn for a while forgets its old rows, so the mode asked for again starts from the row shown now.
2057121 to
493fc74
Compare
eliets2
left a comment
There was a problem hiding this comment.
First-pass review notes (automated; combined from specialist angles: user experience). Please treat as suggestions and verify before acting.
Summary: This pull request adds the tested core of Keyboard in Sidebar in crates/ui-egui/src/panels/side_keys.rs, with no caller yet. It defines a sidebar-owned cursor and ring, navigation and choosing keys, type-ahead, F2 rename, key ownership while the mode is on, and the conditions that end the mode, plus supporting state, visibility, strings, and tests.
Logical units:
- Mode, cursor, navigation, choosing, type-ahead, and F2 in
side_keys.rs - Key ownership and mode-exit conditions, including dialogs, menus, and drags keeping the keys
- Five state fields in
state.rsandSECTION_HEADERvisibility frompanels - Two new strings in all 17 catalogs
- 28 tests in
tests/side_keys.rs
Findings:
- [user experience]
crates/ui-egui/src/panels/side_keys.rs,begin()/keys()/no_focus_move(): Tab and Esc end the mode by surrendering egui focus to nothing, so keyboard focus is lost instead of moving to the photos grid. Fix: move focus to the photos view or the last photo control on exit. - [user experience]
crates/ui-egui/src/panels/side_keys.rs, cursor inapp.ui.sidebar_cursor: the cursor is not egui focus and is not exposed to assistive technology, so a screen-reader user gets no row name, position, or expanded state when the cursor moves. Fix: announce the focused row, e.g. via focus or an aria-live update. - [user experience]
crates/ui-egui/src/panels/side_keys.rs,keys(),PAGE = 10: Page Up / Page Down always move 10 rows regardless of how many rows are visible, which can overshoot the viewport and disorient the user. Fix: move by the number of rows that fit in the panel height. - [user experience]
crates/ui-egui/src/panels/side_keys.rs,begin(), hint toast: the only explanation of the mode is a toast shown once per session for 6 — the note is truncated in the source and states no concrete fix.
Overlaps: None listed.
Verdict: needs changes. The 3 most important points are: focus is lost to nothing on Tab/Esc exit instead of moving to the photos grid; the cursor is not exposed to assistive technology, so row name, position, and expanded state are not announced; and Page Up / Page Down move a fixed 10 rows regardless of visible rows, overshooting the viewport.
|
@eliets2 thanks for the first-pass notes. I checked each point against the current head and changed nothing in this PR:
|
Off
main.Problem
Nothing in the left sidebar can be reached or told apart from the keys: no row takes focus, and the only key the panel reads is Esc during a drag. Keyboard in Sidebar (a mode that gives the keys to the sidebar) needs a core that knows which row the keys are on, what each key asks of it and when the mode ends, before any row is wired to it.
Change
The tested core of Keyboard in Sidebar,
crates/ui-egui/src/panels/side_keys.rs, with no caller yet: the sidebar's wiring is the next PR (the module's doc names it).state.rs: five small fields for the mode, the cursor and its grace frames;left/sections.rsandleft.rsmakeSECTION_HEADERreachable frompanels; two new strings (the hint toast and "This row has no name to change") in all 17 catalogs.Not in this PR: the sidebar's rows reporting to the core, View ▸ Keyboard in Sidebar, the shortcut, and the native macOS menu giving up its accelerators (the next PR). Choosing several rows with Shift+arrows is not planned here (it needs the multi-select UI).
How it was checked
cargo xtask cipassed at493fc74fb5in the hostedCIgate (all 8 steps). (hosted CI gate passed at 493fc74)493fc74fb5(macOS, onmain472560b309):cargo check --workspace --all-targets,cargo clippywith-D warningsandcargo fmt,cargo xtask parityandcargo test -p lightcraft-ui-egui -- side_keys(28 passed); the fullcargo xtask ciis the hostedCIgate's.tests/side_keys.rsdraw a stand-in sidebar the way the real one will call the core (begin,note_row/note_open/note_unseen/chosen/ringper row) and press keys frame by frame; they cover navigation, choosing, fold and unfold, type-ahead, F2, every way the mode ends, stale rows, the keys when a dialog or a drag is open, Local twins and the warning mark. Each fix has a test seen failing without it:a_key_in_the_second_frame_acts_from_the_shown_row,the_frame_the_mode_comes_on_in_takes_no_key,left_and_right_fold_unfold_and_step_in_and_outanda_sidebar_hidden_meanwhile_starts_afreshfail on Sidebar: the left sidebar from the keyboard #1245's version of the core and pass here;esc_and_tab_give_the_keys_back,tab_with_no_rows_gives_the_keys_back_without_moving_the_focus,typing_finds_a_smart_album_flagged_with_a_warning_by_its_name(which also types a space inside a flagged name) anda_local_folder_listed_twice_out_of_sight_is_two_rowsfail on this core before its last fixes (Tab leaving egui's focus on a control, the warning mark, Local twins out of sight).Screenshots
Not a visible change; the next PR has them.
Merging
shortcuts.rs, which the next PR edits too; MENU-BAR: every command has a place in the menus, and View drops from 62 rows to 36 #2194 (menu structure) editsmenus.rs; Library: show several albums, folders, keywords or dates at once (library.source {ids, paths}; engine only) #1153 and LR-BEHAV-MULTISELECT: the model for choosing several sidebar rows with Cmd/Ctrl+click and Shift+click #2707 (choosing several sidebar rows) editpanels/left/*.unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none.Checklist
unwrap/expect/panic!, no indexing or unchecked arithmetic on a number from a file, a person or an agent (get,checked_mul, NaN and char boundaries handled)tr()and has its key incrates/ui-egui/locales/*.json; a new shortcut is free indocs/library-shortcuts.mddocs/parity-checklist.mdand its entry indocs/gaps.mdare updated, honestly (🟡 when it is partial), in the same commitassets/ATTRIBUTION.md; no font or media files addedSummary by CodeRabbit