feat(ui): design-council polish overhaul
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s
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:
1 parent
b2db859887
commit
3a7d495b4b
21 files changed
+2287
-516
No files matched your search
+156
-30
@@ -320,7 +320,7 @@ struct WorkspaceView: View {
|
||||
VStack(spacing: 8) {
|
||||
RailButton(pane: .posts, selection: $selection, label: "Posts", systemImage: "doc.text")
|
||||
RailButton(pane: .sessions, selection: $selection, label: "Sessions", systemImage: "bubble.left")
|
||||
RailButton(pane: .learnings, selection: $selection, label: "Learnings", systemImage: "cube")
|
||||
RailButton(pane: .learnings, selection: $selection, label: "Learnings", systemImage: "cube", weight: .light)
|
||||
// #32: Trends after Learnings — measurement beside memory.
|
||||
RailButton(pane: .trends, selection: $selection, label: "Trends", systemImage: "chart.xyaxis.line")
|
||||
Spacer()
|
||||
@@ -338,7 +338,7 @@ struct WorkspaceView: View {
|
||||
// #108: Archive at the rail bottom, above Settings (prototype's
|
||||
// box icon).
|
||||
RailButton(pane: .archive, selection: $selection, label: "Archive", systemImage: "archivebox")
|
||||
RailButton(pane: .settings, selection: $selection, label: "Settings", systemImage: "gearshape")
|
||||
RailButton(pane: .settings, selection: $selection, label: "Settings", systemImage: "gearshape", weight: .light)
|
||||
}
|
||||
.padding(.horizontal, 4)
|
||||
.padding(.vertical, 8)
|
||||
@@ -378,7 +378,9 @@ private struct ArchivePaneView: View {
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
// No New button — things arrive here by being moved, not created.
|
||||
PaneHeader(title: "Archive")
|
||||
// r8 (argon#9, mercury#18/19): the hairline is bounded to the SAME
|
||||
// fixed 720pt column the rows live in — one framed block.
|
||||
PaneHeader(title: "Archive", hairlineMaxWidth: 720)
|
||||
if archivedByProject.isEmpty {
|
||||
emptyState
|
||||
} else {
|
||||
@@ -389,9 +391,23 @@ private struct ArchivePaneView: View {
|
||||
let pieces = archivedByProject[project] ?? []
|
||||
// Same section-head shape as the library (#108
|
||||
// variant B), plus the project-level way out.
|
||||
HStack(alignment: .firstTextBaseline, spacing: 8) {
|
||||
// r7 (mercury#55, argon#41 — FINAL, supersedes the
|
||||
// r6 D24 ladder): the content column is a FIXED
|
||||
// 720pt frame (width, not maxWidth — the r6
|
||||
// content-hugging bound let the pill define the
|
||||
// right edge), left-anchored. TWO axes only, the
|
||||
// library's r7 ladder: the head row leads at x14
|
||||
// (chevron in a 14pt slot) with its label at x28 —
|
||||
// the ONE indent, shared with the entry rows'
|
||||
// inner text via the shared LibraryPostRow (cards
|
||||
// lead at x14); the 'Unarchive Group' pill rides
|
||||
// the header row's trailing edge INSIDE the frame
|
||||
// (14 → 706), and the row hairlines are bounded by
|
||||
// the same frame. Nothing spans past it.
|
||||
HStack(alignment: .firstTextBaseline, spacing: 0) {
|
||||
Image(systemName: "chevron.down")
|
||||
.font(.system(size: 9, weight: .semibold))
|
||||
.font(.system(size: 10, weight: .semibold))
|
||||
.frame(width: 14, alignment: .leading)
|
||||
.rotationEffect(.degrees(collapsed.contains(project) ? -90 : 0))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
.onTapGesture {
|
||||
@@ -400,8 +416,10 @@ private struct ArchivePaneView: View {
|
||||
.accessibilityLabel("Toggle \(project)")
|
||||
.accessibilityHint(collapsed.contains(project) ? "Collapsed" : "Expanded")
|
||||
Text(project)
|
||||
.font(.system(size: 15, weight: .semibold, design: DesignTokens.serif))
|
||||
.textCase(.lowercase) // #108: display-only — the folder name keeps its case
|
||||
.font(.system(size: 11, weight: .medium, design: DesignTokens.mono))
|
||||
.kerning(0.6)
|
||||
.textCase(.uppercase) // #108: display-only — the folder name keeps its case
|
||||
.foregroundStyle(DesignTokens.muted) // r6: full ink — contrast final
|
||||
.lineLimit(1)
|
||||
.truncationMode(.tail)
|
||||
.onTapGesture {
|
||||
@@ -410,25 +428,40 @@ private struct ArchivePaneView: View {
|
||||
Text("· \(pieces.count)")
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
Spacer(minLength: 0)
|
||||
Button("Unarchive") {
|
||||
.padding(.leading, 8)
|
||||
Spacer(minLength: 8)
|
||||
// The 'New Post · Fork · Compact' language — a
|
||||
// bordered mono-11 secondary pill at the
|
||||
// trailing edge INSIDE the fixed 720pt frame.
|
||||
// r7 (mercury#55, argon#41): relabeled
|
||||
// 'Unarchive Group' — it moves the whole
|
||||
// project, not one piece.
|
||||
Button("Unarchive Group") {
|
||||
model.unarchiveProject(project, home: home)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
.buttonStyle(BorderedSecondaryButtonStyle(minHeight: 24))
|
||||
.help("Move the whole project back to projects/")
|
||||
.accessibilityLabel("Unarchive \(project)")
|
||||
}
|
||||
.padding(.top, 16)
|
||||
.padding(.top, 12)
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.bottom, 6)
|
||||
.padding(.bottom, 2)
|
||||
if !collapsed.contains(project) {
|
||||
ForEach(pieces) { post in
|
||||
// r7: the shared LibraryPostRow ladder —
|
||||
// card leads at x14 (PRIMARY), title text
|
||||
// at x28 (the one indent). The hairline is
|
||||
// BOUNDED to the fixed frame: x14 → 706.
|
||||
LibraryPostRow(post: post, selected: post.id == model.selectedPostID) {
|
||||
model.select(post.id, home: home)
|
||||
onOpenPiece()
|
||||
}
|
||||
.overlay(alignment: .bottom) {
|
||||
Rectangle()
|
||||
.fill(DesignTokens.border)
|
||||
.frame(height: 1)
|
||||
.padding(.horizontal, 14)
|
||||
}
|
||||
.contextMenu {
|
||||
Button("Move Back to \(post.project)") {
|
||||
model.restorePost(post, home: home)
|
||||
@@ -446,6 +479,15 @@ private struct ArchivePaneView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
// r7 (mercury#55, argon#41): the FIXED 720pt reading
|
||||
// column — width, not maxWidth (the r6 content-hugging
|
||||
// bound let the pill define the right edge); rows,
|
||||
// hairlines, and the pill all live inside it.
|
||||
// ponytail: fixed width clips on panes narrower than
|
||||
// 720 — a width-floored variant if a small-window
|
||||
// Archive ever matters.
|
||||
.frame(width: 720, alignment: .leading)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(.bottom, 12)
|
||||
}
|
||||
}
|
||||
@@ -647,13 +689,36 @@ private struct NewProjectSheet: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Rail button per the export: 44×44 muted icon, hover wash, and the current
|
||||
/// pane raised as a surface card with a 2px selection bar on the rail's edge.
|
||||
/// Rail button: 44×44 muted icon, hover wash, the current pane raised as
|
||||
/// a tile. NO visible edge bar — ui-polish r2 re-ruling: the export's
|
||||
/// `::before` selection bar paints behind the app border in the export's
|
||||
/// own render, so a visible bar reads as a stray clipped mark;
|
||||
/// contract-faithful is tile + border + fg-ink icon alone.
|
||||
/// r5 (sol#40, mercury#54/56 — one final strength step, modest): the
|
||||
/// selected tile's fill steps from surface (invisible on the chrome
|
||||
/// background) to a 0.08 foreground wash with a muted-0.4 hairline — the
|
||||
/// fg-ink glyph reads stronger against it. Icon weight stays constant
|
||||
/// (sol#45: selection emphasis comes from the tile, never the glyph).
|
||||
private struct RailButton: View {
|
||||
let pane: WorkspaceView.Pane
|
||||
@Binding var selection: WorkspaceView.Pane
|
||||
let label: String
|
||||
let systemImage: String
|
||||
/// sol#45: one explicit size for all six icons; glyph-dense ones (cube,
|
||||
/// gearshape) opt down a weight so every icon reads the same apparent
|
||||
/// mass — selection emphasis comes from the tile, never icon weight.
|
||||
var weight: Font.Weight = .regular
|
||||
|
||||
/// r7 (sol#33): the selected glyph's ONE step up (light→regular,
|
||||
/// regular→medium) — full-ink color on thin strokes still read
|
||||
/// near-muted; the step puts the current pane's icon at true ink.
|
||||
private var selectedWeight: Font.Weight {
|
||||
switch weight {
|
||||
case .light: .regular
|
||||
default: .medium
|
||||
}
|
||||
}
|
||||
|
||||
@State private var hover = false
|
||||
|
||||
var body: some View {
|
||||
@@ -662,6 +727,11 @@ private struct RailButton: View {
|
||||
selection = pane
|
||||
} label: {
|
||||
Image(systemName: systemImage)
|
||||
// r7 (sol#33): the selected glyph steps ONE weight up —
|
||||
// full ink on a thin-stroke symbol at .light/.regular
|
||||
// reads near-muted against the 0.08 wash. Unselected
|
||||
// icons keep their sol#45 mass exactly.
|
||||
.font(.system(size: 16, weight: selected ? selectedWeight : weight))
|
||||
.frame(width: 44, height: 44)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
@@ -669,37 +739,90 @@ private struct RailButton: View {
|
||||
.background {
|
||||
if selected || hover {
|
||||
RoundedRectangle(cornerRadius: DesignTokens.radius)
|
||||
.fill(selected ? DesignTokens.surface : DesignTokens.foreground.opacity(0.06))
|
||||
// r5 (sol#40, mercury#54/56): selected = a 0.08
|
||||
// foreground wash + muted-0.4 hairline (surface-on-
|
||||
// chrome was invisible); hover keeps the 0.06 wash,
|
||||
// borderless. Modest — the hierarchy holds.
|
||||
.fill(selected ? DesignTokens.foreground.opacity(0.08) : DesignTokens.foreground.opacity(0.06))
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: DesignTokens.radius)
|
||||
.strokeBorder(selected ? DesignTokens.border : .clear),
|
||||
.strokeBorder(selected ? DesignTokens.muted.opacity(0.4) : .clear),
|
||||
)
|
||||
}
|
||||
}
|
||||
.overlay(alignment: .leading) {
|
||||
// Selection bar (`.rail-btn[aria-current]::before`); offset to sit
|
||||
// on the rail's leading edge like the export's negative inset.
|
||||
if selected {
|
||||
Rectangle()
|
||||
.fill(DesignTokens.foreground)
|
||||
.frame(width: 2, height: 22)
|
||||
.offset(x: -6)
|
||||
}
|
||||
}
|
||||
.onHover { hover = $0 }
|
||||
.help(label)
|
||||
.accessibilityLabel(label)
|
||||
}
|
||||
}
|
||||
|
||||
/// r6 (mercury#49/52, argon#13): the shared selected-row strip — a 2pt
|
||||
/// accent capsule with radius-1 rounded ends, vertically inset 6pt from
|
||||
/// the row's edges so it sits INSIDE the card/fill (Posts library rows,
|
||||
/// Settings sidebar rows). Callers toggle it via opacity so the 2pt
|
||||
/// reservation keeps layout constant.
|
||||
struct SelectedRowStrip: View {
|
||||
var body: some View {
|
||||
RoundedRectangle(cornerRadius: 1)
|
||||
.fill(DesignTokens.accent)
|
||||
.frame(width: 2)
|
||||
.padding(.vertical, 6)
|
||||
}
|
||||
}
|
||||
|
||||
/// ui-polish r2: the app's bordered secondary button — mono-11 ink on a
|
||||
/// surface fill with a #E8E5DF hairline (Archive's Unarchive, Settings'
|
||||
/// Choose…). 36pt tall by default — a real hit target, not a text-size
|
||||
/// pill; pass a smaller `minHeight` where the row is compact.
|
||||
/// r5 (argon#21): `softBorder` halves the hairline's opacity for the one
|
||||
/// placement that sits INSIDE a field group (Choose…) — a full-strength
|
||||
/// stroke there read as a double border.
|
||||
struct BorderedSecondaryButtonStyle: ButtonStyle {
|
||||
var minHeight: CGFloat = 36
|
||||
var softBorder: Bool = false
|
||||
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
configuration.label
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.foreground)
|
||||
.padding(.horizontal, 12)
|
||||
.frame(minHeight: minHeight)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 8)
|
||||
.fill(DesignTokens.surface)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 8)
|
||||
.strokeBorder(DesignTokens.border.opacity(softBorder ? 0.5 : 1)),
|
||||
),
|
||||
)
|
||||
.opacity(configuration.isPressed ? 0.7 : 1)
|
||||
}
|
||||
}
|
||||
|
||||
/// Pane-head row per the export (52pt, serif 15 semibold title, bottom border).
|
||||
/// Trailing slot carries #18's New Post button (export `.pane-head .icon-btn`).
|
||||
struct PaneHeader<Trailing: View>: View {
|
||||
let title: String
|
||||
/// Leading inset of the title row. Export default 14; the Learnings pane
|
||||
/// passes 26 so its title shares one leading edge with headings + rows.
|
||||
var titleInset: CGFloat = 14
|
||||
/// r8 (argon#9, mercury#18/19 — convergent): when set, the bottom
|
||||
/// hairline is bounded to the same column the pane's content sits in
|
||||
/// (Archive/Learnings' 720pt reading column) — title, hairline, and
|
||||
/// content read as one framed block instead of a full-width rule over
|
||||
/// a bounded column. nil = full width (every other pane's default).
|
||||
var hairlineMaxWidth: CGFloat?
|
||||
@ViewBuilder var trailing: () -> Trailing
|
||||
|
||||
init(title: String, @ViewBuilder trailing: @escaping () -> Trailing = { EmptyView() }) {
|
||||
init(
|
||||
title: String,
|
||||
titleInset: CGFloat = 14,
|
||||
hairlineMaxWidth: CGFloat? = nil,
|
||||
@ViewBuilder trailing: @escaping () -> Trailing = { EmptyView() },
|
||||
) {
|
||||
self.title = title
|
||||
self.titleInset = titleInset
|
||||
self.hairlineMaxWidth = hairlineMaxWidth
|
||||
self.trailing = trailing
|
||||
}
|
||||
|
||||
@@ -711,11 +834,14 @@ struct PaneHeader<Trailing: View>: View {
|
||||
Spacer()
|
||||
trailing()
|
||||
}
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.horizontal, titleInset)
|
||||
.frame(minHeight: 52)
|
||||
Rectangle()
|
||||
.fill(DesignTokens.border)
|
||||
.frame(height: 1)
|
||||
// r8: the bound shares the content column's leading edge
|
||||
// (x0) and width — leading-aligned, never centered.
|
||||
.frame(maxWidth: hairlineMaxWidth ?? .infinity, alignment: .leading)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user