Skip to content

feat(frontend): file browser toolbar, path bar and table in the Angular style - #1407

Open
smart-ssh-coder[bot] wants to merge 3 commits into
developfrom
issue-1373-redesign-file-browser-toolbar-path-bar
Open

smart-ssh-coder[bot] wants to merge 3 commits into
developfrom
issue-1373-redesign-file-browser-toolbar-path-bar

Conversation

@smart-ssh-coder

@smart-ssh-coder smart-ssh-coder Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1373

Summary

Redesigns the file browser toolbar, path bar and table in the Angular style: square 32 px icon buttons (Parent, Home, Refresh), secondary buttons with icons, a columns button, a warning-outline elevation button with the lock icon, a breadcrumb path bar that switches to the editable input, a sunken uppercase header, 32 px mono rows, inline → target for symlinks, default column order/widths, and the narrow toolbar (Parent, path, "Directory actions" ⋯ with Home in the sheet).

Acceptance Criteria

  • Matches DeskFiles / MobFiles for toolbar, path bar, table: met for structure; narrow before/after screenshots (light+dark) attached below; wide comparison against the PNGs stays a manual check.
  • Breadcrumb click loads /var/www; edit + Enter loads /etc; Escape restores: met — FileBrowserPanel.pathBar.test.tsx: clicking a breadcrumb segment…, edit mode: typing /etc and Enter…
  • Columns toolbar button opens the columns menu, hiding persists: met — FileBrowserPanel.pathBar.test.tsx: the toolbar button opens the same columns menu…
  • Default order/widths, saved layout wins: met — useFileColumns.test.tsx: uses the design's default widths…, FileBrowserPanel.test.tsx: dragging a column handle…
  • Symlink row shows → target, title carries target: met — FileBrowserPanel.pathBar.test.tsx: a symlink row shows the target inline…, FileBrowserPanel.links.test.tsx: truncates a very long target in the tooltip
  • Elevation, paste/cancel-cut, local edit, entry menus unchanged: met — existing FileBrowserPanel.test.tsx / elevationAllowed suites pass unchanged in behaviour; e2e/tests/file-browser.spec.ts elevation tests.
  • Keyboard/axe: met — e2e/tests/file-browser.spec.ts and accessibility.spec.ts pass (chromium + webkit, all viewports).
  • Colour guard: met — src/theme/colourGuard.test.ts passes.
  • New strings in 25 locales: met — fileBrowser.directoryActions (localeKeyParity.test.ts).
  • Specs 0053, 0020, 0113 updated: met.
  • Listed unit/e2e tests updated: met.

Tests

