Underline the current server chip; insist on ask_human for choices

This commit is contained in:
Ian Gulliver
2026-10-19 16:59:00 -07:00
parent 01cabc0e43
commit b9a988e2d5
4 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ Focus lives in `Store`. In-app `#/` links go through `Store.route`: `#/task/<id>
## Window and layout ## Window and layout
One window (a `Window` scene, id `main`) shows one saved server at a time: `Servers.current`, the origin it shows, or nil for the connection screen. The title bar holds no title, only the server picker (`ServerPicker`, a toolbar item in the principal placement with the toolbar's shared glass background hidden, so the chips sit directly on the title bar): a row of every saved server in saved order (`ServerRecord.saved`, the order Previous and Next Server follow), each its colour dot (hollow until its connection is running) and short name (its host up to the first dot, `serverName`), then **+**, which shows the connection screen. Clicking a server shows it. Since every connection runs in the background, each server carries what needs the user there: its count of open inbox items as a badge, with the server's name in the warning colour and tint, and its count of active tasks with an unread turn summary (`Store.unreadSummaries`) as a bare number in the accent colour, in a slot two digits wide that is reserved even when the count is zero, so the picker never shifts as summaries arrive and are read. The current server's name is bold on the surface colour. Switching servers swaps the window's content; every connection keeps running in the background. Each server has its own `Overlays`, held by its `Connection`, so its switcher, dialogs and left-pane tab survive switching away and back, and its `MainView` is rebuilt (`.id` of its `Store`) so no view state carries from one server to another. A `Connection` remembers the `started_at` its server reported when it connected; whenever its global event stream reconnects, it reads `/api/admin/status` again, and when `started_at` has changed (the server restarted, perhaps on a new build whose migrations rewrote stored events), it builds a new `Store` that loads everything afresh, swaps it in once loaded, and stops the old one; the new `Store` takes over the old one's `Drafts` and `ImageDrafts`, so unsent composer text and pasted images survive, so no events cached from the old server are ever drawn. The content sits inside a 3-point border in the server's colour (`Servers.color`, one of the task colours, picked from a row of swatches in Settings under Window colour and kept in the server's `ServerRecord`, so every Mac shows the same colour). The connection screen has no border. The panes follow the "UI layout" rules in `AGENTS.md`: an `HStack` of two panes of exactly equal width at every size, no sidebar, no navbar, nothing above them but the identity banner when the user has no git identity. One window (a `Window` scene, id `main`) shows one saved server at a time: `Servers.current`, the origin it shows, or nil for the connection screen. The title bar holds no title, only the server picker (`ServerPicker`, a toolbar item in the principal placement with the toolbar's shared glass background hidden, so the chips sit directly on the title bar): a row of every saved server in saved order (`ServerRecord.saved`, the order Previous and Next Server follow), each its colour dot (hollow until its connection is running) and short name (its host up to the first dot, `serverName`), then **+**, which shows the connection screen. Clicking a server shows it. Since every connection runs in the background, each server carries what needs the user there: its count of open inbox items as a badge, with the server's name in the warning colour and tint, and its count of active tasks with an unread turn summary (`Store.unreadSummaries`) as a bare number in the accent colour, in a slot two digits wide that is reserved even when the count is zero, so the picker never shifts as summaries arrive and are read. Only the current server's name is bold, on the surface colour, with a 2-point bar under it in the server's colour that stays when the warning tint replaces the surface colour. Switching servers swaps the window's content; every connection keeps running in the background. Each server has its own `Overlays`, held by its `Connection`, so its switcher, dialogs and left-pane tab survive switching away and back, and its `MainView` is rebuilt (`.id` of its `Store`) so no view state carries from one server to another. A `Connection` remembers the `started_at` its server reported when it connected; whenever its global event stream reconnects, it reads `/api/admin/status` again, and when `started_at` has changed (the server restarted, perhaps on a new build whose migrations rewrote stored events), it builds a new `Store` that loads everything afresh, swaps it in once loaded, and stops the old one; the new `Store` takes over the old one's `Drafts` and `ImageDrafts`, so unsent composer text and pasted images survive, so no events cached from the old server are ever drawn. The content sits inside a 3-point border in the server's colour (`Servers.color`, one of the task colours, picked from a row of swatches in Settings under Window colour and kept in the server's `ServerRecord`, so every Mac shows the same colour). The connection screen has no border. The panes follow the "UI layout" rules in `AGENTS.md`: an `HStack` of two panes of exactly equal width at every size, no sidebar, no navbar, nothing above them but the identity banner when the user has no git identity.
At launch the window shows the oldest saved server. A CloudKit import that brings a server saved on another Mac starts its connection, and the window takes it while it shows an empty connection screen. A CloudKit import that removes the current server switches to the first saved one. SwiftUI's own window restoration is off (`restorationBehavior(.disabled)`); the scene keeps the id `main` that earlier builds used, because AppKit restores their saved window by that id and SwiftUI then opens no launch window at all when the id names no scene. At launch the window shows the oldest saved server. A CloudKit import that brings a server saved on another Mac starts its connection, and the window takes it while it shows an empty connection screen. A CloudKit import that removes the current server switches to the first saved one. SwiftUI's own window restoration is off (`restorationBehavior(.disabled)`); the scene keeps the id `main` that earlier builds used, because AppKit restores their saved window by that id and SwiftUI then opens no launch window at all when the id names no scene.
+1 -1
View File
@@ -15,7 +15,7 @@ import (
) )
const guidance = `You are running inside byre. The human reads your work in byre's app, not a terminal. const guidance = `You are running inside byre. The human reads your work in byre's app, not a terminal.
- Ask every question with byre's ask_human tool, never in prose. - Ask every question with byre's ask_human tool, never in prose. Anything that leaves you waiting on the human's pick or go-ahead is a question, however it is worded and with or without a question mark: options they asked you to suggest, a proposal waiting for approval, "tell me which you want".
- End every turn with a short final message for the human: what you did, anything you departed from in the plan or instructions, risks, and what's next. byre shows it as the turn's summary at the end of the transcript. State every departure from the plan. - End every turn with a short final message for the human: what you did, anything you departed from in the plan or instructions, risks, and what's next. byre shows it as the turn's summary at the end of the transcript. State every departure from the plan.
- A turn that asks a question has no summary; put everything the human needs in the question's context. - A turn that asks a question has no summary; put everything the human needs in the question's context.
- In that final message and in ask_human context, put long supporting detail (logs, full lists, data) in collapsed sections the human expands on demand: a line <details><summary>Title</summary>, the Markdown content, then a line </details>. - In that final message and in ask_human context, put long supporting detail (logs, full lists, data) in collapsed sections the human expands on demand: a line <details><summary>Title</summary>, the Markdown content, then a line </details>.
+1 -1
View File
@@ -15,7 +15,7 @@ import (
const readyPrompt = "Your turn has ended and the review of your latest work has finished. If the task is ready to merge, call ready_for_merge with an overview of the whole task, then end your turn with one line. " + const readyPrompt = "Your turn has ended and the review of your latest work has finished. If the task is ready to merge, call ready_for_merge with an overview of the whole task, then end your turn with one line. " +
"If it isn't (work remains that you mean to do, or you're waiting on the human), don't call it: say what's left in one line and end your turn. " + "If it isn't (work remains that you mean to do, or you're waiting on the human), don't call it: say what's left in one line and end your turn. " +
"If you're waiting on the human for a decision or input, ask it with ask_human rather than in your message, so it reaches their inbox. Don't change any files this turn." "If you're waiting on the human for a decision or input, ask it with ask_human now, even if an earlier message already put it in prose, so it reaches their inbox; only an open ask_human question already counts as asked. Don't change any files this turn."
type readyArgs struct { type readyArgs struct {
Overview string `json:"overview"` Overview string `json:"overview"`
+7 -1
View File
@@ -519,7 +519,7 @@ private struct ServerChip: View {
.stroke(servers.color(origin)) .stroke(servers.color(origin))
.frame(width: 8, height: 8) .frame(width: 8, height: 8)
Text(serverName(origin)) Text(serverName(origin))
.fontWeight(current || questions > 0 ? .bold : .regular) .fontWeight(current ? .bold : .regular)
if questions > 0 { if questions > 0 {
Badge(count: questions) Badge(count: questions)
.help("open questions") .help("open questions")
@@ -541,6 +541,12 @@ private struct ServerChip: View {
.padding(.horizontal, 8) .padding(.horizontal, 8)
.padding(.vertical, 3) .padding(.vertical, 3)
.background(questions > 0 ? Palette.warnTint : current ? Palette.surface : .clear, in: RoundedRectangle(cornerRadius: 6)) .background(questions > 0 ? Palette.warnTint : current ? Palette.surface : .clear, in: RoundedRectangle(cornerRadius: 6))
.overlay(alignment: .bottom) {
Rectangle()
.fill(current ? servers.color(origin) : .clear)
.frame(height: 2)
.padding(.horizontal, 8)
}
.contentShape(Rectangle()) .contentShape(Rectangle())
} }
.buttonStyle(.plain) .buttonStyle(.plain)