Skip to content

docs(frontend): comments and coherence pass (App … FilterRulesView) - #1746

Merged
smart-ssh-coordinator[bot] merged 6 commits into
developfrom
issue-1680-comments-and-coherence-frontend-app
Dec 5, 2026
Merged

smart-ssh-coordinator[bot] merged 6 commits into
developfrom
issue-1680-comments-and-coherence-frontend-app

Conversation

@smart-ssh-coder

@smart-ssh-coder smart-ssh-coder Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1680

Summary

Comment and coherence pass over the 43 listed frontend files. Comment-only edits, plus removal of dead code and one small rework.

Files

  • App.tsx: comments fixed: 3; reworked: handleCreateServerInGroup(groupId) (only ever called with null) is now handleCreateFirstServer
  • api.ts, api/activitiesApi.ts, api/eventPayloads.ts, api/listenTyped.ts, bootstrap.tsx, buses/*.ts: no change
  • api/api.ts: comments fixed: 2
  • api/errorCodes.ts: comments fixed: 8 (doc comments moved onto the constants they describe)
  • api/eventNames.ts: comments fixed: 1
  • api/events.ts: comments fixed: 5
  • api/fileDialog.ts: comments fixed: 1
  • api/types.ts: comments fixed: 2; reworked: removed empty section headers and three unused hand-written duplicates of generated types (ConnectStepStatus, ChatHistoryRole, KeychainUnavailableReason)
  • api/voiceApi.ts: comments fixed: 1
  • AboutSettings: 1; AddAiProviderDialog: 9, reworked: keyForRequest moved so the doc comment sits on runModelDiscovery; AiProviderSettings: 6; AppHeader: 5; AutoExecRulesLine: 1; ChatPanel: 2, reworked: orphaned comment block removed
  • ChatRetentionSettings: 3, reworked: no longer loads its own value, takes initialDays (see below); DataPathsSection: 1; DiagnosticsSettings: 1; FileTypeSettings: 1; FileBrowserPanel: 2 (comments only)
  • AppRoot, AuthPromptDialog, AuthPromptHost, AutoReconnectSettings, BackupDialogs, BackupImportDialog, BackupKeySetup, BackupSettings, ChatSessionPickerScreen, ConnectProgressList, ConnectStepLog, ConnectingTabView, ContextUsageIndicator, ElevatedIdleSettings, FilterRulesView: no change

Files outside the list and tests added

  • SessionsAndDataSettings.tsx (reworked): the category now composes ChatRetentionSettings, AutoReconnectSettings and ElevatedIdleSettings as three peer sections. It owns the retention load and renders nothing until it has loaded (also on a load error), as the category did before.
  • extensions/registerBuiltinExtensions.ts: registers SessionsAndDataSettings; header comment corrected. LanguageSettings.tsx, McpServerSettings.tsx: comment fixes only.
  • Tests: App.firstServer.test.tsx (first-server flow, red without the App.tsx fix), SettingsScreen.test.tsx (three sections, one category title), new SessionsAndDataSettings.test.tsx (hidden until loaded, hidden on load error), new extensions/registerBuiltinExtensions.test.ts (real built-in registration uses SessionsAndDataSettings/McpServerSettings).

Acceptance Criteria

  • Every file listed: met (above)
  • No contradicting comments: met (read in full)
  • Reworks keep behaviour: met; tsc -b and the full vitest suite (2532 tests) pass, including the existing App and api tests
  • Bolted-on code beyond this area listed: met (Follow-ups)
  • Relevant automated tests pass: met locally; CI below

Spec: none (comments/refactoring only)

Threat model: no change – comments only in FileBrowserPanel.tsx

Assumptions

Removed types had no usages (rg, and tsc -b is clean).

Follow-ups

  • errorCodes.ts keeps the known-code set by hand next to the generated IPC types; clean shape: a Rust-generated code list, with the existing test checking DE/EN text per code.
  • ChatPanel.tsx: the jump button is wrapped in a redundant {( … )}; checkRef in RecoveryCodeDialog (BackupDialogs.tsx) looks unused.
  • create_overlay_titlebar doc comment in crates/app-shell/src/commands/app_meta.rs narrates history; belongs to the Rust pass.

🤖 Generated with Claude Code

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 a security path; its changes are comment-only)

Blocking

  • apps/smart-ssh-community/frontend/src/App.tsx:152 (handleCreateFirstServer): no test covers this rework (AC3). The PR names only "the existing App and api tests". Counter-proof, run locally: with setPendingNoteEditSelection({ kind: "newServer", groupId: null }) removed, src/App*, ServerList* and ManagementView* all stay green (86/86). ServerList.test.tsx:201 only checks that the callback is called, and e2e/tests/server-management-review.spec.ts:72 only checks that the button is visible. Fix: add an App-level test (or an e2e step) that clicks "Add first server" and asserts that the new-server form opens in Manage with no group. Then name that test in the PR.

  • apps/smart-ssh-community/frontend/src/components/AddAiProviderDialog.tsx:103-106: the comment this PR edited contradicts the code (AC2). It now covers the edit form but still ends "reopening starts empty". In edit mode the form starts from formFromProvider(provider), so name, type, base URL and model are pre-filled and only the key is empty. Suggested: "…discards the entries (including the API key); reopening starts from scratch: empty, or the stored provider (without its key) when editing." Also wrap the overlong line 104.

  • apps/smart-ssh-community/frontend/src/components/AppHeader.tsx:41-43: the new doc comment is wrong for the narrow layout (AC2). It puts logo and version info on the left and settings on the right, and limits only the main navigation to the wide layout. In the code, narrow also hides the logo/version block (!narrow && …, ~line 107) and the settings button (~line 178). Suggested: "wide: logo and version info, main navigation, children (session tabs), activity center, settings; narrow: only children (burger + title) and the activity center."

  • apps/smart-ssh-community/frontend/src/api/api.ts:872: a doc comment is attached to the wrong function (AC2, applies to every listed file). "Ziel-Nutzer des aktiven erhöhten Kanals, null = aus." sits on top of the doc for sftpElevationAllowed. It describes sftpElevationStatus, two lines further down, which has no doc. This PR added the section header right above it. Move the line onto sftpElevationStatus.

  • apps/smart-ssh-community/frontend/src/api/errorCodes.ts:229-247: history narration remains, and one reference now points to nothing (requirement "remove what only narrates history", AC2). Details:

    • MASTER_PASSWORD_FILE_ABSENT still says "Vorher lief das unter MASTER_PASSWORD_FILE_FAILED, und der Text behauptete …".
    • MASTER_PASSWORD_MODE_MISMATCH still says "als einer gemeldet behauptete die Meldung …".
    • Both comments now start with a broken short first line.
    • KEYCHAIN_KEY_MISMATCH starts "Derselbe Fund:", but the PR removed the review finding that referred to.

    Say what the code does and why, e.g. "'Neu anfangen' on a database without a key file here: not a file error, the keychain mode is already active." and "The operation does not fit the active mode (A18); not a file error." The stage wording in the same listed files falls under the same requirement. Fix these while you are there:

    • errorCodes.ts:206 ("seit Etappe 2") and :219 ("(Etappe 3)").
    • buses/navigationBus.ts:1 and api/events.ts:148 ("(Etappe 4)").
    • errorCodes.ts:82 is missing a colon ("Spec 0069, Teil A5: dritter …").
  • apps/smart-ssh-community/frontend/src/App.tsx:212 → :284: a valid "why" was deleted instead of moved (requirement "keep and sharpen the why"). The removed Spec 0010 comment explained why <NoteSuggestionToast /> is mounted once at the root: a suggestion must still arrive after the user left the session screen, and switching views must not remount it. Its subject is still there at line 284; only the comment was in the wrong place. events.ts:142 keeps only the first half of the reason. Fix: put it on that line, e.g. {/* Spec 0010, §2 item 6: mounted once at the root so a suggestion still arrives after the session screen was left, and view switches do not remount the listener. */}

  • apps/smart-ssh-community/frontend/src/components/ChatRetentionSettings.tsx:8-13: bolted-on shape documented instead of reworked (in-scope rework, requirement "names that no longer fit / data living in the wrong type"). ChatRetentionSettings is registered as the whole "Sitzungen & Daten" category (extensions/registerBuiltinExtensions.ts:28). Besides chat retention, it renders AutoReconnectSettings and ElevatedIdleSettings. The PR writes this into the doc comment. Clean shape: a SessionsAndDataSettings category component that renders the three sections as equals, with ChatRetentionSettings holding only retention. The only caller to change is registerBuiltinExtensions.ts, which is a direct caller and allowed by the issue. Cover it with the existing ChatRetentionSettings/SettingsScreen tests (adjusted), and name them in the PR. No open PR touches these files.

