feat(ui): design-council polish overhaul
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s

Eight arbitrated rounds over the workspace surface: piece-scoped Mentor
hosting, conversation-voice system messages, glyph-measured roster
truncation, bounded learnings/archive columns, symmetric trends grid,
top-aligned settings forms, serif editor titles, outline rail rhythm,
launch auto-focus root fix. New seams pinned by SessionScopeTests +
WordBoundaryTruncationTests; full suite green.
This commit is contained in:
AlexKucera committed 2026-11-07 20:41:34 +01:00
1 parent b2db859887
commit 3a7d495b4b
21 files changed
+2287 -516

No files matched your search

+87 -23
View File
@@ -130,7 +130,11 @@ struct LearningsPaneView: View {
var body: some View {
VStack(spacing: 0) {
// No New button — learnings arrive by promotion, not creation.
PaneHeader(title: "Learnings")
// One shared leading edge (26): pane title, group headings, and
// entry text all start at the same x.
// r8 (argon#9, mercury#18/19): the hairline is bounded to the
// SAME 720pt reading column the entries sit in — one framed block.
PaneHeader(title: "Learnings", titleInset: 26, hairlineMaxWidth: 720)
if let lastError {
Text(lastError)
.font(.system(size: 11, design: DesignTokens.mono))
@@ -146,12 +150,22 @@ struct LearningsPaneView: View {
} else {
ScrollView {
LazyVStack(alignment: .leading, spacing: 4) {
ForEach(groups, id: \.type) { group in
LearningSection(group: group) { entry in
// r6 (argon#17, mercury#26 — rhythm): the FIRST
// group sits 10pt under the pane header; every
// later group breaks with a column-bounded
// hairline above its head (~22pt above the
// rule, ~18pt below — LearningSection).
ForEach(Array(groups.enumerated()), id: \.element.type) { index, group in
LearningSection(group: group, isFirst: index == 0) { entry in
dismiss(entry, in: group.type)
}
}
}
// ui-polish r2: bounded reading column (~720pt, the
// transcript's measure language), left-anchored — entries
// never stretch across the whole canvas.
.frame(maxWidth: 720, alignment: .leading)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.bottom, 12)
}
}
@@ -223,28 +237,59 @@ struct LearningsPaneView: View {
/// One content-type section: the head + its rows. A child view so the
/// lazy stack sees one view per group (its inner ForEach is the view's
/// own body, not uneven outer-row content).
/// own body, not uneven outer-row content). r5 (argon#17, mercury#26):
/// `isFirst` picks the rhythm — 10pt under the pane header (no rule; the
/// header's own hairline is right above), or a 32pt break with a
/// column-bounded hairline above the head.
private struct LearningSection: View {
let group: LearningsIndex.Group
let isFirst: Bool
let onDismiss: (LearningsIndex.Entry) -> Void
var body: some View {
SectionHeadView(type: group.type, count: group.entries.count)
.padding(.top, 16)
.padding(.horizontal, 14)
.padding(.bottom, 6)
// Foreign (unclocked) dirs never offer Dismiss — their clock
// reads 0 forever, a dismiss there would hide permanently (the
// store refuses too; #27 audit).
let dismissable = LearningDecay.isClocked(group.type)
ForEach(group.entries) { entry in
LearningRow(entry: entry, onDismiss: dismissable ? { onDismiss(entry) } : nil)
VStack(alignment: .leading, spacing: 4) {
if !isFirst {
// r6 (argon#16, mercury#26): the break hairline is BOUNDED
// to the content column — same leading x as the entry text
// (26), same right edge as the 720 column (it used to start
// 27px LEFT of the text and end mid-window).
Rectangle()
.fill(DesignTokens.border)
.frame(height: 1)
.padding(.leading, 26)
}
SectionHeadView(type: group.type, count: group.entries.count)
// r7 (argon#15, mercury#49): the FIRST category label
// sits 24pt under the header hairline (the r6 10 clung
// to the rule); later groups keep their break rhythm.
.padding(.top, isFirst ? 24 : 14)
.padding(.horizontal, 26)
.padding(.bottom, 2)
// Foreign (unclocked) dirs never offer Dismiss — their clock
// reads 0 forever, a dismiss there would hide permanently (the
// store refuses too; #27 audit).
let dismissable = LearningDecay.isClocked(group.type)
ForEach(group.entries) { entry in
LearningRow(entry: entry, onDismiss: dismissable ? { onDismiss(entry) } : nil)
}
}
// r6 rhythm (sol#36, mercury#54): above the rule = last row's
// bottom 10 + stack spacing 4 + this 8 ≈ 22pt (was ~36); below
// the rule = spacing 4 + head top 14 ≈ 18pt (was ~7) — balanced
// per the 20-24/16-20 ruling; label → first entry = head bottom
// 2 + spacing 4 + row top 10 ≈ 16 (was ~25, tighter).
.padding(.top, isFirst ? 0 : 8)
}
}
/// The library's section-head voice: serif-15 semibold name
/// (display-lowercased) + mono-11 `· N` count.
/// The section-head voice, DEMOTED below the pane title (serif-15):
/// ui-polish r2 — the library's pass-state voice (tracked UPPERCASE
/// mono micro-label) + mono-11 `· N` count. r4 (sol#4, argon#49): 11pt
/// medium — a touch MORE weight than the filenames beneath, which
/// step down (LearningRow) so the category always wins the hierarchy.
/// r6: full muted ink (contrast final). The category break (22/18pt
/// margins + a column-bounded hairline) lives in LearningSection.
/// Shares the pane's single leading edge (26).
private struct SectionHeadView: View {
let type: String
let count: Int
@@ -252,8 +297,13 @@ private struct SectionHeadView: View {
var body: some View {
HStack(alignment: .firstTextBaseline, spacing: 8) {
Text(type)
.font(.system(size: 15, weight: .semibold, design: DesignTokens.serif))
.textCase(.lowercase) // display-only — the dir name keeps its case
.font(.system(size: 11, weight: .medium, design: DesignTokens.mono))
.kerning(0.6)
.textCase(.uppercase) // display-only — the dir name keeps its case
// r6 (sol#6/21 — contrast final): full muted ink; the r4
// 0.9 wash died here (the weight step below still wins the
// hierarchy).
.foregroundStyle(DesignTokens.muted)
.lineLimit(1)
.truncationMode(.tail)
Text("· \(count)")
@@ -276,25 +326,35 @@ private struct LearningRow: View {
var body: some View {
HStack(alignment: .top) {
VStack(alignment: .leading, spacing: 5) {
// r7 (mercury#49, argon#15): serif-13 semibold — the
// pane title keeps the serif-15 rung; hierarchy rides
// the rung gap (r6's sans-14 sat too close to it).
Text(entry.pattern)
.font(.callout.weight(.semibold))
.font(.system(size: 13, weight: .semibold, design: DesignTokens.serif))
.lineLimit(1)
.truncationMode(.tail)
.frame(maxWidth: .infinity, alignment: .leading)
if let problem = entry.problem {
// r7 (sol#34): descriptions at an explicit 13pt.
Text(problem)
.font(.callout)
.font(.system(size: 13))
.foregroundStyle(DesignTokens.muted)
.lineLimit(2)
.truncationMode(.tail)
.frame(maxWidth: .infinity, alignment: .leading)
}
// r7 (sol#34): description → filename gap +5 (spacing 5
// + this 5 = 10) — the meta line reads as the entry's
// footnote, not a third body line.
Text(metaLine)
.font(.system(size: 11, design: DesignTokens.mono))
// r4 (mercury#59 tail): the filename/meta line recedes one
// more step — 10.5, beneath the 11pt medium category labels.
.font(.system(size: 10.5, design: DesignTokens.mono))
.foregroundStyle(DesignTokens.muted)
.lineLimit(1)
.truncationMode(.tail)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.top, 5)
}
if entry.resurfacesIn == nil, let onDismiss {
Button("Dismiss", action: onDismiss)
@@ -305,8 +365,12 @@ private struct LearningRow: View {
.accessibilityLabel("Dismiss \(entry.pattern)")
}
}
.padding(10)
.opacity(entry.resurfacesIn == nil ? 1 : 0.45)
// One leading edge with the pane title and group headings (26).
.padding(EdgeInsets(top: 10, leading: 26, bottom: 10, trailing: 14))
// Dismissed rows dim to the 0.85 floor (r6 contrast final —
// deliberately-receding chrome never sits below 0.85; the r2
// 0.6 dim died) — visible as dimmed, never washed out.
.opacity(entry.resurfacesIn == nil ? 1 : 0.85)
}
private var metaLine: String {