mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 02:26:37 +00:00
M8: custom detents for ScarfGo sheets (permission, cron editor)
.medium is neither/nor — too tall to peek, too short to commit to. Research recommends custom detents calibrated per sheet. - Permission sheet: `[.height(220), .large]`. 220pt shows the prompt + first ~3 options without forcing the user to drag; `large` is there for edge-case prompts with many options. - Cron editor: `[.large]` only. Cron editing is a focused task with a ~6-field form; peek detent is a distraction. `.presentationDragIndicator(.visible)` on both so users know they can drag the sheet without having to try + fail first. No other sheets in the app today. The Forget-server confirmation uses confirmationDialog (system-owned — no detents needed). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,12 @@ struct ChatView: View {
|
||||
optionId: optionId
|
||||
)
|
||||
}
|
||||
// Custom detents — `.medium` is either too tall (empty
|
||||
// space above) or too short (options clipped). A 220pt
|
||||
// peek shows the prompt + first ~3 options; users can
|
||||
// drag to large for long option lists.
|
||||
.presentationDetents([.height(220), .large])
|
||||
.presentationDragIndicator(.visible)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +87,18 @@ struct CronListView: View {
|
||||
CronEditorView(initial: job, title: "Edit cron job") { edited in
|
||||
Task { await vm.upsert(edited) }
|
||||
}
|
||||
// Cron editor is a Form with ~6 fields; .large gives room
|
||||
// without cramping. No peek detent — editing cron jobs is
|
||||
// a focused task, not something users want to half-see.
|
||||
.presentationDetents([.large])
|
||||
.presentationDragIndicator(.visible)
|
||||
}
|
||||
.sheet(isPresented: $showingNewJob) {
|
||||
CronEditorView(initial: nil, title: "New cron job") { created in
|
||||
Task { await vm.upsert(created) }
|
||||
}
|
||||
.presentationDetents([.large])
|
||||
.presentationDragIndicator(.visible)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user