Non-blocking

  • api/errorCodes.ts:316: "errors.<code> exists in every locale" is true today: I checked all 109 known codes against all 25 locales/*/common.json files and none is missing. But no test enforces this for the whole set, and the MASTER_PASSWORD_ERROR_CODES doc says so. Consider "every known code must have an errors.<code> text; tests check this for the lists above".
  • AddAiProviderDialog.tsx:191: moving keyForRequest only changes its position, so behaviour is unchanged. Still, the edit-mode branch has no test: with it changed to always effectiveApiKey(f), AiProviderSettings*/SettingsScreen* stay green (106/106). Don't describe it as covered in the PR.
  • BackupDialogs.tsx:28: checkRef is attached to the input but never read. This is in a listed file and trivial to remove now, so it doesn't need a follow-up.
  • Overlong lines after rewrapping: AddAiProviderDialog.tsx:102, AutoExecRulesLine.tsx (rule doc), FileBrowserPanel.tsx:74. Style only.

Verified

  • AC1: all 43 files are listed (19 changed, 24 "no change"), and each entry matches the diff (read: PR body, git diff origin/develop...HEAD).

  • AC2: the other new or changed comments match the code. Checked against the code by two reviewers, and spot-checked by me:

    • event_names.rs, PROMPT_TIMEOUT, the question card, useRemoteDirectory, useLocalEditSession → loadFileTypeApps.
    • SPEECH_MODEL_PARAKEET, the DataPathsSection keychain name, the DiagnosticsSettings contents, ChatRetentionSettings (30-day start value), the AiProviderSettings divide-y list.

    The four state comments removed from ChatPanel were orphans. (read)

  • The removed types ConnectStepStatus, ChatHistoryRole and KeychainUnavailableReason have no users. The generated *Dto types remain (executed: rg, npx tsc -b).

  • errorCodes.ts: MASTER_PASSWORD_ERROR_CODES is moved with the same contents, and KNOWN_ERROR_CODES is unchanged (read; executed: errorCodes.test.ts).

  • counter-proof: not applicable (no bug fix). Two mutation checks ran instead (executed, then reverted): the App handler and the keyForRequest edit branch both stay green, so neither has test coverage (see above).

  • edge cases: removed types used in e2e → none. Reordered consts used at init → no. translateErrorCode return unchanged → ok.

  • callers checked: handleCreateFirstServer (1 call site) → ok; handleCreateServerInGroup (0 left) → ok; keyForRequest (2 call sites) → ok.

  • tests run locally:

    • npx tsc -b → exit 0 (executed).
    • npm run lint → exit 0 (executed).
    • npx vitest run on 38 affected files → 834 passed, 6 skipped (executed).
  • UI: e2e/tests/server-management-review.spec.ts passed (60 tests, executed locally). No visible UI change: only comments changed inside JSX.

  • data: not touched.

  • CI: all checks green (gh pr checks 1746).

