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
@@ -13,7 +13,8 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The quiet field label (prototype `.field-label`, #130 fold-in): mono
|
||||
/// 10.5 uppercase, one line, never a wrapping caption.
|
||||
/// 11 uppercase (r4: 10.5 → 11, the phase-2 micro-label sweep), one line,
|
||||
/// never a wrapping caption.
|
||||
struct SettingsFieldLabel: View {
|
||||
let text: String
|
||||
|
||||
@@ -23,7 +24,7 @@ struct SettingsFieldLabel: View {
|
||||
|
||||
var body: some View {
|
||||
Text(text)
|
||||
.font(.system(size: 10.5, design: DesignTokens.mono))
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.lineLimit(1)
|
||||
.tracking(0.5)
|
||||
.textCase(.uppercase)
|
||||
@@ -39,11 +40,30 @@ struct SurfaceSettingsPage: View {
|
||||
let surface: ProfileSurface
|
||||
|
||||
var body: some View {
|
||||
// r8 (mercury#20, sol — owner regression): the r6 ScrollView +
|
||||
// minHeight frame CENTERED the form in the viewport (~320px of
|
||||
// dead space under the intro) and its +24 bottom padding kept a
|
||||
// phantom scrollbar alive. Both gone — a plain top-aligned stack
|
||||
// (the Content page's r7 shape): one control column, every
|
||||
// control label-above-control at the page title's x, ~24pt under
|
||||
// the intro, no scrolling (the page fits).
|
||||
VStack(alignment: .leading, spacing: 24) {
|
||||
header
|
||||
form
|
||||
.frame(maxWidth: DesignTokens.settingsFormWidth, alignment: .leading)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.top, 17)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||
}
|
||||
|
||||
private var header: some View {
|
||||
let config = model.config(for: surface)
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
return VStack(alignment: .leading, spacing: 4) {
|
||||
HStack {
|
||||
Text(label)
|
||||
.font(.system(size: 16, weight: .semibold, design: DesignTokens.serif))
|
||||
.font(.system(size: 15, weight: .semibold, design: DesignTokens.serif))
|
||||
Spacer(minLength: 12)
|
||||
// macOS convention: Restore Defaults in the page header.
|
||||
Button("Restore Defaults") {
|
||||
@@ -51,6 +71,9 @@ struct SurfaceSettingsPage: View {
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.controlSize(.small)
|
||||
// r6 (sol#6/21 — contrast final): disabled reads muted
|
||||
// ink + the system border, never washed out.
|
||||
.foregroundStyle(config == .surfaceDefault ? DesignTokens.muted : DesignTokens.foreground)
|
||||
.disabled(config == .surfaceDefault)
|
||||
}
|
||||
// Variant B's stolen headline: the current model reads first.
|
||||
@@ -60,63 +83,66 @@ struct SurfaceSettingsPage: View {
|
||||
Text("profile · \(surface.profileName) — \(note)")
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
VStack(alignment: .leading, spacing: 14) {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
SettingsFieldLabel("Provider")
|
||||
Picker("Provider", selection: Binding(
|
||||
get: { config.provider },
|
||||
set: { model.setProvider($0, for: surface) },
|
||||
)) {
|
||||
ForEach(ModelProvider.allCases, id: \.self) { provider in
|
||||
Text(provider.label).tag(provider)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
.frame(width: 200)
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
SettingsFieldLabel("Model")
|
||||
HStack(spacing: 8) {
|
||||
ModelComboBox(
|
||||
value: config.model,
|
||||
items: model.registry.list(for: config.provider),
|
||||
) { model.setModel($0, for: surface) }
|
||||
.frame(width: 240)
|
||||
if model.isCustom(surface) {
|
||||
Text("custom (not in registry)")
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
}
|
||||
}
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
SettingsFieldLabel("Reasoning Effort")
|
||||
Picker("Reasoning Effort", selection: Binding(
|
||||
get: { config.effort },
|
||||
set: { model.setEffort($0, for: surface) },
|
||||
)) {
|
||||
Text("unset · provider default").tag(ReasoningEffort?.none)
|
||||
// The provider's ladder only — a provider switch
|
||||
// rebuilds this menu (and resets the choice).
|
||||
ForEach(config.provider.effortOptions, id: \.self) { effort in
|
||||
Text(effort.rawValue).tag(ReasoningEffort?.some(effort))
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
.frame(width: 200)
|
||||
}
|
||||
Text("Output budget fixed at \(ProfileSurface.outputBudgetTokens / 1000)k tokens — not a setting.")
|
||||
.font(.system(size: 11.5))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
}
|
||||
.padding(.top, 12)
|
||||
}
|
||||
.frame(maxWidth: DesignTokens.settingsFormWidth, alignment: .leading)
|
||||
.padding(.horizontal, 26)
|
||||
.padding(.top, 18)
|
||||
.padding(.bottom, 48)
|
||||
}
|
||||
|
||||
private var form: some View {
|
||||
let config = model.config(for: surface)
|
||||
return VStack(alignment: .leading, spacing: 14) {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
SettingsFieldLabel("Provider")
|
||||
Picker("Provider", selection: Binding(
|
||||
get: { config.provider },
|
||||
set: { model.setProvider($0, for: surface) },
|
||||
)) {
|
||||
ForEach(ModelProvider.allCases, id: \.self) { provider in
|
||||
Text(provider.label).tag(provider)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
.frame(width: 200)
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
SettingsFieldLabel("Model")
|
||||
HStack(spacing: 8) {
|
||||
ModelComboBox(
|
||||
value: config.model,
|
||||
items: model.registry.list(for: config.provider),
|
||||
) { model.setModel($0, for: surface) }
|
||||
.frame(width: 240)
|
||||
if model.isCustom(surface) {
|
||||
Text("custom (not in registry)")
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
}
|
||||
}
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
SettingsFieldLabel("Reasoning Effort")
|
||||
Picker("Reasoning Effort", selection: Binding(
|
||||
get: { config.effort },
|
||||
set: { model.setEffort($0, for: surface) },
|
||||
)) {
|
||||
Text("unset · provider default").tag(ReasoningEffort?.none)
|
||||
// The provider's ladder only — a provider switch
|
||||
// rebuilds this menu (and resets the choice).
|
||||
ForEach(config.provider.effortOptions, id: \.self) { effort in
|
||||
Text(effort.rawValue).tag(ReasoningEffort?.some(effort))
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
.frame(width: 200)
|
||||
}
|
||||
Text("Output budget fixed at \(ProfileSurface.outputBudgetTokens / 1000)k tokens — not a setting.")
|
||||
.font(.system(size: 11.5))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
}
|
||||
}
|
||||
|
||||
// wf130 `.vC .detail`: left-anchored after the sidebar, never centered
|
||||
// (r4: horizontal 24 — one leading-text token with the sidebar labels;
|
||||
// r6: the width/scroll wrappers live in body).
|
||||
|
||||
private var label: String {
|
||||
switch surface {
|
||||
case .pass1: "Pass 1"
|
||||
@@ -145,21 +171,26 @@ struct ProviderKeysPage: View {
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text("Provider Keys")
|
||||
.font(.system(size: 16, weight: .semibold, design: DesignTokens.serif))
|
||||
.font(.system(size: 15, weight: .semibold, design: DesignTokens.serif))
|
||||
Text("One key per provider, fanned out to every profile on it. No Keychain.")
|
||||
.font(.system(size: 12))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
// r8 (mercury#20, sol — owner regression): top-aligned under
|
||||
// the intro (stack 4 + padding 20 = 24pt), NO ScrollView —
|
||||
// the blocks fit the viewport whole; the r6 minHeight-center
|
||||
// + scroll wrapper died with the surface pages' copy.
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
ForEach(ModelProvider.allCases, id: \.self) { provider in
|
||||
ProviderKeyBlock(model: model, provider: provider)
|
||||
}
|
||||
}
|
||||
.padding(.top, 12)
|
||||
.padding(.top, 20)
|
||||
.frame(maxWidth: DesignTokens.settingsFormWidth + 60, alignment: .leading)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
.frame(maxWidth: DesignTokens.settingsFormWidth + 60, alignment: .leading)
|
||||
.padding(.horizontal, 26)
|
||||
.padding(.top, 18)
|
||||
.padding(.bottom, 48)
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.top, 17)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +272,9 @@ private struct ProviderKeyBlock: View {
|
||||
.buttonStyle(.bordered)
|
||||
.controlSize(.small)
|
||||
.font(.system(size: 11, design: DesignTokens.mono))
|
||||
// r6 (sol#6/21 — contrast final): disabled reads muted ink +
|
||||
// the system border, never washed out.
|
||||
.foregroundStyle(model.testStates[provider] == .running ? DesignTokens.muted : DesignTokens.foreground)
|
||||
.disabled(model.testStates[provider] == .running)
|
||||
switch model.testStates[provider] {
|
||||
case .running:
|
||||
|
||||
Reference in new issue
Block a user