Repository navigation
feat(file-viewer): resize and expand the window, back/forward between previewed files - #659
Conversation
|
Thanks @opticon454, this is a welcome one: the File Viewer gets Back/Forward between previewed files (buttons plus Alt+←/→), an Expand button that is remembered per device, and a corner grip to resize the window. The history logic is clean and the tests cover it well. A few things before it goes in:
Two optional extras:
Once 1 to 4 are in, I'll merge it. Thanks again for building this! |
…llows history, swallow Alt+arrows Under 600px the window stays full screen whatever Expand or a drag says, and both controls are hidden. Stepping onto a folder-grid entry goes through the grid so its index follows. Alt+left/right is swallowed at the ends of the list too. Adds tests for the key handler, the grip clamp and the history/grid case, zh-CN titles and wiki lines.
|
Pushed
Typecheck, lint, format and the full |
9b6d258 to
2cd0d82
Compare
|
Thanks @opticon454 for the quick turnaround. This gives the File Viewer Back/Forward between previewed files (buttons plus Alt+←/→), an Expand button remembered per device, and a corner grip to resize the window, and all four items from my last comment are in. I checked them in Chromium: on a 390x844 phone the window stays 390x844 with Expand on and with a leftover drag size, and both controls are hidden; desktop keeps its 900x700 default; a drag keeps the grip under the pointer; folder paging continues from the file you stepped back to; and with the terminal focused, Alt+← steps while Alt+→ at the end of the list is swallowed instead of reaching the session. One small thing turned up:
A few doc touches I will make at merge time:
I will merge this with the grip fix on top. If you would rather push the fix yourself, go ahead and I will merge once it lands. Thanks again for building this! |
|
Thanks @Ark0N. The grip fix is in the new commit: |
|
Thanks @opticon454, the grip fix is in: As agreed, I will make these at merge time:
I will also keep the Expand button's label fixed while it is pressed ( I will merge it with these on top. Thanks again for building this! |
Merge-time fix for #659. The Expand button swapped its title and aria-label to "Restore size" while on, so a screen reader announced "Restore size, pressed". The label now stays "Expand" and aria-pressed alone carries the state, the way the MD, Lines and Wrap toggles work. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge-time fix for #659. - Alt+Left/Right (File Viewer back/forward) is a display-only entry in DEFAULT_SHORTCUTS, so the Ctrl+? overlay lists it, and a row in the help modal's Panels group, pinned in help-modal-shortcuts.test.ts. zh-CN entry for the new label; the "Restore size" entry is dropped, since nothing shows that string any more. - The wiki row moves from "Sessions and tabs" to "Everything else". - The grip comment in styles.css says only phones hide the grip; tablets show and use it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…dow, back/forward between previewed files Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Merged and shipped in 1.44.0. Thank you @opticon454! Resizing, Expand and Back/Forward make the File Viewer feel like a real window, and phones staying full screen was the right call. What I added at merge time:
|
What
The File Viewer window (where a markdown file opens) can be resized and expanded, and has Back and Forward buttons for jumping between files.
Why
A document that links to another document replaces itself in the overlay with no way back, so reading a set of linked notes means closing and reopening each one. The window is also fixed at 900x700, which is small for a long document or a wide table.
How
←and→buttons (and Alt+← / Alt+→) walk the list. Opening something new from the middle of the list drops the forward entries, as a browser does; reloading the file already showing (the MD and Page toggles) adds nothing; closing the viewer clears the list. The buttons stay hidden until there is somewhere to go, and unsaved edits still ask before leaving.Tests
test/file-preview-window.test.ts(new): list recording, stepping without re-recording, dropping forward entries, no duplicate on reload, clearing on close, the unsaved-edits prompt, expand toggle and re-apply, and the markup. The full suite passes. Changeset included.