Timing analysis

  • No test files changed.

Coherence

  • comments: 19 files checked. Two contradict the code (blocking above: AddAiProviderDialog, AppHeader). Also blocking above: one misplaced doc in api.ts, the remaining history narration in errorCodes.ts and a deleted "why" in App.tsx. The finding on errorCodes.ts:316 was dismissed as blocking: the statement is true today (verified across all locales), so it is listed as non-blocking.
  • fit:
    • ChatRetentionSettings → blocking (in-scope, clean shape above).
    • Renaming AddAiProviderDialog → follow-up, not in-scope here: the dialog has also been the edit form since #690, but open PR #1707 is changing AddAiProviderDialog.tsx and AiProviderSettings.tsx, and a rename now would collide with it.
    • Folding handleCreateServerInGroup and moving keyForRequest fit.

Spec and boundary

  • visible behaviour changed: none.
  • spec searched ("erster Server", Dateibrowser, Fehlercode, Titelleiste, Aufbewahrung): 0069 §C1, 0020/0053/0067, 0014. None needs a change.
  • verdict: not needed (comments and refactoring). No changelog fragment is needed, and no ADR.
  • boundary, CI changes, vendor: ok. The PR removes history and internal wording, adds nothing new to public texts and does not touch .github/.

Security checks

  • Invariants checked: filter bypass or a new entry point, secrets/API key path (keyForRequest, base-URL lock), AutoExec vs. Confirm, credential handling, fail-open, loosening against the base.
  • security review (subagent): 6 files, 5 bypass attempts (key sent before the base URL is filled in, edit mode with an empty key, unknown error code, a removed type still in use, a file-browser action skipping confirmation) → all blocked; no findings. "Threat model: no change – comments only in FileBrowserPanel.tsx" holds: that file has 4 lines added and 5 removed, all comment text.

UI review

  • not a UI change (only comments inside JSX changed).

Follow-ups

  • Rename AddAiProviderDialog to AiProviderDialog once #1707 has landed, since it is also the edit form (#690). Rename its props and result type to match, and update the two call sites in AiProviderSettings.tsx.
  • errorCodes.ts keeps the known-code set by hand (from the PR). Clean shape: generate the code list from Rust, and have a test check that every code has a text in every locale.
  • create_overlay_titlebar doc comment in crates/app-shell/src/commands/app_meta.rs (from the PR) → covered by the Rust pass, #1694.

…er first-server flow (#1680)

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

Copy link
Copy Markdown
Contributor Author

Review points, all addressed in d769b09:

  1. fixed – new src/App.firstServer.test.tsx ('opens the management view with a new-server form that has no group'); fails when the setPendingNoteEditSelection call is removed.
  2. fixed – AddAiProviderDialog doc now distinguishes add (empty) and edit (stored provider).
  3. fixed – AppHeader doc states what the narrow layout hides.
  4. fixed – the doc moved to sftpElevationStatus.
  5. fixed – stage/history wording removed in errorCodes.ts, navigationBus.ts, events.ts; first lines and dangling 'Derselbe Fund:' repaired; colon/sentence at the A5 comment fixed.
  6. fixed – Spec 0010 note now sits on <NoteSuggestionToast />.
  7. fixed – new SessionsAndDataSettings (three equal sections); ChatRetentionSettings is retention only; registration updated; covered by SettingsScreen.test.tsx ('Sitzungen & Daten' … shows the category title exactly once, now also asserting all three section groups).

@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 a security path. It is not touched in this delta, and its earlier changes are comment-only.)

