Skip to content

feat(doop): comment resolution picker, reason chips and review summary (CHE-9396) [squash] - #167

Draft
congvc-bot-x99[bot] wants to merge 3 commits into
cheese/mainfrom
agent/x99-claude-sonnet-200k/che-9396-5c45c8468581
Draft

congvc-bot-x99[bot] wants to merge 3 commits into
cheese/mainfrom
agent/x99-claude-sonnet-200k/che-9396-5c45c8468581

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Closes CHE-9396 (U4, step 8 of CHE-9308). Design: design/lifecycle-ui/approved/A4-comment-resolution.html @ 572cc77.

What changed

  1. Resolve as menu on an open thread: Addressed, Won't fix, Moved to Multica. Each opens a one-line dialog; Resolve stays off until the line is filled (Won't fix needs a note). Posts {reason, ref|note}.
  2. Reason chip on a resolved thread, with its ref (Moved links the Multica issue) or note.
  3. Open · waits on Multica: a thread whose newest reply key starts q: stays open, shows the issue link, and offers no Resolve.
  4. Since last review: counts of threads resolved after the anchor, plus threads still open and waiting. "Mark reviewed" sets the anchor (localStorage doop:reviewed:<user>:<canvas>).
  5. Four states through PanelState: loading, empty, offline (reading works, Resolve paused), inline error with Try again.
  6. api.resolveComment takes an optional body. en and pt-BR strings added.

Not rendered on purpose: the A4 "Suggested: Addressed" hint (waits on CHE-9351). A test guards it.

Test-first

Command: npx vitest run tests/commentResolution.test.tsx (run here with a local config that skips the PGlite/Chromium globalSetup; the file is a pure happy-dom unit test).

Red (before the code, 11 failed | 1 passed; the one pass is the "no Suggested" guard):

⎯⎯⎯⎯⎯⎯ Failed Tests 11 ⎯⎯⎯⎯⎯⎯⎯
 FAIL  |parallel| tests/commentResolution.test.tsx > counts the summary from the fixture since the stored anchor, and Mark reviewed moves the anchor
 FAIL  |parallel| tests/commentResolution.test.tsx > draws the reason chip and its detail on a resolved thread
 FAIL  |parallel| tests/commentResolution.test.tsx > keeps a q: thread open with the Multica link and offers no Resolve
 FAIL  |parallel| tests/commentResolution.test.tsx > keeps the anchor per user and canvas
 FAIL  |parallel| tests/commentResolution.test.tsx > pauses Resolve and says so while offline, with threads still readable
 FAIL  |parallel| tests/commentResolution.test.tsx > posts the addressed reason with its body
 FAIL  |parallel| tests/commentResolution.test.tsx > posts the moved reason with its body
 FAIL  |parallel| tests/commentResolution.test.tsx > posts the wont_fix reason with its body
 FAIL  |parallel| tests/commentResolution.test.tsx > says so when nothing is commented yet, and while the canvas is loading
 FAIL  |parallel| tests/commentResolution.test.tsx > shows the error with Try again when a resolve fails, and the thread stays open
 FAIL  |parallel| tests/commentResolution.test.tsx > won't fix needs a note: the dialog's Resolve stays off until a one-line reason is typed
 Test Files  1 failed (1)
      Tests  11 failed | 1 passed (12)

Green (after):

 RUN  v5.0.3 /mnt/ssd2/multica_workspaces/cheese-work-a2f69b0ef843/che-9396-5c45c8468581/workdir/doop
 ✓ |parallel| tests/commentResolution.test.tsx > posts the addressed reason with its body 200ms
 ✓ |parallel| tests/commentResolution.test.tsx > posts the moved reason with its body 67ms
 ✓ |parallel| tests/commentResolution.test.tsx > posts the wont_fix reason with its body 81ms
 ✓ |parallel| tests/commentResolution.test.tsx > won't fix needs a note: the dialog's Resolve stays off until a one-line reason is typed 55ms
 ✓ |parallel| tests/commentResolution.test.tsx > keeps a q: thread open with the Multica link and offers no Resolve 9ms
 ✓ |parallel| tests/commentResolution.test.tsx > draws the reason chip and its detail on a resolved thread 12ms
 ✓ |parallel| tests/commentResolution.test.tsx > counts the summary from the fixture since the stored anchor, and Mark reviewed moves the anchor 12ms
 ✓ |parallel| tests/commentResolution.test.tsx > keeps the anchor per user and canvas 3ms
