Skip to content

Workspace UI flow: P0 safety fixes and a smoother case flow - #26

Merged
gaffercode merged 12 commits into
mainfrom
claude/project-thread-512sm7
Nov 26, 2026
Merged

gaffercode merged 12 commits into
mainfrom
claude/project-thread-512sm7

Conversation

@gaffercode

@gaffercode gaffercode commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Requested by Gafferness · project thread

Status: REVIEW. Do not merge without Gaffer's approval.

Summary

Part 1: P0 safety fixes

These stop wrong or mixed data from entering a clinical document.

  1. Empty first workspace. A new or unreadable workspace starts with no demo patient or encounter. A saved demo patient's placeholder note is never sent to AADI.
  2. Mode instruction stays out of the case. A chip's opening sentence is removed at submit, so it never becomes Keluhan Utama or the AADI chief complaint.
  3. Case-boundary guard. If the typed age or sex differs from the open encounter, nothing is sent. The composer offers "Kasus baru" or "Tetap di encounter ini". A held case stays tied to its own encounter and keeps its text. The fallback after a failed "Kasus baru" analysis goes to the new encounter.
  4. AI vs Template labels. Chips and the slash picker label each mode as AI (AADI) or Template (local).

Part 2: smoother flow (audit #5, #6, #9-#12)

  • Opening a dialog no longer cancels a running analysis. Scribe still cancels it, because it starts a new draft.
  • When the Ditinjau status is locked, a line explains why and links to Peninjauan.
  • Send is the only primary action in the composer. Standar/Extended shows only for Template modes.
  • With the document pane open (1201-1460 px), the composer toolbar stays on one row: Scribe and Konteks show as icons. The chip row fades at its right edge to show it scrolls.
  • The stale "Hubungkan AI Clinical" note is removed.

Verification

  • npx vitest run: 849 passed, 23 skipped. The skipped tests need private data, as before.
  • npm run lint and npx tsc --noEmit: pass.
  • Browser check with next dev in local auth mode, at 1440, 1210, 1024 and 390 px. The P0 flows were checked by hand. The composer toolbar is one row (36 px) at 1440, 1210 and 1024 px, and two rows at 390 px, as the phone layout intends.
  • A fresh reviewer read Part 1. Its 1 Critical and 3 Important findings are fixed, each with a regression test that failed first. Part 2 has not had an independent review yet.
  • Not tested: a live AADI answer (no engine or key in this environment) and the Clerk screens.

Monorepo port

The public repo is regenerated by scripts/export-split.mjs. These commits must also be applied in the monorepo capsule before the next export.

🤖 Generated with Claude Code

https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw

A first visit, an unreadable saved workspace and an unreadable encrypted
workspace now start with no demo patient or encounter, so the first case
never lands in a seeded record. A saved demo patient's placeholder note is
no longer sent to AADI as case history. (UI flow audit P0 #1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
A chip still writes its opening sentence into the composer, but the
sentence is removed once at submit, so it no longer becomes the SOAP
note's Keluhan Utama or the AADI chief complaint. An opening with nothing
after it sends nothing. (UI flow audit P0 #2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
…ounter

When the open encounter already holds a case and the typed age or sex
differs from what it knows (saved patient first, then its first case),
nothing is sent: the composer offers Kasus baru (a new encounter without
the old patient) or Tetap di encounter ini. Unknown values never block.
(UI flow audit P0 #3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
Each mode chip and slash-picker row now names its kind: AI for the five
modes AADI analyses, Template for the thirteen that only reorganise the
typed text. A local draft's chat line says it was built from the typed
text without AI analysis. (UI flow audit P0 #4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
…t workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
Review findings on the case-boundary guard:
- a Kasus baru choice whose AADI analysis fails now sends the local SOAP
  fallback to a new encounter too, never to the previous patient's;
- a held case belongs to the encounter it was held in, so opening another
  encounter voids the choice instead of filing it there unchecked;
- the held text is put in the composer, so a held scribe transcript is not
  lost when the dialog closes or the doctor types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentrapedia Ready Ready Preview Nov 26, 2026 8:04pm UTC

Request Review

@gaffercode gaffercode self-assigned this Nov 26, 2026
Tambah Konteks, Pasien, Templat, Pusat perintah and the other dialogs now
open over a running analysis instead of silently cancelling it and putting
the case back in the composer. Scribe still cancels, because it starts a
new draft. (UI flow audit #5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
While a draft's required review marks are unticked, a line under the
document head says so and opens Peninjauan, instead of a silently disabled
status option. (UI flow audit #6)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
Mulai Scribe becomes a secondary button so sending is the only primary
action in the composer, and the Standar/Extended select shows only for
template modes, the only ones it changes. (UI flow audit #9, #10)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
The note predates AADI and told doctors to connect a service that now
exists. Its unused style goes too. (UI flow audit #12)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
…hows it scrolls

Between 1201 and 1460 px, with the document pane open, Scribe and Konteks
show their icon only (label kept as accessible name and tooltip), so the
composer toolbar no longer wraps to two rows. The chip row fades at its
right edge to show that more chips scroll in. (UI flow audit #11)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6ZqRNR17D5YJczMjw
@gaffercode gaffercode changed the title Workspace UI flow: P0 safety fixes for case entry Workspace UI flow: P0 safety fixes and a smoother case flow Nov 26, 2026
@gaffercode
gaffercode marked this pull request as ready for review November 26, 2026 20:08
@gaffercode
gaffercode merged commit 22d5ad6 into main Nov 26, 2026
4 checks passed
@gaffercode
gaffercode deleted the claude/project-thread-512sm7 branch November 26, 2026 20:08
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.

2 participants