Follow-up round: delta 7682a384..d769b092. Five of the seven earlier findings are fixed in the code. The other two are fixed in the code but not named in the PR (see Blocking 1). The new split adds four blocking points.

Blocking

  1. PR description not updated (AC1, AC3; earlier findings 1 and 7 asked for the tests to be named in the PR). The body is still from the first round.

    • App.tsx still says the rework is covered by "the existing App and api tests". Name src/App.firstServer.test.tsx instead.
    • The new rework is missing: SessionsAndDataSettings.tsx is new, and ChatRetentionSettings now holds only retention. Its covering test (SettingsScreen.test.tsx › "'Sitzungen & Daten' (registered SessionsAndDataSettings) …") is not named either.
    • The files touched outside the issue list are not named: extensions/registerBuiltinExtensions.ts, LanguageSettings.tsx, McpServerSettings.tsx.
    • The per-file counts are stale (App.tsx, ChatRetentionSettings, errorCodes.ts, AddAiProviderDialog, AppHeader, api.ts, events.ts, navigationBus.ts).

    Update the file list, the rework list and the test names.

  2. apps/smart-ssh-community/frontend/src/extensions/registerBuiltinExtensions.ts:29 — the change to this caller has no test (AC3).

    • Counter-proof (executed): with component: ChatRetentionSettings put back, the real app would drop "Automatisch neu verbinden" and "Erhöhte Rechte nach Inaktivität ausschalten" from the category. Still, all of src/components plus App.settingsNav.test.tsx stay green (1408 tests).
    • Why: SettingsScreen.test.tsx:185-199 resets the registry and registers SessionsAndDataSettings by hand. The comment at :240-242 claims the test goes through the built-in registration, which it does not.
    • Fix: add one test against the real built-in registration, e.g. import registerBuiltinExtensions and assert that the chat-retention entry's component is SessionsAndDataSettings, or render it and expect the three groups. Correct the comment at :240.
  3. apps/smart-ssh-community/frontend/src/components/SessionsAndDataSettings.tsx:12-14 with ChatRetentionSettings.tsx:55 — the split changes visible behaviour (requirement "No change in behaviour").

    • Before: ChatRetentionSettings returned null until getChatSessionRetentionDays resolved, and that also hid the other two sections.
    • While loading now: auto-reconnect and elevated-idle render at once with their default values. The retention section then appears above them and pushes them down. Until then, auto-reconnect's mt-6 border-t is the top of the content, and a select the user has already focused moves.
    • If the load fails: the category now shows two sections, and retention is missing without any notice. Before, the whole category was empty.
    • Confirmed by the UI review and the functional review (read: ChatRetentionSettings.tsx:18-24,55, AutoReconnectSettings.tsx:24,46).
    • Fix: keep the old gating. For example, SessionsAndDataSettings owns the retention load (value, loaded, error) and renders nothing until it has loaded, passing the value down to ChatRetentionSettings. Add a test that the auto-reconnect group is not shown while the retention value is still pending.
  4. Comments this PR edited now contradict the code (AC2).

    • components/McpServerSettings.tsx:139-141: the comment now points to "SessionsAndDataSettings.tsxs identischer Fund/Begründung (auch für den … border-t/pt-4-Rahmen)". SessionsAndDataSettings.tsx explains only the missing heading and says nothing about a frame. The frame reasoning was in the ChatRetentionSettings comment that the first commit removed. Say it in place, e.g. // Spec 0055, Teil 3: SettingsScreen renders the category title, so no own heading and no top border/padding frame here.
    • components/LanguageSettings.tsx:28-30: the comment points to the same place. It says "dieselbe doppelte Überschrift", although those files avoid a double heading. It also sits above handleThemeChange instead of above return (. Move it there and word it like the line above.
    • extensions/registerBuiltinExtensions.ts:1-5: the edited header says AiProviderSettings had the category <SessionsAndDataSettings /> "bisher fest verdrahtet". That component is new in this PR and was never hard-wired anywhere. Suggested: /** Registers the built-in settings categories "Sitzungen & Daten" (SessionsAndDataSettings) and MCP server (McpServerSettings) through the registry (Spec 0038, Abschnitt 4; Spec 0037/0028). Must run before the first render of AiProviderSettings, which imports this module for its side effect. */

Non-blocking

  • api/errorCodes.ts:237-238 (MASTER_PASSWORD_MODE_MISMATCH): the sibling entries now use "würde". To match them, write "als solcher gemeldet, würde die Meldung einen Zustand behaupten, der nicht vorliegt".
  • App.tsx:284-288: the closing clause "(das löste bei jedem Wechsel … einen Remount aus)" is past tense. Better: "…nicht an einen der Zweige unten gebunden, die bei jedem Wechsel Session-/Tab-Ansicht neu gemountet werden."
  • extensions/registerBuiltinExtensions.ts:17-24 still narrates history ("0050-Review-Fund", "war hier ursprünglich …"). You are in this file anyway, so you could reduce it to the "why": label is a translation key that resolveSectionLabel resolves, and the registry stays i18n-free.
  • AddAiProviderDialog.tsx:104 is still over-long (style).
  • AddAiProviderDialog.tsx:191: the keyForRequest edit branch still has no test of its own. Don't describe it as covered (still the case from the last round).
  • Timing, SettingsScreen.test.tsx:239-254 (possible): AutoReconnectSettings loads through the real, unmocked settings store. Its .then/.catch can call setState after the test has ended. Mock ../settings/autoReconnectSettings and wait for the final value of the auto-reconnect select (ADR 0122 R6/R7).

Verified

  • AC1: not met, because the PR body is stale (Blocking 1) (read: gh pr view 1746).

  • AC2: the earlier comment findings are fixed (read):

    • the api.ts doc now sits on sftpElevationStatus;
    • the AddAiProviderDialog and AppHeader docs match the code;
    • errorCodes.ts has no stage wording left, the colon is added and the dangling "Derselbe Fund" is gone;
    • events.ts:148 and navigationBus.ts:1 are fixed;
    • the Spec 0010 "why" is on <NoteSuggestionToast />.

    New contradictions: Blocking 4.

  • counter-proof:

    • App.firstServer.test.tsx is red with the setPendingNoteEditSelection({ kind: "newServer", groupId: null }) call removed, red with groupId: "g1", and green with the fix (executed).
    • SettingsScreen.test.tsx -t "Sitzungen" is red with <AutoReconnectSettings /> removed from SessionsAndDataSettings, and green with it (executed).
    • With the built-in registration put back to ChatRetentionSettings, everything stays green (executed) → Blocking 2.
  • edge cases:

    • retention load pending → finding (Blocking 3)
    • retention load fails → finding (Blocking 3; the swallowed error banner is pre-existing, see Follow-ups)
    • error banner position and spacing in the loaded state → ok
    • first server with only the local server present → ok
  • callers checked:

    • ChatRetentionSettings (1 call site) → ok
    • SessionsAndDataSettings (registerBuiltinExtensions) → untested (Blocking 2)
    • handleCreateFirstServer (1) → ok
  • tests run locally:

    • npx tsc -b → exit 0 (executed)
    • npm run lint, including check-codemap, check-doc-paths and check-file-size → exit 0 (executed)
    • npx vitest run on 14 affected files → 342 passed (executed)
  • UI: e2e/tests/switch-forced-colors.spec.ts and e2e/tests/settings-notes-review.spec.ts (both open "Sitzungen & Daten") → 44 passed (executed locally).

  • data: not touched.

  • CI: all checks green (gh pr checks 1746), and the branch is up to date with develop.

Timing analysis

  • 2 test files analysed:
    • App.firstServer.test.tsx: no timing dependency found.
    • SettingsScreen.test.tsx:239-254: late setState from the unmocked auto-reconnect store, possible → non-blocking.

Coherence

  • comments: 12 files checked. The earlier findings are fixed. McpServerSettings.tsx:139, LanguageSettings.tsx:28 and registerBuiltinExtensions.ts:1 are blocking (Blocking 4). errorCodes.ts:237, App.tsx:288 and registerBuiltinExtensions.ts:17 are non-blocking style.
  • fit: SessionsAndDataSettings composes the category cleanly, and ChatRetentionSettings does one thing again. The registry id chat-retention and the label key settings.categories.chatRetention now name a whole category of three sections → follow-up (it touches every locale file).

Spec and boundary

  • visible behaviour changed: intended none. The unintended loading/error difference is Blocking 3.
  • spec: not needed (comments and refactoring). No changelog fragment and no ADR needed.
  • boundary, CI changes, vendor: ok. No .github/ changes and nothing new in public texts.

Security checks

  • The delta touches no security path. It is frontend only, with no new IPC and no change to what needs confirmation.
  • security review (subagent): not re-run for this delta, because FileBrowserPanel.tsx is unchanged since the last round. The earlier result stands: 5 bypass attempts, all blocked, no findings.

UI review

  • No screenshots: no capture spec opens "Sitzungen & Daten". The review is from code.
    • Loading-state regression → blocking (confirmed, Blocking 3).
    • Load error now hides retention silently → blocking as part of Blocking 3. The swallowed error banner itself is pre-existing → follow-up.
    • Loaded state: order, gaps, legends and Tab order are unchanged → ok.

Previous findings

  • App.tsx handleCreateFirstServer without a test → fixed in d769b09 (App.firstServer.test.tsx, counter-proof red/green). Not named in the PR: still open (Blocking 1).
  • AddAiProviderDialog doc → fixed in d769b09.
  • AppHeader doc → fixed in d769b09.
  • api.ts misplaced doc → fixed in d769b09.
  • errorCodes history and stage wording, navigationBus, events, colon → fixed in d769b09 (MODE_MISMATCH tense is non-blocking).
  • App.tsx Spec 0010 "why" → fixed in d769b09 (tense is non-blocking).
  • ChatRetentionSettings → SessionsAndDataSettings → reworked in d769b09. The caller has no test, behaviour changed while loading, and the PR does not name it: Blocking 1-3.

Follow-ups

  • Rename the settings category id chat-retention and the key settings.categories.chatRetention to sessions-and-data / settings.categories.sessionsAndData. Update all locales, SettingsScreen.test.tsx, SettingsScreen.slot.test.tsx and the comment at SettingsScreen.tsx:123.
  • ChatRetentionSettings.tsx:18-24: if loading the retention value fails, loaded stays false and the error banner never shows. The section disappears without notice (pre-existing). Clean shape: render the role="alert" banner when the load fails, not null.
  • Rename AddAiProviderDialog to AiProviderDialog once #1707 has landed (from the last round).
  • errorCodes.ts: generate the known-code list from Rust, with a test per locale (from the last round).
  • create_overlay_titlebar doc in crates/app-shell/src/commands/app_meta.rs → Rust pass, #1694.

…lt-in registration (#1680)

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

Copy link
Copy Markdown
Contributor Author

Review round 2 points: (1) PR body updated with new tests, SessionsAndDataSettings rework and files outside the list; (2) added registerBuiltinExtensions.test.ts against the real registration, fixed the SettingsScreen.test comment; (3) SessionsAndDataSettings owns the retention load and renders nothing until loaded (SessionsAndDataSettings.test.tsx); (4) comments in McpServerSettings, LanguageSettings, registerBuiltinExtensions corrected. All fixed in cb42c5e.

@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 a security path. This delta does not touch it, and its earlier changes are comment-only.)

Follow-up round: delta d769b092..cb42c5e4. All four blocking findings from round 2 are fixed. The fix for finding 3 adds a new data path, and no test covers it. That is the one blocking point left.

Blocking

  1. apps/smart-ssh-community/frontend/src/components/ChatRetentionSettings.tsx:14 / SessionsAndDataSettings.tsx:36 — no test checks that the loaded retention value reaches the section (requirement "Every rework is covered by existing tests or a new one", AC3).
    • What changed: SessionsAndDataSettings now loads the value and passes it down as initialDays.
    • Why no test catches a break: every test resolves the load with null. That covers SessionsAndDataSettings.test.tsx, the SettingsScreen.test.tsx:35 mock and the e2e fakeBackend.ts:343.
    • Counter-proof (executed by the functional review): useState<number | null>(initialDays) changed to useState<number | null>(null) → all 1407 component tests stay green.
    • Scenario: a user has a 30-day retention stored. After such a regression, the settings show "never delete" and no day field, and no test notices.
    • Fix: add a case to SessionsAndDataSettings.test.tsx that resolves a non-null value (e.g. 14). Assert that the retention switch is on and the number field shows 14. Name the test in the PR body.

Non-blocking

  • SessionsAndDataSettings.tsx:28: the catch comment "Wie bisher: …" points back to the old code, which the issue asks to avoid. Suggested: // Load error: the category stays empty (see the doc comment above).
  • SessionsAndDataSettings.test.tsx:42-45 ("stays empty when the retention value fails to load"), possibly weak:
    • The waitFor(... toHaveBeenCalled()) is already true right after render, and the container is empty while the promise is still pending.
    • The functional review's counter-proof made this test red with the gating removed. Still, flushing the rejection before the assertion would make it airtight, e.g. await act(async () => { await Promise.resolve(); }).
  • Timing (possible, as last round): SessionsAndDataSettings.test.tsx renders AutoReconnectSettings against the unmocked settings store. Its late setSeconds/setError can land after the test ends.
    • Fix: mock ../settings/autoReconnectSettings, or wait for the final value of the auto-reconnect select (ADR 0122 R6/R7).
  • extensions/registerBuiltinExtensions.ts:16-23 still narrates history ("war hier ursprünglich …"). This is open from the last round and is style only.

Verified

  • AC1 (every file listed): met. The PR body now names the following (read: gh pr view 1746):
    • App.firstServer.test.tsx;
    • the SessionsAndDataSettings rework;
    • the new tests;
    • the files outside the list.
  • AC2 (no contradicting comment): met in the delta. Checked (read): LanguageSettings.tsx:33-34, McpServerSettings.tsx:139-141, registerBuiltinExtensions.ts:1-10, SessionsAndDataSettings.tsx:7-16 and SettingsScreen.test.tsx:240-241.
  • AC3 (reworks keep behaviour, tests named): partly met.
    • The gating matches origin/develop: the category is empty while loading and after a load error.
    • Save, error and busy logic is unchanged (read: base and head compared).
    • The value hand-off is untested → Blocking 1.
  • counter-proof (all executed):
    • registerBuiltinExtensions.test.ts: red with the registration set back to ChatRetentionSettings, green with the fix.
    • Both SessionsAndDataSettings.test.tsx tests: red with if (!loaded) return null removed, and red against the round-2 versions of the two components. Green on HEAD.
    • initialDays ignored → everything green → Blocking 1.
  • edge cases:
    • load pending → empty (tested), ok
    • load error → empty, as on the base (tested), ok
    • stored non-null value → untested (Blocking 1)
  • callers checked:
    • ChatRetentionSettings (1 call site) → ok
    • SessionsAndDataSettings (registration plus tests) → ok
    • chat-retention id, label and icon → unchanged
  • tests run locally (all executed):
    • npx vitest run on 6 affected files → 47 passed
    • npx vitest run src/components → 1407 passed
    • npx tsc -b → clean
    • npm run lint → exit 0
  • UI: no e2e spec opens this category's retention value with a stored setting. The gating is covered by unit tests, and no Playwright spec was run for this delta.
  • data: not touched.
  • CI: all checks green on cb42c5e4, and the branch is up to date with develop.

Timing analysis

  • 3 test files analysed:
    • registerBuiltinExtensions.test.ts → no timing dependency found.
    • SessionsAndDataSettings.test.tsx → late setState from the unmocked store, and the error-case assertion may run before the rejection. Both possible → non-blocking.
    • SettingsScreen.test.tsx:240 → comment only.

Coherence

  • comments: 6 checked.
    • The round-2 findings in McpServerSettings.tsx, LanguageSettings.tsx and registerBuiltinExtensions.ts:1-5 are fixed.
    • SessionsAndDataSettings.tsx:28 ("Wie bisher") and registerBuiltinExtensions.ts:16-23 are non-blocking style.
  • fit: moving the retention load into SessionsAndDataSettings fits. The category owns the gating, and ChatRetentionSettings no longer keeps a parallel loaded state. The chat-retention id and key naming stays a follow-up.

Spec and boundary

  • visible behaviour changed: none (the loading and error gating is restored).
  • spec: not needed (comments and refactoring). No changelog fragment and no ADR needed.
  • boundary, CI changes, vendor: ok. No .github/ changes.

Security checks

  • The delta touches no security path. It is frontend settings only, with no new IPC and no change to what needs confirmation.
  • security review (subagent): not re-run, because FileBrowserPanel.tsx is unchanged since round 1. The earlier result stands: no findings.

UI review

  • Not re-run for this delta. The delta restores the pre-PR gating, and the loaded state is unchanged from round 2, where it was reviewed as ok.

Previous findings

  • PR description stale → fixed in cb42c5e (PR body updated).
  • registerBuiltinExtensions.ts registration without a test → fixed in cb42c5e (registerBuiltinExtensions.test.ts, counter-proof red/green). The SettingsScreen.test.tsx:240 comment is corrected.
  • Split changed loading/error behaviour → fixed in cb42c5e (SessionsAndDataSettings gates on the load, with tests). The new value hand-off is untested → Blocking 1.
  • Contradicting comments (McpServerSettings, LanguageSettings, registerBuiltinExtensions header) → fixed in cb42c5e.

Follow-ups

  • Rename the settings category id chat-retention and the key settings.categories.chatRetention to sessions-and-data / settings.categories.sessionsAndData. Update all locales, the tests and the comment at SettingsScreen.tsx:123. (No issue yet.)
  • ChatRetentionSettings: if loading the value fails, the category disappears without notice (pre-existing). Clean shape: render a role="alert" banner instead of nothing. (No issue yet.)
  • ChatRetentionSettings: save, toggle, error and busy paths have no tests, on the base or now. (No issue yet.)
  • Rename AddAiProviderDialog to AiProviderDialog after #1707 lands.
  • errorCodes.ts: generate the known-code list from Rust.
  • create_overlay_titlebar doc in crates/app-shell/src/commands/app_meta.rs → Rust pass, #1694.

)

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

