Repository navigation
feat(frontend): redesign chat transcript with flat cards - #1404
smart-ssh-coder[bot] wants to merge 6 commits into
Conversation
…#1371) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…1371) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review
Verdict: changes requested
Review level: normal
Blocking
apps/smart-ssh-community/frontend/src/components/chat/ActionCard.tsx:296(ConfirmActionForm) andchat/RuleStaging.tsx: the confirmation card body is not restyled. The issue says that if #1357 is already merged, its card (rows, scope chips, "Save rules (N)", Execute/Deny) is restyled toDeskChat.png/MobChat.png. #1357 was closed before this PR was opened, so that is the branch that applies. The PR's assumption "Confirmation form body kept as-is inside the flat frame; only frame/header restyled" applies the fallback for the case where #1357 is still open. That narrows a requirement line. Please restyle the body as the issue requires.- AC 1 (chat column matches
Main.pngdark /MainLight.pnglight): the PR body says "partly met … no pixel comparison done", and the PR has no screenshot or other evidence. This can be checked in the container (Playwright against the fake backend renders this chat in both themes), so it cannot be deferred as a manual check. Please attach dark and light screenshots of the chat column (user question, assistant answer, auto-executed command) next to the reference and fix any deviations. apps/smart-ssh-community/frontend/src/components/ChatPanelAutoExecRules.test.tsx"shows the exit code in the header once the result exists" — this test has no effect. I revertedActionCard.tsx,AutoExecRulesLine.tsxandchatItem.tstoorigin/developand the test still passes. In the old layout,code.parentElement.parentElementis the whole card, which also contains the "Automatisch ausgeführt" line, and the old card also shows exactly one "exit code" text. The PR body says this test fails against the old layout, which is not correct. Please assert that the exit code sits in the header row: for example, query the header element directly, check that it is the same element as the rule line's container, and check that no exit-code line follows the output.- AC 3 / AC 5 / AC 9: the issue lists ten unit tests and three e2e specs to update. Only
ChatPanelAutoExecRules.test.tsxand one selector incommand-confirmation.spec.tschanged. No test asserts that the header of a confirmed, denied, blocked or expired card shows the status icon (check/x/bolt) and the status colour. TheChatPanel.test.tsxbadge tests the PR cites check the text only, and that text is unchanged. No test covers "no rounded corners / blurred shadows" for the transcript item types either. Please add assertions for the AC 3 icon and tone per state, and update the listed tests and the transcript parts ofchat-panel-review.spec.tswhere they should cover the new layout.
Non-blocking
- The
exit code: Nheader text (ActionCard.tsx, header span) is a hard-coded English string. The old result line had the same string, so this is not new, but it is now more prominent in the header. It could get an i18n key. - The
$prompt is generated withbefore:content-['$_'], so some screen readers may announce "dollar". Consideraria-hiddenmarkup instead of a pseudo-element. - The spinner in
InjectionCheckStatuslostrounded-fulland is now a spinning square. This is consistent with "square", but please confirm it is intended.
Verified
- files read: 14/14 logic files (full diff of every changed
.ts/.tsx) (read:git diff origin/develop...HEAD) - counter-proof: "shows the exit code in the header once the result exists" stays green without the fix → finding above. "shows the header without rules…" fails without the fix and passes with it. (executed: checked out the three files from origin/develop,
npx vitest run src/components/ChatPanelAutoExecRules.test.tsx, restored them, reran: 6 passed;git statusclean) - edge cases: no rules (restored chat) → header without rules (read + test); cancelled result → no exit code in header, none at the bottom (read); fileRead/fileWrite/noteUpdate result → no exit code (read); AutoExec card settled/expired → falls back to the label plus a red
xbadge (read) - callers checked:
decisionCardToneremoved (0 remaining references,rg) → ok;decisionBadge(ActionCard only) → ok;ActionResultViewnew optional propexitInHeaderdefaults to false, other callers unchanged → ok;AutoExecRulesLine(ActionCard only) → ok - tests run locally:
npx vitest run src/components/ChatPanel src/components/chat src/components/QuestionCard.test.tsx src/components/WebActivityCard.test.tsx→ 25 files, 212 passed (executed) - UI:
chat-question-card,chat-scroll-follow,chat-panel-review,accessibilityspecs → 130 passed; changedcommand-confirmation.spec.tswith--repeat-each=5→ 80 passed (executed locally) - CI: all checks green (
gh pr checks 1404) - remaining
rounded/shadowin transcript components: onlyComposer.tsx, which is not a transcript item (executed:rg) - data: not touched
Timing analysis
- 2 test files analysed: no timing dependency found
Spec
- visible behaviour changed: auto-exec card header (bolt, "Ran automatically", rule chips, scope, exit code right-aligned, exit code no longer under the output), status icon + colour instead of filled badges, flat item styling
- spec searched:
rg -il 'automatisch ausgeführt|exit-code|Aktionskarte' docs/specs/→ 0011 §7, 0029 §2 - verdict: spec change is present and matches the code (0011 §7 merged header, deleted-rule and no-rules cases; 0029 §2 decision icons, origin/risk badges stay on the right). Changelog fragment is present, in English.
Security checks
- Presentation-only change. The auto-exec/confirm/deny decision logic is untouched (
needsConfirmationandConfirmActionFormwiring unchanged). The rule link still opens only existing rules. No new IPC. The threat-model note "no change – presentation only" holds.
Follow-ups
- i18n key for the "exit code" header text (non-blocking above).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review
Verdict: changes requested
Review level: normal
This is the follow-up round. It covers the delta a30d3ea0..678c1a4f (ActionCard.tsx, RuleStaging.tsx, ChatPanelAutoExecRules.test.tsx) and the screenshots linked in the PR body.
Blocking
-
apps/smart-ssh-community/frontend/src/components/chat/RuleStaging.tsx:281-399andchat/ActionCard.tsx:343-375: the confirmation card body still does not matchDeskChat.png/MobChat.png. #1357 is merged, so the requirement is "restyle its card (rows, scope chips, 'Save rules (N)', Execute/Deny) to the design". The new commit changes only the heading typography and adds 1 px rules. These differences remain:- The scope is still a row of native radio buttons. The design shows a segmented chip control (THIS SERVER | GLOBAL | TAG) with a
text-label"SCOPE" caption. - Deny and Execute have no icons and sit at the left. The design shows
xDENY andplayEXECUTE, right-aligned in the footer, with "SAVE RULES (N)" (shield icon) and the "no guarantee" footnote at the left of the same footer row. - Covered rows have no
checkicon and no right-aligned "covered by rule …" text. - The pending header shows a
check("Confirmation needed") instead of the design's shield. A tick next to a pending decision also reads like "approved".
Keep the behaviour and the texts. This is about layout, icons from the set, and control styling. If you think one of these elements needs a behaviour change (for example the checkbox rows of the rule choice), say so under Assumptions instead of leaving it out silently.
- The scope is still a row of native radio buttons. The design shows a segmented chip control (THIS SERVER | GLOBAL | TAG) with a
-
AC 1 evidence is incomplete. The AC scenario is "a chat with a user question, an assistant answer and an automatically executed command". Both screenshots (
issue-1371-screenshots,shots/chat-{dark,light}.png) show no user message at all. The auto-executed card has no output and no exit code, so the outlined user block (surface-raised, 1 pxborder-strong, 86 %) and the right-aligned exit code (exit 0inMain.png) are not shown anywhere. The PR body still says "partly met — no pixel comparison done". Please capture the scenario from the AC in both themes (user question, answer, auto-executed command with output and exit code), compare it with the chat column ofMain.png/MainLight.png, and fix or name any deviations. For example,Main.pnghas no "Assessment based on known patterns" line inside the auto-executed card body. -
AC 5 / AC 9, tests. AC 5 says "every transcript item type renders without rounded corners or blurred shadows". The new test "renders the executed card without rounded corners or shadows" covers only the executed card. It also passes against
origin/develop(I reverted the three card files and it stayed green), so it does not protect any change made here. The other listed tests (ChatPanel.test.tsx,ChatPanelLiveOutput.test.tsx,ChatPanelInjectionCheck.test.tsx,ChatPanelQuestion.test.tsx,ChatPanelWaitingInput.test.tsx,chat/CodeBlock.test.tsx,ChatItemViewMemo.test.tsx,QuestionCard.test.tsx,WebActivityCard.test.tsx, e2echat-panel-review.spec.tstranscript parts) are still unchanged in this PR. Please add coverage for the new layout across the item types. One parametrised test over theChatItemViewitem kinds,QuestionCard,WebActivityCard,DocumentCard,CodeBlockandErrorCard(norounded*/shadow*, icon present) would be enough, together with an assertion for the user-message block classes. Also update the transcript part ofchat-panel-review.spec.tswhere it should cover the new layout.
Non-blocking
ChatPanelAutoExecRules.test.tsx"renders the executed card without rounded corners or shadows" scans the classes synchronously.AutoExecRulesLineloads the rules asynchronously, so the scan runs before the rule chip has rendered. Addawait screen.findByRole("button", { name: "uptime" })before the scan (timing analysis below).- The screenshots are on a separate branch (
issue-1371-screenshots). If that branch is deleted after the merge, the images in the PR body break. - From the previous round, still open: the
exit code: Nheader text is a hard-coded English string, and$comes from a CSS pseudo-element.
Verified
- files read: 3/3 logic files of the delta (read:
git diff a30d3ea0 HEAD). The full PR was read in the previous round. - counter-proof: I reverted
chat/ActionCard.tsx,AutoExecRulesLine.tsxandchat/chatItem.tstoorigin/develop. "shows the exit code in the header once the result exists" and the three "shows the … status in the header with colour and icon" cases are red without the change and green with it. "renders the executed card without rounded corners or shadows" stays green without the change (see above).git statuswas clean afterwards. (executed:npx vitest run src/components/ChatPanelAutoExecRules.test.tsx→ 5 failed / 5 passed reverted, 10 passed restored) - screenshots: compared with
Main.png,MainLight.pngandDeskChat.png(read: the images). The deviations are listed above. - edge cases: pending Confirm card shows the
checkicon (finding above); a settled AutoExec card falls back to the label plusx(read); a denied-by-user card shows thex"rejected" label in danger tone (read + test) - callers checked:
SegmentRules/SegmentRow(RuleStaging only, used byConfirmActionForm) → classes only, no behaviour change (read) - tests run locally:
npx vitest run src/components/ChatPanelAutoExecRules.test.tsx src/components/ChatPanel.test.tsx src/components/chat src/components/QuestionCard.test.tsx src/components/WebActivityCard.test.tsx→ 25 files, 216 passed (executed) - UI:
command-confirmation,chat-panel-review,chat-question-card,chat-scroll-follow,accessibilityspecs → 146 passed (executed locally). No e2e spec changed in the delta, so there was no--repeat-eachrun this round. - CI: all checks green (
gh pr checks 1404) - remaining
rounded/shadowin transcript components: onlyComposer.tsx, which is not a transcript item (executed:rg) - data: not touched
Timing analysis
- 1 test file analysed (
ChatPanelAutoExecRules.test.tsx). The class-scan test runs before the async rule load finishes. That ispossible, so non-blocking (see above). No other timing dependency was found.
Spec
- visible behaviour changed in the delta: typography and 1 px rules in the confirmation body only
- spec searched:
rg -il 'automatisch ausgeführt|Bestätigungskarte|Regel speichern|exit-code' docs/specs/→ 0029 §2 and 0011 §7 cover the header - verdict: spec 0011 §7 / 0029 §2 changes are present and match the code (0029 §2: "Haken = Bestätigung nötig"). If the pending header changes to a shield, as the design shows, update 0029 §2 in the same commit.
Security checks
- Presentation-only delta.
handleApprove/deny wiring, the staging flow andneedsConfirmationare unchanged. The threat-model note "no change – presentation only" holds.
Previous findings
- Confirmation card body not restyled → still open. 678c1a4 changes only typography and rules (see Blocking).
- AC 1 screenshots missing → partly fixed. Screenshots were added, but they do not show the AC scenario (no user question, no exit code).
- Exit-code header test without effect → fixed in 678c1a4. It is red without the change.
- AC 3 icon/tone tests → fixed in 678c1a4 (confirmed/denied/blocked). AC 5 / AC 9 test updates → still open.
Follow-ups
- i18n key for the "exit code" header text (from the previous round, label already set).
…ipt tests (#1371) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review round 2: (1) confirmation card body restyled as in DeskChat/MobChat (segmented scope chips, icons on Deny/Execute, right-aligned footer with Save rules + shield, covered rows with check and right-aligned rule text, shield in pending header) — fixed in 7461472. (2) AC 1 screenshots re-captured with user question and executed card with output and exit code, dark and light — see PR body. (3) Flat coverage across all transcript item types and the user block ( |
…in Tab order (#1371) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review
Verdict: changes requested
Review level: normal
Follow-up round 3. It covers the delta 678c1a4f..5968c4c3 (ActionCard.tsx, RuleStaging.tsx, chatItem.ts, ChatPanel.tsx, the new ChatTranscriptFlat.test.tsx, chat-panel-review.spec.ts, command-confirmation.spec.ts) and the re-captured screenshots. All three blocking points from round 2 are now resolved. One new, small blocking point comes from this delta: the specs no longer match the code.
Blocking
docs/specs/0029-risk-badge-positioning.md:29-30contradicts the code. The spec still says "Symbol und Beschriftung in der Statusfarbe (Blitz = automatisch ausgeführt, Haken = Bestätigung nötig, Kreuz = blockiert/abgelehnt)". Since 5968c4c,chat/chatItem.ts:259(decisionBadge) renders a shield for a pending confirmation, so a user looking at a pending card sees a shield, not a tick. Please change the spec to "Schild = Bestätigung nötig". The round-2 review asked for this in the same commit as the icon change.docs/specs/0011-rule-quick-accept.md:101-103(§4) says each already allowed sub-command shows "eine kurze Zeile … mit grünem Haken, die abdeckende Regel als Tooltip". Sincechat/RuleStaging.tsx:159-163, the covering rule is also visible text at the right of the row ("covered by rule …"). §4 also does not say that "Regeln speichern (N)" now sits in the footer row next to the shield and "Ablehnen"/"Ausführen", rather than under the rule list. Please update §4 so it describes what the user sees. Only the affected sentences need to change.
Non-blocking
ChatTranscriptFlat.test.tsxchecks that no item has rounded corners or shadows. It does not assert the user-block classes (surface-raised,border-strong, 86 % / 85 %) or that an icon is present, as suggested in round 2. AC 1 is now backed by the screenshots, so this is no longer a blocker.- The confirmation card still differs from
DeskChat.pngin two minor ways: there is notext-label"SCOPE" caption before the chips, and the "Assessment based on known patterns — no guarantee" note stays under the header instead of in the footer. Spec 0029 §2 places the note under the header row, so leaving it there is defensible. ChatTranscriptFlat.test.tsx:103only matchesrounded/shadowafter whitespace or at the start. A variant-prefixed class such asnarrow:rounded-lgwould not be caught.- The PR body is stale in places. It still says "Chat column matches Main/MainLight: partly met — no pixel comparison done" and "the e2e specs pass unchanged".
- Still open from earlier rounds: the "exit code: N" header string is hard-coded English, and the screenshots live on the
issue-1371-screenshotsbranch.
Verified
- files read: 4/4 logic files of the delta (read:
git diff 678c1a4f..HEAD), plus the fullConfirmActionFormandSegmentRules(read:chat/ActionCard.tsx:300-388,chat/RuleStaging.tsx:100-215) - counter-proof: I reverted every non-test component file of the PR to
origin/develop. InChatTranscriptFlat.test.tsx, 7 cases went red (assistant, document, question, historyCommandResult, historyRejected, historyActionResult, webActivity) and 16 stayed green, because those items were already square on develop. After restoring the files, all were green andgit statuswas clean. (executed:npx vitest run src/components/ChatTranscriptFlat.test.tsx) - screenshots:
chat-exec-dark.pngnow shows the AC scenario: the user question as an outlined block, the answer without a bubble, and the auto-executed card with the rule chip, scope, output and the exit code in the header. The "assessment" line is gone from the executed card. It matches the chat column ofMain.pngapart from "exit code: 3" vs. "exit 0", which is listed as an assumption. The confirmation card shows the shield header and Deny/Execute right-aligned with icons. (read: images) - edge cases: explanation load failed → no Save button, because
canSaveRulesneedsexplanation(read); save error → alert still under the rule list (read); covered row without rule data → "coveredUnknown" text (read); a pending Confirm card now shows a shield, so the tick no longer reads as "approved" (read) - callers checked:
decisionBadge(1 call site,ActionCard.tsx:51) → ok;SegmentRules/staging.save(onlyConfirmActionForm) → ok, behaviour unchanged - tests run locally:
npx vitest runon all unit tests listed in AC 9 plussrc/components/chatandChatTranscriptFlat.test.tsx→ 26 files, 239 passed (executed) - UI:
chat-panel-review.spec.tsandcommand-confirmation.spec.tswith--repeat-each=5→ 290 passed;accessibility.spec.ts,chat-question-card.spec.ts,chat-scroll-follow.spec.ts→ 96 passed (executed locally, all projects) - CI: all checks green (executed:
gh pr checks 1404) - data: not touched
Timing analysis
- 3 test files analysed. Three findings, all
possible, so non-blocking:chat-panel-review.spec.ts:137-149: the scan starts right after the transcript becomes visible. Waiting for the last item of each kind (or polling withexpect.poll) would make it impossible for the scan to pass with an item still missing.ChatTranscriptFlat.test.tsx:89-109: synchronous scan afterrender. No item that loads async markup was found.command-confirmation.spec.ts:63-67: Tab order is deterministic. No timing dependency.
Spec
- visible behaviour changed in the delta: pending-confirmation icon (tick → shield); covered rows show the covering rule as visible text; Save rules (N) moved into the footer with a shield icon; Deny/Execute have icons and are right-aligned (Deny comes first); scope radios became segmented chips
- spec searched:
rg -il 'Bestätigung nötig|Regeln speichern|abgedeckt durch Regel|Geltungsbereich' docs/specs/andrg -n 'Haken|Tooltip|Schild' docs/specs/0011… 0029…→ 0029 §2 and 0011 §4 cover it - verdict: the specs contradict the code (blocking, see above). Proposed fix: update 0029 §2 and update 0011 §4.
Security checks
- Presentation-only delta. The
handleApprove/deny handlers,editThenApprove, the staging/save flow and the "Execute does not save staged rules" rule are unchanged; only their position and icons changed. The hidden radio inputs still drivesetScopeKind. The threat-model note "no change – presentation only" holds.
Previous findings
- Confirmation card body not restyled → fixed in 7461472/5968c4c3: segmented scope chips, icons on Deny/Execute, right-aligned footer with Save rules (N) and the shield, covered rows with a check and right-aligned rule text, shield in the pending header. Two minor differences remain (non-blocking, see above).
- AC 1 screenshots do not show the scenario → fixed. The re-captured dark and light screenshots show it.
- AC 5 / AC 9 coverage across item types → fixed in 7461472. There is a parametrised vitest over 23 item kinds (it fails against develop) and an e2e computed-style scan in
chat-panel-review.spec.ts.
Follow-ups
- i18n key for the "exit code" header text (from round 1; the label is already set)
- Shared
Button/tooltip primitives still rounded (as listed in the PR)
#1371) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review round 3: both points fixed in 5f1c638 (Spec 0029 §2 now says 'Schild'; Spec 0011 §4 mentions the visible covering-rule text and the footer placement of 'Regeln speichern (N)'). |
There was a problem hiding this comment.
Review
Verdict: approved
Review level: normal
Follow-up round 4: delta 5968c4c3..5f1c6381 (one docs commit, two spec files).
Blocking
None.
Non-blocking
- #1405 also edits
e2e/tests/chat-panel-review.spec.ts; whichever PR lands second will need a rebase of that file.
Verified
- delta read in full:
docs/specs/0011-rule-quick-accept.md,docs/specs/0029-risk-badge-positioning.md(read:git diff 5968c4c3..HEAD). files read: 0/0 logic files (no code in the delta) - spec text against code: covered rows show the rule as visible text and as
title(read:chat/RuleStaging.tsx:147-163); "Save rules (N)" is in the footer row with Deny/Execute (read:chat/ActionCard.tsx:346-387); pending header usesshield(read:chat/chatItem.ts:259) → matches - counter-proof: not applicable, the delta changes only specs (done in round 3 for the tests)
- edge cases: covered row without rule data →
coveredUnknowntext in both tooltip and row, matching the spec wording → ok - callers checked: not applicable (no code change)
- tests run locally:
npx vitest runon the 9 listed component tests plusChatItemViewMemo, the flat-transcript and rule-staging tests → 11 files, 110 passed (executed) - UI:
chat-question-card.spec.ts,chat-scroll-follow.spec.ts,chat-panel-review.spec.ts→ 58 passed across all projects (executed locally, headless) - doc checks:
node scripts/check-spec-index.mjs,node scripts/check-doc-paths.mjs→ passed (executed) - CI: all checks green on
5f1c6381(executed:gh pr checks 1404) - data: not touched
Timing analysis
- no test files changed since the last round (the round-3 analysis still holds: three
possiblefindings, non-blocking)
Spec
- visible behaviour changed in the delta: none (spec text only)
- spec searched (
rg -il 'Bestätigung|Regeln speichern|abgedeckt' docs/specs/): 0011 §4, §7 and 0029 §2 cover it - verdict: spec change present and matches the code. 0029 §2 now says "Schild"; 0011 §4 describes the visible rule text and the footer button. Only the affected sentences changed.
Security checks
- no code in the delta. The confirmation path is unchanged: Deny/Execute still call
onRespond, and staged rules are still not saved on Execute (Issue #1357 comment kept inActionCard.tsx)
Previous findings (follow-up round only)
- 0029 §2 "Haken" → "Schild" → fixed in 5f1c638
- 0011 §4 tooltip-only / footer placement → fixed in 5f1c638
Follow-ups
- i18n key for the "exit code" header text (from round 1)
- Shared
Button/tooltip primitives still rounded (as listed in the PR)
Closes #1371
Summary
Flat, angular chat transcript: user messages as outlined
surface-raisedblocks (86 % / 85 % narrow), assistant text without a bubble, executed-action cards with a merged header ("Ran automatically · rule<pattern>· " with bordered pattern chips, exit code right-aligned), status icon + colour in the header for confirm/deny/blocked/expired, and square 1 px-rule styling for the other transcript items (document, error, question, web activity, live output, injection check, history items, code block).Acceptance Criteria
ChatPanelAutoExecRules.test.tsx("lists the rule of each segment…", "renders a rule that no longer exists as plain text", "shows the exit code in the header once the result exists").decisionBadgereturns tone +check/x/bolt), covered byChatPanel.test.tsxbadge tests and "shows no line for confirmed or denied commands".ChatPanel*.test.tsxpass.ChatTranscriptFlat.test.tsx(every transcript item type incl. user block, waiting banners made square) andchat-panel-review.spec.ts"transcript items have square corners and no shadows" (computed styles, messages + confirmation). The shared Button/Tooltip primitives keep their radius (see Follow-ups).aria-hidden.ChatPanelAutoExecRules.test.tsx("shows the %s status in the header with colour and icon" for confirmed/denied/blocked) and "renders the executed card without rounded corners or shadows".ChatPanelAutoExecRules.test.tsx); the e2e specs pass unchanged.Tests
Full vitest suite and chat/narrow e2e specs pass locally. Counter-proof: adding
rounded-lgto the user block turnsChatTranscriptFlat.test.tsxred for both user items. the new "exit code in the header" test fails against the old layout (exit code at the bottom, no header span).Assumptions
Spec
updated 0011, updated 0029
Threat model: no change – presentation only.
Screenshots (user question, assistant text, auto-executed card with output and exit code, confirmation card)
Manual test steps
Follow-ups
Buttonand tooltip primitives still userounded/shadow-offset-sm; restyle in the shared-components issue.🤖 Generated with Claude Code