feat(ui): rebuild the UX around two surfaces — a glance popover and a session window
The menu-bar popover was being used as a session manager: status, five text fields, thumbnails, three buttons, a history list and eight more flat rows in 320 pt. The redesign splits the product by job, from a UX pass whose mockups are kept under design/ux-rework/. - Popover: only the current session. Review details as one line plus a pencil that opens the window with the Lane field focused, at most three thumbnails, a Capture and a Send row, a New Session and Open Redline row, one status line when something happened, and a footer with the send channel, the retention policy and a ... menu for Settings / updates / quit. - Window: sidebar of sessions grouped Today / Yesterday / This week / by month with a Current tag and each session's state, the selected session's pages as cards (select, Delete or Remove Page, sent sessions read-only), and an inspector with editable review details, the PDF facts (file name, pages, channel, status) and the session facts (started, id, files). Past sessions show their details read-only. - Settings: three labelled groups (Capture, Sending, Sessions) replacing the headings-plus-grid layout. - Sessions list/search/grouping/state live on the model, so the window and the popover read the same truth (came-back-marked state comes from the return ledger). - Verification: 159 tests, the headless panel self-test, and an end-to-end run against the active app (scripts/run-e2e-ui.sh) which opens the real window, types into the Lane field with key events and clicks New Session, reporting what the launch mode could and could not deliver.
This commit is contained in:
@@ -76,24 +76,31 @@ enum PanelSnapshot {
|
||||
// 06 — SettingsView against the same isolated model.
|
||||
try render(
|
||||
SettingsView().environment(model),
|
||||
to: directory.appendingPathComponent("panel-06-settings.png")
|
||||
to: directory.appendingPathComponent("panel-06-settings.png"),
|
||||
width: 460,
|
||||
height: 560
|
||||
)
|
||||
|
||||
// 06b — Past submissions window against the same isolated model: the two
|
||||
// seeded past sessions plus the live session's three captures from panel 04.
|
||||
// 06b — the sessions window: real sidebar, pages grid and inspector.
|
||||
model.setPastSessions(try await model.spool.archivedSessions())
|
||||
try render(
|
||||
PastSubmissionsView().environment(model),
|
||||
to: directory.appendingPathComponent("panel-06b-past-submissions.png"),
|
||||
width: 480
|
||||
SessionsWindowView().environment(model),
|
||||
to: directory.appendingPathComponent("panel-06b-sessions-window.png"),
|
||||
width: 1100,
|
||||
height: 700
|
||||
)
|
||||
|
||||
// 15 — the session details editor open, on the same real model: lane, deployed
|
||||
// build, commit, reviewer and note are the values panel 04's session carries.
|
||||
try render(
|
||||
MenuBarView(showsContextEditor: true).environment(model),
|
||||
to: directory.appendingPathComponent("panel-15-session-details.png")
|
||||
)
|
||||
// 15 — the window with a kept past session selected (read-only inspector).
|
||||
if let kept = model.pastSessions.first {
|
||||
model.selectSession(kept.id)
|
||||
try render(
|
||||
SessionsWindowView().environment(model),
|
||||
to: directory.appendingPathComponent("panel-15-past-session.png"),
|
||||
width: 1100,
|
||||
height: 700
|
||||
)
|
||||
model.selectSession(model.session.id)
|
||||
}
|
||||
|
||||
// A real PDF built by the production composer, so the reference footer and the
|
||||
// document info can be inspected (and opened) rather than assumed.
|
||||
@@ -153,7 +160,9 @@ enum PanelSnapshot {
|
||||
model.setResolvedOneDriveFolder(resolvedFolder)
|
||||
try render(
|
||||
SettingsView().environment(model),
|
||||
to: directory.appendingPathComponent("panel-07-settings-onedrive.png")
|
||||
to: directory.appendingPathComponent("panel-07-settings-onedrive.png"),
|
||||
width: 460,
|
||||
height: 560
|
||||
)
|
||||
|
||||
// 08 — no OneDrive folder found: a fake home with NO Library/CloudStorage at
|
||||
@@ -172,7 +181,9 @@ enum PanelSnapshot {
|
||||
model.setResolvedOneDriveFolder(nil)
|
||||
try render(
|
||||
SettingsView().environment(model),
|
||||
to: directory.appendingPathComponent("panel-08-settings-onedrive-missing.png")
|
||||
to: directory.appendingPathComponent("panel-08-settings-onedrive-missing.png"),
|
||||
width: 460,
|
||||
height: 560
|
||||
)
|
||||
|
||||
// 09 — menu bar panel, 3 captures present, OneDrive mode ("Send to OneDrive").
|
||||
@@ -278,18 +289,32 @@ enum PanelSnapshot {
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private static func render(_ view: some View, to url: URL, width: CGFloat = panelWidth) throws {
|
||||
let wrapped = view
|
||||
.frame(width: width, alignment: .topLeading)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.background(Color(nsColor: .windowBackgroundColor))
|
||||
private static func render(
|
||||
_ view: some View,
|
||||
to url: URL,
|
||||
width: CGFloat = panelWidth,
|
||||
height: CGFloat? = nil
|
||||
) throws {
|
||||
// A fixed-size render (a whole window) must fill its frame; a popover render
|
||||
// sizes to its content. fixedSize on a split view collapses its columns.
|
||||
let wrapped = Group {
|
||||
if let height {
|
||||
view.frame(width: width, height: height)
|
||||
} else {
|
||||
view
|
||||
.frame(width: width, alignment: .topLeading)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
}
|
||||
.frame(width: width, height: height, alignment: .topLeading)
|
||||
.background(Color(nsColor: .windowBackgroundColor))
|
||||
|
||||
let hosting = NSHostingView(rootView: wrapped)
|
||||
hosting.wantsLayer = true
|
||||
hosting.appearance = NSAppearance(named: .aqua)
|
||||
|
||||
let window = NSWindow(
|
||||
contentRect: NSRect(x: -10_000, y: -10_000, width: panelWidth, height: 64),
|
||||
contentRect: NSRect(x: -10_000, y: -10_000, width: width, height: 200),
|
||||
styleMask: [.borderless],
|
||||
backing: .buffered,
|
||||
defer: false
|
||||
@@ -304,17 +329,26 @@ enum PanelSnapshot {
|
||||
|
||||
hosting.layoutSubtreeIfNeeded()
|
||||
var size = hosting.fittingSize
|
||||
if size.height < 1 {
|
||||
size.height = hosting.intrinsicContentSize.height
|
||||
if let height {
|
||||
size.height = height
|
||||
} else {
|
||||
if size.height < 1 {
|
||||
size.height = hosting.intrinsicContentSize.height
|
||||
}
|
||||
if size.height < 1 { size.height = 240 }
|
||||
}
|
||||
if size.height < 1 { size.height = 240 }
|
||||
size.width = width
|
||||
size.height = ceil(size.height)
|
||||
|
||||
hosting.setFrameSize(size)
|
||||
window.setContentSize(size)
|
||||
hosting.layoutSubtreeIfNeeded()
|
||||
RunLoop.current.run(until: Date(timeIntervalSinceNow: 0.05))
|
||||
// A split view (sidebar + inspector) needs a real display cycle before its
|
||||
// columns and list rows exist; a single layout pass renders blank columns.
|
||||
window.displayIfNeeded()
|
||||
RunLoop.current.run(until: Date(timeIntervalSinceNow: 0.35))
|
||||
hosting.layoutSubtreeIfNeeded()
|
||||
window.displayIfNeeded()
|
||||
|
||||
let bounds = hosting.bounds
|
||||
guard let rep = hosting.bitmapImageRepForCachingDisplay(in: bounds) else {
|
||||
|
||||
Reference in New Issue
Block a user