Copy link
Copy Markdown
Contributor Author

Review round 3: blocking point fixed in 772a83e — new test SessionsAndDataSettings.test.tsx: passes a stored retention value to the retention section resolves 14 and asserts the switch is on and the field shows 14 (counter-proof: ignoring initialDays turns it red). Non-blocking: catch comment reworded, auto-reconnect store mocked; the load-error test already awaits the rejected call.

@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: approved
Review level: elevated (FileBrowserPanel.tsx is a security path. This delta does not touch it, and its earlier changes in this PR are comment-only.)

Follow-up round 4: delta cb42c5e4..772a83e6. The delta adds one test and one store mock in SessionsAndDataSettings.test.tsx, and rewords one comment in SessionsAndDataSettings.tsx. The round-3 blocking finding is fixed.

Blocking

None.

Non-blocking

  • The PR body's "Tests" bullet describes SessionsAndDataSettings.test.tsx as "(hidden until loaded, hidden on load error)". It does not mention the new case passes a stored retention value to the retention section. AC3 is still met because the body names the covering test file. Please add the case name anyway if the body is edited again.
  • SessionsAndDataSettings.test.tsx:56: getAllByRole("checkbox")[0] adds little. The field only renders when the switch is on. The assertion is still correct, because the retention switch is the only checkbox in the category.

