Repository navigation
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
Open
smart-ssh-coder[bot] wants to merge 3 commits into
smart-ssh-coder[bot] wants to merge 3 commits into
Conversation
…n the Angular style (#1373) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
12 tasks
12 tasks
There was a problem hiding this comment.
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 withDeskFiles.png/MobFiles.png. The PR body says "no before/after screenshots attached" and marks AC 1 "partly met". Please attach them: thefile browser › screenshots for the reviewandfile-browser-narrow-listcaptures already exist, so run them withSCREENSHOT_LABEL=beforeondevelopandafteron 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 labelfileBrowser.newFolderButton, which already starts with "+" in every locale ("+ Folder", "+ Ordner", "+ Dossier", …). The button therefore reads[+] + Folder, butDeskFiles.pngshows "+ 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 thetitleat 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 beforeload()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 carriestitle={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-ron 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 withuseFileColumns.ts/shared.tsreverted toorigin/developand 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 inpathSegments→ 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.fileActionsGroupstill 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 beforeloadHiddenFileColumnshas necessarily resolved, so a late load could overwrite the hidden state (possible) → non-blocking. Suggested fix: wait forloadHiddenFileColumnsto 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.tsxis a Ctrl/Cmd+L keydown listener and the columns-menu callback. No change to the elevation enable/disable path, confirmation or channel user.ElevationControlsonly changes styling and the icon; same handlers. - Loosening: nothing weaker. The 200-character cap on the server-controlled target in
titleis 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-rsort marker, last-segment edit mode and Cmd+L.
…k hover cap (#1373) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
There was a problem hiding this comment.
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-390x844row for each theme, but those captures come from the wide testfile 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 matchesMobFiles.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-overflowandfile-browser-narrow-menu(e2e/tests/file-browser.spec.ts:231,242,261,@phoneproject). They were not attached. To fix it:- Run those tests with
SCREENSHOT_LABEL=beforeondevelopandafteron this branch, in both themes. - The new
SCREENSHOT_SCHEMEhook (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. - Replace the 390×844 rows with these captures.
- Update the AC section of the PR body, which still says "no before/after screenshots attached".
- Run those tests with
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→ targetrow would make the comparison withDeskFiles.pngeasier 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'stitleno 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:
Iconis still imported and used inFileToolbar.tsx, andtsc/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 testscreenshots for the reviewwithSCREENSHOT_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:emulateMediafollowed directly bycaptureScreencould capture a frame in the middle of a theme transition. This is "possible", affects only the screenshot and only withSCREENSHOT_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-rsort marker, entering edit mode from the last segment, and Cmd+L.
…#1373) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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. |
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.
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
lockicon, a breadcrumb path bar that switches to the editable input, a sunken uppercase header, 32 px mono rows, inline→ targetfor symlinks, default column order/widths, and the narrow toolbar (Parent, path, "Directory actions" ⋯ with Home in the sheet).Acceptance Criteria
/var/www; edit + Enter loads/etc; Escape restores: met —FileBrowserPanel.pathBar.test.tsx: clicking a breadcrumb segment…,edit mode: typing /etc and Enter…FileBrowserPanel.pathBar.test.tsx: the toolbar button opens the same columns menu…useFileColumns.test.tsx: uses the design's default widths…,FileBrowserPanel.test.tsx: dragging a column handle…→ 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 tooltipFileBrowserPanel.test.tsx/elevationAllowedsuites pass unchanged in behaviour;e2e/tests/file-browser.spec.tselevation tests.e2e/tests/file-browser.spec.tsandaccessibility.spec.tspass (chromium + webkit, all viewports).src/theme/colourGuard.test.tspasses.fileBrowser.directoryActions(localeKeyParity.test.ts).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
chev-r.titleis truncated at the existing 200-character cap (server-controlled text).Spec: updated 0053, 0020, 0113
Threat model: no change – presentation-only frontend change.
Manual test steps
Follow-ups
None.
🤖 Generated with Claude Code
Screenshots (Chromium)
Narrow toolbar screenshots (Chromium, phone project)