fix: make file browser selection stateless and add browser regression coverage#2
Open
tacogips wants to merge 1 commit into
Open
fix: make file browser selection stateless and add browser regression coverage#2tacogips wants to merge 1 commit into
tacogips wants to merge 1 commit into
Conversation
… coverage 1. Primary Changes and Intent: Refactor the file browser so the frontend owns row selection while the Tauri backend returns stateless, sorted, paginated directory snapshots; add browser-level regression coverage for h/j/k/l navigation and the file-browser harness needed to reproduce focus behavior outside Tauri. 2. Key Technical Concepts: - Stateless Tauri directory listing contracts - Frontend-owned selected path and absolute selected index - Server-side sorting with offset/limit paging - Browser keyboard/focus regression testing with Playwright - Lazy app entry loading to avoid importing Tauri-only modules in browser harness mode 3. Files and Code Sections: - src-tauri/src/viewer/service.rs, src-tauri/src/viewer/types.rs, src-tauri/src/commands/document.rs, src/lib/tauri/document.ts: remove backend-owned selection fields from the directory API and keep list responses page-oriented - src/features/workspace/WorkspaceShell.tsx, src/features/file-view/FileBrowserPane.tsx: move selection ownership to the frontend and update keyboard/focus handling around list navigation - src/features/file-view/FileBrowserHarness.tsx, e2e/file-browser-keyboard.pw.ts, playwright.config.ts, src/app/App.tsx: add a browser harness route and end-to-end coverage for file-tree keyboard behavior on this Nix environment - src/features/file-view/sort.ts, src/features/file-view/sort.test.ts, src/features/preview/PreviewPane.tsx, src/app/App.css, README.md, flake.nix, package.json, bun.lock, src-tauri/Cargo.toml, impl-plans/active/file-viewer-mode.md: supporting updates for sorting, preview behavior, tooling, dependencies, and plan/docs 4. Problem Solving: Remove the dual source of truth between frontend and backend selection state, make the browser harness mount without importing Tauri window APIs, and make Playwright use the system Chromium plus a Bun/Vite startup configuration that works in this repository's Nix setup. 5. Impact: The file tree API is simpler, the frontend can reason about selection without backend echo state, and the repository now has repeatable browser coverage for keyboard navigation and focus behavior. 6. Unresolved TODOs: - [ ] None
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
h/j/k/lnavigation, using a Nix-friendly Chromium/Vite configurationVerification
bun run typecheckbun testbunx playwright test e2e/file-browser-keyboard.pw.tsCARGO_TERM_QUIET=true cargo check -p chillaCARGO_TERM_QUIET=true cargo test -p chilla