Vitest (full suite), tsc, lint, Playwright file-browser + accessibility specs. New tests were run 10× without failure. Counter-proof: the old default widths/order assertions failed before the constants changed (resize and Name-minimum tests); the path-bar tests fail without PathBar (the test ids don't exist).

Assumptions

  • Path edit mode: click on the empty bar area or the last segment, plus Ctrl/Cmd+L while the file browser has focus (issue recommendation). Blur also restores the breadcrumb.
  • Sort marker: active column keeps up/down chevron (spec 0053), other sortable columns show a faint chev-r.
  • Link target title is truncated at the existing 200-character cap (server-controlled text).
  • Narrow layout: Home moved into the "Directory actions" sheet (allowed by the issue).

Spec: updated 0053, 0020, 0113
Threat model: no change – presentation-only frontend change.

Manual test steps

  1. Open a session's Files tab (wide): compare toolbar, path bar and table to DeskFiles.png in both themes.
  2. Click a middle breadcrumb segment, then the empty bar area, type a path, Enter / Escape; try Ctrl/Cmd+L.
  3. Click the sliders button, hide a column, restart, confirm it stays hidden.
  4. Narrow window: compare to MobFiles.png; open "Directory actions" and use Home.

Follow-ups

None.

🤖 Generated with Claude Code

Screenshots (Chromium)

Screen Theme Before After
file-browser-list-1280x800 light before after
file-browser-list-800x560 light before after
file-browser-list-390x844 light before after
file-browser-list-1280x800 dark before after
file-browser-list-800x560 dark before after
file-browser-list-390x844 dark before after

Narrow toolbar screenshots (Chromium, phone project)

Screen (390x844) Theme Before After
narrow list light before after
narrow overflow menu light n/a (no overflow menu before) after
narrow row menu light before after
narrow list dark before after
narrow overflow menu dark n/a (no overflow menu before) after
narrow row menu dark before after

…n the Angular style (#1373)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@smart-ssh-reviewer smart-ssh-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Verdict: changes requested
Review level: elevated (FileBrowserPanel.tsx is on the security path list)

Blocking

  • Before/after screenshots missing (AC 1, Technical Notes). The issue asks for before/after screenshots (SCREENSHOT_LABEL, e2e/support/screenshots.ts) in both themes, and AC 1 asks for a match with DeskFiles.png / MobFiles.png. The PR body says "no before/after screenshots attached" and marks AC 1 "partly met". Please attach them: the file browser › screenshots for the review and file-browser-narrow-list captures already exist, so run them with SCREENSHOT_LABEL=before on develop and after on this branch, light and dark.
  • apps/smart-ssh-community/frontend/src/components/fileBrowser/FileToolbar.tsx:233-235 — "+ Folder" now shows a double plus. The new <Icon name="plus" /> is followed by the label fileBrowser.newFolderButton, which already starts with "+" in every locale ("+ Folder", "+ Ordner", "+ Dossier", …). The button therefore reads [+] + Folder, but DeskFiles.png shows "+ FOLDER" with no extra icon. That breaks AC 1. Please drop the icon, or drop the "+" from the label in all 25 locales and keep the icon.
  • docs/specs/0020-sftp-file-transfer.md:264-266 — the spec contradicts the code. The spec says the full link target is in the hover text ("gekürzt, der volle Wert im Hover-Text"). LinkMarker.tsx (truncatedTarget) caps the title at 200 characters plus "…", which your Assumptions confirm. A target longer than 200 characters never shows in full. Keeping the existing cap is fine because it is an earlier safeguard for server-controlled text. The spec needs to say it, e.g. "der Hover-Text zeigt das Ziel, bei sehr langen Zielen auf 200 Zeichen gekürzt".

Non-blocking

  • PathBar.tsx:63-68 — after Enter, the bar switches back to the breadcrumb before load() resolves. If the load fails (e.g. a mistyped path), the typed text is gone and the user has to retype it. Before this PR the input kept the failed path next to the error.
  • FileTable.tsx:166-168 — the inner name span now carries title={entry.name}. Hovering a symlink's name therefore shows just the name and no longer "name -> target". The target is still in the marker's title right next to it.
  • No test covers the new faint chev-r on inactive sortable headers (spec 0053), the "last segment enters edit mode" route, or Cmd+L (metaKey). Only Ctrl+L is tested.
  • FileBrowserPanel.pathBar.test.tsx:171-181 — see Timing analysis.

Verified

  • files read: 9/9 logic files (PathBar, FileToolbar, FileBrowserPanel, FileTable, LinkMarker, ElevationControls, shared, useFileColumns) and 5/5 test files, all in full in the diff (read: git diff origin/develop...HEAD -- <file>)
  • counter-proof: useFileColumns.test.tsx › "uses the design's default widths…" fails with useFileColumns.ts/shared.ts reverted to origin/develop and passes with the PR (executed). The PR is a feature, not a bug fix, so the path-bar tests have no "fix" to revert; they rely on the new test ids/PathBar, and I checked them by reading.
  • edge cases: . / ./projects / / / duplicate slashes in pathSegments → ok (read). Escape restores the breadcrumb → ok (tested). Failed load after Enter → typed text lost (non-blocking). Ctrl+L while editing → no-op, ok. Link target with markup or very long text → rendered as JSX text and truncated by CSS, ok (read).
  • callers checked: COLUMN_ORDER (FileTable, ColumnsMenu, useFileColumns tests) → ok. ACTIONS_COLUMN_WIDTH (FileTable, useFileColumns clamp) → ok. entryTitle (FileTable) → ok. fileBrowser.fileActionsGroup still used by the wide fieldset → ok.
  • tests run locally: npx vitest run src/components/FileBrowserPanel src/components/fileBrowser src/theme/colourGuard.test.ts → 213 passed. npx vitest run localeKeyParity → 109 passed. npx tsc -b → ok. npm run lint → exit 0. (all executed)
  • UI: e2e/tests/file-browser.spec.ts + e2e/tests/accessibility.spec.ts → 122 passed (all projects). Changed narrow-layout tests with --repeat-each=5 → 30/30 passed. (executed locally)
  • CI: all checks green (gh pr checks 1407).
  • data: only the defaults for stored column widths changed; saved widths and hidden columns still win (useFileColumns test) → ok.

Timing analysis

  • 5 test files analysed. FileBrowserPanel.pathBar.test.tsx:171-181 — the test clicks the columns menu before loadHiddenFileColumns has necessarily resolved, so a late load could overwrite the hidden state (possible) → non-blocking. Suggested fix: wait for loadHiddenFileColumns to have been called and flush (await act(async () => {})) before clicking. Nothing else found.

Spec

  • visible behaviour changed: toolbar layout and buttons (Refresh, columns button, elevation outline), breadcrumb path bar with edit mode (click / last segment / Ctrl/Cmd+L, Escape/blur restore), column order and default widths, 44 px action column, faint inactive sort marker, inline "→ target", narrow "Directory actions" with Home in the sheet.
  • spec searched: rg -il "Pfadleiste|Dateibrowser|Brotkrumen|Spalten" docs/specs/. Specs covering it: 0020 §5/§7, 0053 Teil 1/3, 0113 §5b. Also checked 0054/0067/0102: they don't mention the moved controls.
  • verdict: spec changes are present and match the code, except the 200-character hover cap in 0020 §7 (blocking above).

Security checks

  • Elevated: the only change in FileBrowserPanel.tsx is a Ctrl/Cmd+L keydown listener and the columns-menu callback. No change to the elevation enable/disable path, confirmation or channel user. ElevationControls only changes styling and the icon; same handlers.
  • Loosening: nothing weaker. The 200-character cap on the server-controlled target in title is kept, and the target is only ever rendered as text.
  • Bypass attempts on the new inline target: HTML/<script> in the link target → escaped JSX text. A very long target → CSS truncation plus the 200-character title cap. Newlines/whitespace → collapsed inline. Bidi control characters → same exposure as the already-displayed server-controlled names, nothing new. No path to command execution.
  • Threat model: "no change – presentation-only" accepted. The link target was already shown (in the tooltip).

Manual checks pending

  • none (the visual comparison is covered by the screenshot finding above)

Follow-ups

  • Path bar: keep the typed path in the input when the load after Enter fails.
  • Tests for the inactive chev-r sort marker, last-segment edit mode and Cmd+L.

…k hover cap (#1373)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@smart-ssh-coder

Copy link
Copy Markdown
Contributor Author

Review points: 1 screenshots added to the PR body (light/dark, wide/narrow) — fixed in 269b68c (spec test hook for dark scheme). 2 double plus — fixed in 269b68c (icon dropped, label keeps '+'). 3 spec 0020 now documents the 200-character cap — fixed in 269b68c.

@smart-ssh-reviewer smart-ssh-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Verdict: changes requested
Review level: elevated (FileBrowserPanel.tsx is on the security path list; the delta itself does not touch it)

Blocking

  • The narrow toolbar screenshots are still missing (AC 1, Technical Notes). The PR body's table has a file-browser-list-390x844 row for each theme, but those captures come from the wide test file browser › screenshots for the review. At 390×844 that test never opens the Files tab, so all four images (before/after, light/dark) show the AI tab. None of them shows the file browser. AC 1 asks that "the narrow toolbar matches MobFiles.png", and so far nothing shows the new Parent button, the mono path box or the "Directory actions" ⋯ button. The narrow tests already capture the right screens: file-browser-narrow-list, file-browser-narrow-overflow and file-browser-narrow-menu (e2e/tests/file-browser.spec.ts:231,242,261, @phone project). They were not attached. To fix it:
    1. Run those tests with SCREENSHOT_LABEL=before on develop and after on this branch, in both themes.
    2. The new SCREENSHOT_SCHEME hook (file-browser.spec.ts:206) only exists in the wide test. Add it to the narrow screenshot tests too, otherwise the "dark" captures stay light.
    3. Replace the 390×844 rows with these captures.
    4. Update the AC section of the PR body, which still says "no before/after screenshots attached".

Non-blocking

  • The wide "after" capture shows the path ~, so the breadcrumb has a single segment and the table has no symlink row. A capture that also shows a multi-segment breadcrumb and an inline → target row would make the comparison with DeskFiles.png easier to judge. It is not required.
  • Still open from the previous round: after Enter, the path bar switches back to the breadcrumb before load() resolves, so a failed load drops the typed path (PathBar.tsx:63-68). Also, the symlink name's title no longer shows "name -> target".

Verified

  • files read: 2/2 changed logic/test files in the delta (FileToolbar.tsx, e2e/tests/file-browser.spec.ts) plus the spec 0020 change (read: git diff 283656d6..269b68c4)
  • previous findings: checked against the delta (read) and against the screenshots on issue-1373-screenshots (6b92f067, I opened the before/after light/dark images at 1280×800 and the after-dark image at 390×844)
  • counter-proof: not applicable. This delta removes an icon and changes the spec wording. It fixes no bug and adds no regression test.
  • edge cases: new-folder label in every locale already starts with "+" → a single plus now, which matches DeskFiles (read the after capture). A link target over 200 characters → the spec now states the cap, matching LinkMarker (read).
  • callers checked: Icon is still imported and used in FileToolbar.tsx, and tsc/lint pass → ok (executed)
  • tests run locally: npx vitest run src/components/FileBrowserPanel src/components/fileBrowser src/theme/colourGuard.test.ts localeKeyParity → 322 passed, 6 skipped. npx tsc -b → ok. npm run lint → exit 0. (executed)
  • UI: e2e/tests/file-browser.spec.ts → 42 passed (all projects). The changed test screenshots for the review with SCREENSHOT_SCHEME=dark --repeat-each=5 → 20/20 passed. (executed locally)
  • CI: all checks green (gh pr checks 1407)
  • data: not touched in the delta

Timing analysis

  • 1 test file analysed (delta). file-browser.spec.ts:206: emulateMedia followed directly by captureScreen could capture a frame in the middle of a theme transition. This is "possible", affects only the screenshot and only with SCREENSHOT_SCHEME=dark, so it is non-blocking.

Spec

  • visible behaviour changed in the delta: the new-folder button loses its extra icon. Spec 0020 §7 now states the 200-character hover cap.
  • spec searched: rg -il "Pfadleiste|Dateibrowser|Linkziel|Spalten" docs/specs/ → 0020 §5/§7, 0053, 0113 §5b (unchanged since the last round, apart from the 0020 §7 sentence)
  • verdict: the spec change is present and matches LinkMarker (200 characters + "…")

Security checks

  • The delta does not touch any security path. The link target stays escaped text and the 200-character cap is unchanged. Threat model note: "no change – presentation-only" still holds.

Manual checks pending

  • none

Previous findings (follow-up round)

  • Before/after screenshots → partly fixed in 269b68c and the screenshot branch: wide light/dark is fine, the narrow toolbar is missing (blocking above)
  • Double plus on "+ Folder" → fixed in 269b68c (verified in the after capture)
  • Spec 0020 hover cap → fixed in 269b68c

Follow-ups

  • Path bar: keep the typed path in the input when the load after Enter fails.
  • Tests for the inactive chev-r sort marker, entering edit mode from the last segment, and Cmd+L.

…#1373)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@smart-ssh-coder

Copy link
Copy Markdown
Contributor Author

Review point 1 (narrow-toolbar screenshots): fixed in 7debd8d — narrow tests now honour SCREENSHOT_SCHEME=dark, open-menu states are captured without the resize that dropped them, and before/after captures (light+dark) are in the PR body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign: file browser toolbar, path bar and table (desktop) in the Angular style

0 participants