Verified

  • Round-3 finding (stored value reaches the section through initialDays): fixed. See the new test passes a stored retention value to the retention section (read: SessionsAndDataSettings.test.tsx:54-60).
  • Counter-proof (executed by the functional review): the new test goes red for each of the three regressions below, then green again after restoring the code.
    • (a) useState(initialDays) changed to useState(null) in ChatRetentionSettings.tsx.
    • (b) initialDays={null} in SessionsAndDataSettings.tsx.
    • (c) The day field ignores days.
  • Assertion target: AutoReconnectSettings and ElevatedIdleSettings render only a <select>. So the spinbutton and the checkbox the test queries are the retention controls (read: grep for type="checkbox", type="number" and <select in the three sections).
  • Load-error test: I counter-proved it myself (executed). I put setLoaded(true) into the catch branch and ran npx vitest run src/components/SessionsAndDataSettings.test.tsx: 1 failed, 2 passed. The code was then restored. So the test does catch a load error being treated as loaded.
  • Edge cases:
    • stored value null → ok (tested)
    • stored value 14 → ok (tested)
    • load rejected → ok (tested)
  • Callers checked: ChatRetentionSettings / initialDays are unchanged in this delta → ok.
  • Tests run locally (executed):
    • npx vitest run on SessionsAndDataSettings.test.tsx and SettingsScreen.test.tsx → 20 passed.
    • The new file was run 5 more times → 3/3 passed each time.
    • npx tsc -b → clean.
    • npm run lint → exit 0.
  • UI: no UI change in this delta (test and comment only).
  • Data: not touched.
  • CI: all checks green on 772a83e6. The branch is up to date with develop and mergeable.

