Repository navigation
feat(ui): return to the top of the list on a new copy or paste - #11
Conversation
Copying something new, or pasting a clip back from the list, snaps the history list back to the top with the newest clip highlighted; summoning the window lands there too. The cue is the newest created_at rising across a rebuild, which only add() does — pin and remove leave the cursor put.
Pinned clips sort above the newest, so snapping the list to the top left the cursor on a pin instead of on the clip that just arrived. Follow the clip itself: remember its content, select its card and scroll it into view, and defer that scroll to the frame that lays the row out, since a card appended moments ago — or every card in a window only just mapped — has no position yet. A copy usually happens with the window down, where nothing can be shown and stray tick callbacks would pile up. Hold the arrival and honour it on the next summon instead; a summon with nothing waiting still goes home to the top. Seed the newest-seen stamp at startup so the history already on disk does not count as one big arrival. Closes Walkercito#10
|
Thanks for this — the behaviour you describe in #10 is exactly right, and the shape of the change (watch the max 1. Pinned clips sort above the newest, so the top is not the new clip. 2. The scroll had to be deferred past the frame that lays the row out. A card appended moments ago — and every card in a window only just mapped — has no allocation yet, so 3. A copy almost always happens with the window down. Acting on it right then shows the user nothing and piles up tick callbacks on a hidden window. The arrival is held in Verified live against a 12-pin history: copy while visible, copy while hidden then summon, summon with nothing new, cold start with and without something on the clipboard. Merging — closes #10. |
What does this PR do?
Copying something new, or pasting a clip back from the list, snaps the history
list to the top with the newest clip highlighted; summoning the window lands
there too.
Type of change
Checklist
-Werror).ctest --preset debugpasses. (150/150)cmake --build --preset asan && ctest --preset asan(zero leaks, zero UB).clang-formatis clean (v18.1.8, the pinned version);clang-tidyis left to CI, per the project's.pre-commit-config.yaml.core/ships with tests. — N/A, UI-only change, nocore/touched.Notes for reviewers
created_atrising across a rebuild — which onlyadd()(a copy or paste) does, never pin or remove — so pinning/deleting keep the
cursor put.
reset_to_top()also runs onpresent().