CI / ci (push) Canceled after 0s
Wayfinder map #153, build slice 1 of the #154 contract: the shared SessionTranscriptView speaks the two-color editorial voice — speaker prefixes map onto serif agent prose (markdown at flush, verbatim streaming), right-aligned terracotta user capsules, and the mono status box on the fg-wash card; ThinkingBlock port; composer restyle with one Send/Stop button, floating liveness chip, and the Debug toggle moved to its trailing edge (Sessions pane inherits the same surface). Finish-audit fanout hardened it: interpreted markdown opens http(s) only (openURL gate at the sink — engine prose echoes imported content; pinned via the pure linkVerdict seam), Caps Lock no longer turns Shift+Return into a send (pinned), the plain-Button toggles speak state to VoiceOver, and the dead GeometryReader wrapper is gone. Suite 584/584 (xcresult count), flip-verified pins, swiftformat + swiftlint clean at the error tier.
81 lines
8.2 KiB
Markdown
81 lines
8.2 KiB
Markdown
# Restyle the shared conversation surface (SessionTranscriptView)
|
||
|
||
> **Date:** 2026-11-04
|
||
> **Type:** issue
|
||
> **Reference:** [#155](https://git.babylondreams.de/AlexKucera/museion/issues/155) (map [#153](https://git.babylondreams.de/AlexKucera/museion/issues/153))
|
||
|
||
## Goal
|
||
|
||
Build slice 1 of the mentor-pane editorial-voice map: port the locked contract (`ref/prototypes/wf154-mentor-pane-prototype.html`, ruled in #154) into the shared `SessionTranscriptView` — the Vivarium chat treatment remapped onto the two-color palette. The Sessions pane inherits the same surface.
|
||
|
||
## What Was Done
|
||
|
||
- **Three-voice classifier** (`SessionTranscriptView.speaker(of:)`, static nonisolated, test-pinned): the model's speaker prefixes map onto the contract voices — `"Mentor: "` → agent prose, `"You: "` → user capsule, everything else (refusals, pass kick-off labels, reveals) → the system status box.
|
||
- **Agent prose**: full-width serif 15/1.6 (`lineSpacing(9)`), markdown parsed at flush (`markdownText`, Vivarium `inlineOnlyPreservingWhitespace` + verbatim fallback), `Text(verbatim:)` while streaming — the #97 pattern.
|
||
- **User capsule**: right-aligned, terracotta wash 14% (`accent.opacity(0.14)`), sans 13/1.5, pads 16/12, `UnevenRoundedRectangle` 12/12/2/12 (2pt tail bottom-trailing), capped at 85% of the live content column (`GeometryReader` + `onGeometryChange` → `paneWidth`; seeded 356 so the mentor pane's first frame is right, the Sessions pane's wider column corrects on the first pass).
|
||
- **Status box**: mono 11/1.5 muted on the fg-wash 6% card (ruling: card fill = `foreground.opacity(0.06)`, borderless, radius 10).
|
||
- **ThinkingBlock port**: mono-11 toggle (chevron idle, spinner live) over serif-13 muted on the wash card; owns expansion state — live mounts open, flushed mounts collapsed. Replaces `ThoughtRow` and the capped 3-line live-thinking rendering.
|
||
- **Research-note cards** inherit the wash card family (folded derivation from #154).
|
||
- **Composer restyle**: surface-fill input (radius 10, border, min-height 36), ONE action button — accent Send idle, terracotta-outlined Stop mid-stream (`keyboardShortcut(.defaultAction)` rides Send only), floating `.thinMaterial` liveness chip above the composer (streaming only, hit-through), mono-10 lowercase `debug` text toggle at the trailing edge via a new `debugBinding: Binding<Bool>?` (nil = no toggle — the Sessions pane).
|
||
- **Return-key split** (`onKeyPress`): plain Return sends, Shift+Return breaks the line — ported from the Vivarium owner-report fix (2026-10-26); the current composer had the same latent bug (Return sent the draft with no way to type a newline). `send()` gained the empty-trim guard the double-fire needs.
|
||
- **MentorPaneView**: header Debug checkbox deleted (settled #5 — the toggle's seat is the composer's edge); passes `$debugRows` as `debugBinding`.
|
||
- Test: `speaker classifier maps prefixes onto the contract voices` in `ACPClientTests.swift`, beside the `isWritingRow` pins.
|
||
|
||
### Audit pass (finish-audit fanout: ponytail + security + general)
|
||
|
||
- **Link-open gate (security MEDIUM)**: the restyle is the app's first *interpreted* render of engine-sourced text, and `Text` renders parsed markdown links tappable by default — engine prose echoes imported content, so a lying `[label](scheme:…)` link could reach any registered handler. Fixed at the sink (#34 doctrine): `linkVerdict(for:)` (pure enum — `OpenURLAction.Result` is a struct and unpinnable by pattern) drives the surface's `openURL` environment — http(s) rides the system action (case-insensitive scheme), everything else discards. Pinned (`linkVerdict discards non-http schemes…`).
|
||
- **Caps-Lock Return split (general LOW)**: exact `modifiers == .shift` turned Shift+Return under Caps Lock into a send. Fixed via `returnIntent(for:)` (masks `.capsLock`; send / lineBreak / passthrough), pinned (`returnIntent masks caps lock…`).
|
||
- **A11y (general MEDIUM)**: the debug toggle and ThinkingBlock lost their Toggle/DisclosureGroup semantics when they became plain Buttons — added `accessibilityLabel`/`accessibilityValue` pairs (unpinned delta: no component-render harness in this repo).
|
||
- **GeometryReader wrapper deleted (ponytail + general, converged)**: `.onGeometryChange` attaches to the VStack directly; the greedy proxy-discarding wrapper added nothing.
|
||
- **3-line tombstone comment in MentorPaneView deleted (ponytail)**; `markdownText` gained the re-parse ceiling `ponytail:` note (per-row Text cache is the upgrade path).
|
||
- Declined: cutting `.onSubmit` (it is the ⌅/⌘↩ submit path; the empty-trim guard makes the double-fire a no-op — kept with a comment). Deferred: `Speaker` identity on `SessionRow` (model churn, pre-existing prefix posture).
|
||
|
||
## Decisions & Rationale
|
||
|
||
| Decision | Rationale |
|
||
|----------|-----------|
|
||
| Classifier over row-type changes | The model already stamps speaker prefixes (`"Mentor: "`, `"You: "`); the render seam maps them, Vivarium convention. Zero model churn, `isWritingRow` and its pins untouched. |
|
||
| `debugBinding: Binding<Bool>?` (defaulted nil) | Keeps `@AppStorage("mentorDebugRows")` ownership in MentorPaneView; both existing call sites compile unchanged. |
|
||
| GeometryReader width over a static cap | Vivarium shipped static 624 for its fixed 810pt column; Museion's shared surface also renders in the Sessions pane's flexible column, so the 85% cap must follow live width. |
|
||
| Live thinking stays debug-gated | The settled treatment rules styling, not visibility; `isWritingRow`'s filter is pinned behavior. One-line change later if the owner wants thinking in the writing voice. |
|
||
| Two tolerated lint warnings (file 573 lines, type body 271) | Warning tier is the repo's tolerated band (app target carries 92; ProfileProvisioner 659); errors at 1000/350 are the gate. Composer already sits in a file-scope extension (type-body posture). |
|
||
|
||
## Gotchas & Fixes
|
||
|
||
| Problem | Root Cause | Fix |
|
||
|---------|------------|-----|
|
||
| Build error ×2: `_ShapeStyle` not `RoundedRectangle` | `.fill()` returns a View; the `washCard` helpers declared the shape return type | Return `some View` |
|
||
| Typo `.foregroughStylePlaceholder` | write_file slip | Patched to `.foregroundStyle(DesignTokens.foreground)` |
|
||
|
||
## Files Changed
|
||
|
||
| File | Change Summary |
|
||
|------|---------------|
|
||
| `Museion/SessionTranscriptView.swift` | Full contract restyle: three voices, ThinkingBlock, capsule, composer, liveness chip, debug toggle seat |
|
||
| `Museion/MentorPaneView.swift` | Header Debug checkbox removed; `$debugRows` passed as `debugBinding` |
|
||
| `MuseionTests/ACPClientTests.swift` | Speaker-classifier pin (6 cases) |
|
||
|
||
## Verification
|
||
|
||
- `xcodebuild … build` → **BUILD SUCCEEDED**
|
||
- `xcodebuild … -only-testing:MuseionTests test` → xcresult: **584 total, 584 passed, 0 failed** (audit pass added the `linkVerdict` + `returnIntent` pins to the earlier 582); each new pin confirmed executed + Passed in the xcresult (count, not banner).
|
||
- Flip cycle: both guards disabled in one edit → exactly the two new pins failed (2/584); restored, hash-verified byte-identical to the green source.
|
||
- swiftformat on changed files, swiftlint: no errors (warnings in the repo's tolerated band).
|
||
|
||
## Gotchas & Fixes (audit pass)
|
||
|
||
| Problem | Root Cause | Fix |
|
||
|---------|------------|-----|
|
||
| Pin compile error ×2 runs: `~= requires 'OpenURLAction.Result' conform to 'Equatable'` | `OpenURLAction.Result` is a **struct with static factories, not an enum** — `guard case .systemAction =` parsed as an expression pattern | Pure `LinkVerdict` enum seam; the Result mapping lives at the `openURL` environment site |
|
||
| Pin compile error: `static property 'shift' is not available due to missing import of defining module 'SwiftUI'` | `EventModifiers` statics inside `#expect` macro expansions under MemberImportVisibility | `import SwiftUI` in the test file |
|
||
|
||
## Open Items & Next Steps
|
||
|
||
- [ ] [#156](https://git.babylondreams.de/AlexKucera/museion/issues/156) — build slice 2: MentorPaneView chrome (header serif + ready dot + session chip, pass-bar selector, fix-cards plain row, crash/missing-engine/starting states in the editorial voice).
|
||
- [ ] Code is uncommitted on `main` (working tree) — commit needs explicit authorization.
|
||
- [ ] Optional dogfood check: launch and eyeball both render sites (Mentor column + Sessions detail column).
|
||
|
||
---
|
||
|
||
*Log written by write-log skill*
|