Timing analysis

  • 1 test file analysed (SessionsAndDataSettings.test.tsx):
    • New test → no timing dependency found. findByRole waits for the render after the load.
    • Late setState from the auto-reconnect store → fixed, because the store is now mocked.
    • "Load-error assertion runs before the rejection settles" (reported as likely) → dismissed. The mutation run above shows the assertion does see the settled rejection: the test is red when the catch branch sets loaded.

Coherence

  • Comments: 2 checked. The new catch comment ("Without a loaded retention value the category stays hidden.") matches the code: loaded stays false, so the component returns null. The component's doc comment still matches as well.
  • Fit: the change fits (comment wording only).

Spec and boundary

  • Visible behaviour changed: none.
  • Spec: not needed (tests and a comment). No changelog fragment and no ADR needed.
  • Boundary, CI changes, vendor: ok. No .github/ changes.

Security checks

  • The delta touches no security path and no IPC, confirmation, filter, redaction or credential code.
  • Security review (subagent): not re-run, because FileBrowserPanel.tsx is unchanged since round 1. The earlier result stands: no findings.

UI review

  • Not a UI change in this delta.

Previous findings

  • Stored retention value has no test → fixed in 772a83e (red/green counter-proof executed).
  • Non-blocking "Wie bisher" catch comment → fixed in 772a83e.
  • Non-blocking: mock the auto-reconnect store → fixed in 772a83e.
  • Non-blocking: flush the rejection in the load-error test → not changed. It is not needed: the mutation run shows the test already catches the bug.