stderr | tests/commentResolution.test.tsx > says so when nothing is commented yet, and while the canvas is loading
Warning: An update to CommentsPanel inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
  /* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
    at CommentsPanel (/mnt/ssd2/multica_workspaces/cheese-work-a2f69b0ef843/che-9396-5c45c8468581/workdir/doop/src/components/CommentsPanel.tsx:61:53)
 ✓ |parallel| tests/commentResolution.test.tsx > renders no "Suggested" hint, even for an e: reply that names a version 10ms
 ✓ |parallel| tests/commentResolution.test.tsx > says so when nothing is commented yet, and while the canvas is loading 9ms
 ✓ |parallel| tests/commentResolution.test.tsx > pauses Resolve and says so while offline, with threads still readable 7ms
 ✓ |parallel| tests/commentResolution.test.tsx > shows the error with Try again when a resolve fails, and the thread stays open 59ms
 Test Files  1 passed (1)
      Tests  12 passed (12)
   Start at  02:52:44
   Duration  82.83s (environment 88%, transform 6%, import 3%, tests 3%)

Also green: tests/commentsPanel.test.tsx, tests/panelState.test.tsx, tests/commentResolveReason.test.ts (24 tests). bun run typecheck, bun run lint, prettier: clean.

UI review pack (CHE-1485 Layer A)

Admit sheet: docs/ux/CHE-9396.yml.

Page Before 1440 After 1440 Before 390 After 390
Comments tab NOT-CAPTURED NOT-CAPTURED NOT-CAPTURED NOT-CAPTURED

NOT-CAPTURED reason: this run has no doop MCP tool, so it cannot place captures on a reference frame on page che-5478; the Comments tab sits behind sign-in and has no story to render headlessly. Pack is incomplete, PR stays draft.

Keep / Change / Remove check (written out from the sheet):

  • Keep: thread row (author, time, text, frame, "Resolved by", reply field), Open/Resolved pills, row click flies to the pin.
  • Change: Resolve picker, dialog, reason chip, waits-on-Multica, summary block, PanelState states.
  • Remove: the one-click Resolve with no reason.

Visual diff: NOT-RUN (CHE-1485 Layer B pending)

Residual risk

  • The Multica link needs VITE_MULTICA_WEB_URL at build time; without it the issue key is plain text.
  • The anchor is per browser, not synced.
  • Waiting = the newest keyed reply is q:; a later e: reply clears it.
  • No deploy. Needs a different-lab code review and a UX reviewer verdict.

Round 2 (review CHANGES on fd4f506)

Fixes: (1) a q:<event id> reply names its issue in "Moved to Multica: "; the matching a:<event id> reply clears the wait; the link is <VITE_MULTICA_WEB_URL>/issues/<KEY> (workspace URL, same shape as the server's MULTICA_WEB_URL; documented in .env.example); (2) the summary reads every page of the canvas, since Mark reviewed moves a canvas-wide anchor.

Red (new tests against the round-1 code):

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 5 ⎯⎯⎯⎯⎯⎯⎯
 FAIL  |parallel| tests/commentResolution.test.tsx > keeps a q: thread open with a working Multica link and offers no Resolve
 FAIL  |parallel| tests/commentResolution.test.tsx > shows the key as plain text when the build has no Multica URL
 FAIL  |parallel| tests/commentResolution.test.tsx > stays open on a q: reply that names no issue, without a link
 FAIL  |parallel| tests/commentResolution.test.tsx > stops waiting when the matching a: answer arrives, and not for another event id
 FAIL  |parallel| tests/commentResolution.test.tsx > summarizes the whole canvas, so Mark reviewed on one page never hides another page's resolutions
      Tests  5 failed | 11 passed (16)

Green: 40 passed in 4 files (tests/commentResolution.test.tsx 16, plus commentsPanel, panelState, commentResolveReason). typecheck, lint, prettier clean.

UI pack is unchanged: four cells NOT-CAPTURED, PR stays draft.

Round 3 (round-2 P1: the configured Multica URL never reached the client)

Fix: GET /api/me (the config the SPA already loads after sign-in) now carries multicaWebUrl from the server's MULTICA_WEB_URL (http(s) only, no trailing slash; omitted when unset). CommentsPanel reads it through useMe and links the key. VITE_MULTICA_WEB_URL is removed, so no Dockerfile or image change is needed.

Tests: tests/meMulticaUrl.test.ts boots the real server with and without MULTICA_WEB_URL and asserts /api/me; tests/commentResolution.test.tsx asserts the <a href> from the Me value.

Red (before the fix): tests/meMulticaUrl.test.ts failed to load (Cannot find module '../shared/multica.ts') and keeps a q: thread open with a working Multica link failed (expected undefined to be 'CHE-5301').

Green: 5 files, 43 tests passed (commentResolution, meMulticaUrl, commentsPanel, panelState, commentResolveReason). bun run typecheck, bun run lint and prettier --check are clean.

UI review pack (CHE-1485 Layer A)

Captured with headless Chrome 158 on X99: real server (PGlite, production build) with the client built from cheese/main (before) and from this head (after). Comments tab at 1440 and 390; seed has open threads, a q: thread, and one resolved thread per reason. The six PNGs and the Keep / Change / Remove text are in CHE-10383 (comment 01a2199b-aa42-792b-86c1-e3743f852c49).

Cell Before After
Comments tab, 1440 captured captured
Comments tab, 390 captured captured
  • Placement on the che-5478 reference frame and the different-lab UX verdict: pending (CHE-10383).
  • Visual diff: NOT-RUN (CHE-1485 Layer B pending)

This branch has not been deployed

No deployments
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.

0 participants