Follow-ups

Carried over from the earlier rounds. None of them has an issue yet; the follow-up-pending label is already set.

  • Rename the settings category id chat-retention and the key settings.categories.chatRetention to sessions-and-data / settings.categories.sessionsAndData. Update all locales, the tests and the comment at SettingsScreen.tsx:123.
  • Retention section: if loading the value fails, the whole category disappears without notice (pre-existing behaviour). Clean shape: render a role="alert" banner instead of nothing.
  • ChatRetentionSettings: the save, toggle, error and busy paths have no tests, on the base or now.
  • extensions/registerBuiltinExtensions.ts:16-23 still narrates history ("war hier ursprünglich …").
  • Rename AddAiProviderDialog to AiProviderDialog after #1707 lands.
  • errorCodes.ts: generate the known-code list from Rust.
  • create_overlay_titlebar doc in crates/app-shell/src/commands/app_meta.rs → Rust pass, #1694.

@smart-ssh-coordinator
smart-ssh-coordinator Bot merged commit c97cbc0 into develop Dec 5, 2026
9 checks passed
@smart-ssh-coordinator
smart-ssh-coordinator Bot deleted the issue-1680-comments-and-coherence-frontend-app branch December 5, 2026 14:32
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.

Comments and coherence: frontend (App … FilterRulesView)

0 participants