Documentation
¶
Overview ¶
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
templ: version: v0.3.1001
Index ¶
- func ActiveChildFromDetail(detail json.RawMessage) *orchestrator.TaskTriageChild
- func AuthConfirm(token string) templ.Component
- func BuildCardActivityStates(cardIDs []string, activeChildren map[string]*orchestrator.TaskTriageChild, ...) map[string]CardActivityState
- func CardCommandSection(cardID string, cardStatus orchestrator.TaskStatus, options []CardCommandOption, ...) templ.Component
- func CardGoControl(tl *CardTimelineView, cardID string) templ.Component
- func CardHistoryHeadFragment(cardID string, items []timeline.CardItem) templ.Component
- func CardHistoryOlderFragment(cardID string, items []timeline.CardItem, hasMore bool, nextCursor string, ...) templ.Component
- func CardHistorySection(tl *CardTimelineView, cardID string) templ.Component
- func CardPinnedSection(tl *CardTimelineView, cardID string, cardStatus orchestrator.TaskStatus) templ.Component
- func CardTimelineItem(item timeline.CardItem, cardID string, cardStatus orchestrator.TaskStatus, ...) templ.Component
- func CommandActivityLabel(req *orchestrator.CardRequest, taskStatuses map[string]orchestrator.TaskStatus) string
- func HookReplayList(taskID, status string, hooks []orchestrator.Hook, errorMsg string) templ.Component
- func JobDetail(job *JobContextView) templ.Component
- func JobTitleLabel(job *JobContextView) templ.Component
- func Layout(title string, backURL string) templ.Component
- func Login(errorMsg string) templ.Component
- func OperationResultsSection(results []*orchestrator.OperationResult) templ.Component
- func QuestionPage(task *orchestrator.Task, turn QuestionTurn) templ.Component
- func SessionList(sessions []SessionView, projectFilter string) templ.Component
- func SessionNew(projects []*orchestrator.Project, selectedProjectID string, errorMsg string) templ.Component
- func Settings(view SettingsView) templ.Component
- func StaticCSSURL() string
- func TaskCardActionBar(task *orchestrator.Task, availableActions []string, tl *CardTimelineView) templ.Component
- func TaskChildSpecDetail(parent *orchestrator.Task, child orchestrator.TaskTriageChild, ...) templ.Component
- func TaskDetail(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, ...) templ.Component
- func TaskDetailAwaitingBanner(task *orchestrator.Task) templ.Component
- func TaskDetailCardBody(task *orchestrator.Task, availableActions []string, errorMsg string, ...) templ.Component
- func TaskDetailCardPinnedSection(tl *CardTimelineView, cardID string, cardStatus orchestrator.TaskStatus) templ.Component
- func TaskDetailCardStatusSection(task *orchestrator.Task, errorMsg string, projectName string, summary string, ...) templ.Component
- func TaskDetailCardSummary(summary string, description string) templ.Component
- func TaskDetailExecBody(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, ...) templ.Component
- func TaskDetailExecStatusSection(task *orchestrator.Task, errorMsg string, projectName string, ...) templ.Component
- func TaskDetailExecTabPanel(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, ...) templ.Component
- func TaskDetailExecTabsSection(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, ...) templ.Component
- func TaskDetailLiveScript() templ.Component
- func TaskDetailSuggestionSection(taskID string, status orchestrator.TaskStatus, ...) templ.Component
- func TaskDetailTimelineSection(task *orchestrator.Task, groups []timeline.StatusGroup, ...) templ.Component
- func TaskEditPage(task *orchestrator.Task, projects []*orchestrator.Project, errorMsg string) templ.Component
- func TaskExecActionBar(task *orchestrator.Task, availableActions []string, activeTab string) templ.Component
- func TaskIdentityLinks(identities []apiwire.TaskIdentity) templ.Component
- func TaskList(items []ListRow, filter orchestrator.TaskFilter, page int, hasMore bool, ...) templ.Component
- func TaskListActionBar() templ.Component
- func TaskListContent(items []ListRow, filter orchestrator.TaskFilter, page int, hasMore bool, ...) templ.Component
- func TaskListFragment(items []ListRow, filter orchestrator.TaskFilter, page int, hasMore bool, ...) templ.Component
- func TaskNew(projects []*orchestrator.Project, errorMsg string, form url.Values) templ.Component
- func TaskReopen(task *orchestrator.Task) templ.Component
- func TerminalNotReady(jobId string, reason string) templ.Component
- func TerminalPage(title string, backURL string, jobId string, wsPath string) templ.Component
- func TriageSummary(detail []byte) string
- func WorkActivityLabel(child *orchestrator.TaskTriageChild, ...) string
- type CardActivityState
- type CardCommandFormState
- type CardCommandOption
- type CardTimelineView
- type ChildTerminalEvent
- type ChildTreeNode
- type ForgeRow
- type JobContextView
- type ListRow
- type QuestionTurn
- type SessionView
- type SettingsView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveChildFromDetail ¶ added in v0.5.0
func ActiveChildFromDetail(detail json.RawMessage) *orchestrator.TaskTriageChild
ActiveChildFromDetail returns the first non-closed entry in a task_triage detail blob's children list — the sole open/specced/dispatched work child the card model allows at a time. Returns nil for no children, an all-closed history, or malformed detail.
func AuthConfirm ¶ added in v0.1.0
AuthConfirm is the landing page for a magic link / QR scan. The token is carried in a form and spent only when the human presses the button, so a browser preload or a link preview cannot burn the one-time pairing code before the human arrives. Plain form POST (no JS, no CSRF token) on purpose: /auth is CSRF-exempt because the pairing token IS the credential, and the page has to work in whatever in-app browser the QR scanner opened.
func BuildCardActivityStates ¶ added in v0.5.0
func BuildCardActivityStates(cardIDs []string, activeChildren map[string]*orchestrator.TaskTriageChild, taskStatuses map[string]orchestrator.TaskStatus, activeRequests map[string]*orchestrator.CardRequest) map[string]CardActivityState
BuildCardActivityStates fans out over three already-batched inputs (no DB access here) into one CardActivityState per card. taskStatuses is shared by both axes: a dispatched child's TaskRef and an attached command's task TargetID both resolve against the same map. A card with neither axis active is omitted from the result.
func CardCommandSection ¶ added in v0.5.0
func CardCommandSection(cardID string, cardStatus orchestrator.TaskStatus, options []CardCommandOption, form *CardCommandFormState) templ.Component
CardCommandSection renders the shared instruction textarea and the project's card_commands buttons, in project.yaml declaration order (options is already ordered — see api.CardCommandOptionsForProject). Renders nothing when the project declares no card_commands (options is empty) or the card is in a terminal status (cardCommandTerminalStatus).
This section is a sibling of #task-status and #task-pinned, never a child of either — see TaskDetailCardStatusSection's own doc comment (tasks.templ) for why an in-progress instruction must live outside both SSE-swapped blocks.
form is non-nil only right after a same-request Occupied response (WebHandler.PostCardCommand renders this same page directly, rather than redirecting, so the textarea keeps what the caller typed). A plain GET (or a successful launch, which redirects) always passes form == nil.
func CardGoControl ¶ added in v0.5.0
func CardGoControl(tl *CardTimelineView, cardID string) templ.Component
func CardHistoryHeadFragment ¶ added in v0.5.0
CardHistoryHeadFragment renders items as a flat list of <li>s with no Load-older control — TaskCardTimelineHead's response, for a client to splice into its own already-loaded head range.
func CardHistoryOlderFragment ¶ added in v0.5.0
func CardHistoryOlderFragment(cardID string, items []timeline.CardItem, hasMore bool, nextCursor string, priorDateKey string) templ.Component
CardHistoryOlderFragment is the "Load older" HTMX response: the next batch of items plus a fresh Load older control, or nothing once exhausted. The requesting button targets "closest li" with hx-swap "outerHTML", so this fragment replaces that whole <li>, keeping new items as flat siblings in the same <ul>.
func CardHistorySection ¶ added in v0.5.0
func CardHistorySection(tl *CardTimelineView, cardID string) templ.Component
CardHistorySection renders a card's timeline history page (newest-first, paginated, with Load older) in its own container OUTSIDE #task-status — the existing SSE script only ever refreshes #task-status wholesale, and an outerHTML replace there would discard any "Load older" pages already appended. This section is simply not one of the SSE-refreshed targets.
func CardPinnedSection ¶ added in v0.5.0
func CardPinnedSection(tl *CardTimelineView, cardID string, cardStatus orchestrator.TaskStatus) templ.Component
CardPinnedSection renders a card's currently-pinned items — the live suggestion, the next work spec/child, the sole in-progress task/session — never subject to the history page's item cap.
func CardTimelineItem ¶ added in v0.5.0
func CardTimelineItem(item timeline.CardItem, cardID string, cardStatus orchestrator.TaskStatus, pinned bool, awaitingQuestionID string) templ.Component
CardTimelineItem renders one timeline.CardItem — the single shared component pinned and historical items both use. pinned selects the full date+time stamp and (for a suggestion) the live Accept/Reject form; awaitingQuestionID is only ever non-empty for the sole pinned dispatched child that is currently awaiting an answer.
func CommandActivityLabel ¶ added in v0.5.0
func CommandActivityLabel(req *orchestrator.CardRequest, taskStatuses map[string]orchestrator.TaskStatus) string
CommandActivityLabel renders a card's single active card_requests row (orchestrator.PickActiveCardRequest) as "<label>: Queued" / "<label>: Launching" / "<label>: <running state>". A queued row has no launched_label snapshot yet, so it falls back to the raw command_key. Returns "" for a nil request or a terminal/unknown status.
func HookReplayList ¶
func JobDetail ¶
func JobDetail(job *JobContextView) templ.Component
func JobTitleLabel ¶ added in v0.5.0
func JobTitleLabel(job *JobContextView) templ.Component
JobTitleLabel can refresh independently without remounting the terminal or interrupting the rename form. Hidden labels are left alone during editing.
func Layout ¶
Layout wraps the whole page chrome. The header is a single back-button + title row: one level of history is exposed (enough for the Tasks → Task → Job chain boid actually has), and the title lives in the header instead of being duplicated by a content-area <h1>. When backURL is empty the back button is hidden (top-level pages: Tasks list, login). The back button is icon-only so the current page title gets the full remaining header width.
Top-level pages (Tasks / Sessions) show a global nav bar below the header so users can switch between the two views.
func OperationResultsSection ¶ added in v0.5.0
func OperationResultsSection(results []*orchestrator.OperationResult) templ.Component
Compatibility fragment: operation rows use the timeline's item renderer.
func QuestionPage ¶
func QuestionPage(task *orchestrator.Task, turn QuestionTurn) templ.Component
QuestionPage renders the dedicated page for a single Q&A turn:
- the agent's question (preformatted, whitespace preserved)
- when active: the answer textarea + submit / abort buttons
- when answered: the persisted answer text (read-only history)
- when neither (task aborted before answer): a short "(aborted before answer)" line
Notification deep-links from `boid task notify --ask` land here so the user goes straight to the question without scrolling through the timeline.
func SessionList ¶ added in v0.0.2
func SessionList(sessions []SessionView, projectFilter string) templ.Component
SessionList renders the /sessions page listing running taskless jobs.
func SessionNew ¶ added in v0.0.2
func SessionNew(projects []*orchestrator.Project, selectedProjectID string, errorMsg string) templ.Component
SessionNew renders the /sessions/new page. Phase 3-d PR2: project.yaml の commands: schema を廃止し、 セッション起動の唯一の 入口を harness 直選択フォームに統合した。
func Settings ¶ added in v0.1.0
func Settings(view SettingsView) templ.Component
Settings renders the /settings page: a form editor (allowed domains / gateway forges / notify command / web public URL) and a raw YAML editor, both seeded from the same GET /api/config snapshot passed in as view. Every Save button talks directly to the existing PR-1b endpoints via fetch() — see this file's top-of-file doc comment.
func StaticCSSURL ¶
func StaticCSSURL() string
StaticCSSURL returns the stylesheet URL with a cache-busting content hash. Falls back to the unversioned path if the hash could not be computed — caching will be imperfect but the page still renders.
func TaskCardActionBar ¶ added in v0.4.0
func TaskCardActionBar(task *orchestrator.Task, availableActions []string, tl *CardTimelineView) templ.Component
TaskCardActionBar renders the sticky bottom action bar for a card detail page. Card detail has no tabs (§7 罠1), so — unlike TaskExecActionBar — this always renders; there is no activeTab gate.
This is the "escape hatch" design doc §3.2 requires: every card-machine transition must stay reachable by a direct human click, independent of whatever suggestion (if any) TaskDetailCardStatusSection's movement row is showing (§3.3 item 5's role split — the suggestion's own Accept/Reject lives there, not here).
Split out of the old shared TaskActionBar (which used to carry BOTH card and execution branches behind a hasTriage bool — see git history). The branches kept here are copied verbatim (same POST targets, same hidden fields, same confirm() text) from that function's hasTriage==true paths, so PR-1's "遷移機能等価" holds. The branches NOT carried over (the hasTriage==false Reopen+Rerun variant, the plain non-menu-item exec path) never applied to a card in the first place — card machine v2 (machine_card.go) has no "abort" rule at all, and "pending"/"executing"/ "awaiting"/"aborted" are execution-only statuses a card can never reach, so the removed code paths were unreachable dead branches for a card caller both before and after this split.
func TaskChildSpecDetail ¶ added in v0.5.0
func TaskChildSpecDetail(parent *orchestrator.Task, child orchestrator.TaskTriageChild, referencedTaskMissing bool, result string, resultStatus orchestrator.TaskStatus, hasResult bool) templ.Component
func TaskDetail ¶
func TaskDetail(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, availableActions []string, errorMsg string, activeTab string, projectName string, cardSummary string, cardTL *CardTimelineView, childTree []ChildTreeNode, cmdOptions []CardCommandOption, cmdForm *CardCommandFormState, identities []apiwire.TaskIdentity, operationResults []*orchestrator.OperationResult) templ.Component
TaskDetail selects card or execution content within the same continuous detail layout. Cards additionally expose commands and card-specific activity.
func TaskDetailAwaitingBanner ¶
func TaskDetailAwaitingBanner(task *orchestrator.Task) templ.Component
TaskDetailAwaitingBanner is the call-to-action shown at the top of the timeline tab when the task is in the awaiting state. It links to the dedicated Q&A page for the current question turn so the user can answer.
Child tasks get the banner too. It used to be gated on `task.ParentID == ""`, mirroring the ask notification's own "a supervisor will notice this" assumption — but a triage card runs no agent, so its children's questions had neither a notification nor a link. QuestionPage and POST /tasks/{id}/answer never carried the restriction, so the answer was always reachable by typing the URL; only the way in was missing. Whether anyone is watching decides whether to PAGE the user (fireUserAskNotification), not whether a page the user already opened should offer the form.
func TaskDetailCardBody ¶ added in v0.4.0
func TaskDetailCardBody(task *orchestrator.Task, availableActions []string, errorMsg string, projectName string, summary string, tl *CardTimelineView, cmdOptions []CardCommandOption, cmdForm *CardCommandFormState, identities []apiwire.TaskIdentity, operationResults []*orchestrator.OperationResult) templ.Component
TaskDetailCardBody assembles a card detail page's content, top to bottom: meta followed by summary and expandable description, command input, a unified timeline, then the footer controls. No tabs — see §7 罠1.
TaskDetailLiveScript renders here, at the body level — nothing on the card layout ever gets HTMX-swapped, so there is no risk of the script node itself being removed and reinserted (the failure mode TaskExecBody's own doc comment below describes). TaskDetailExecBody mirrors this placement (also body-level, also outside anything swappable) precisely so both layouts follow the same rule: the live script is rendered once, never inside a swap target.
func TaskDetailCardPinnedSection ¶ added in v0.5.0
func TaskDetailCardPinnedSection(tl *CardTimelineView, cardID string, cardStatus orchestrator.TaskStatus) templ.Component
TaskDetailCardPinnedSection wraps CardPinnedSection in its own SSE-refreshed container (#task-pinned, fragment kind=pinned), split out of #task-status — see that function's own doc comment for why.
func TaskDetailCardStatusSection ¶ added in v0.4.0
func TaskDetailCardStatusSection(task *orchestrator.Task, errorMsg string, projectName string, summary string, identities []apiwire.TaskIdentity) templ.Component
TaskDetailCardStatusSection renders the card detail page's frameless meta strip: the identity row, a bare status badge, and the current summary. Lives inside #task-status, so it stays live-refreshed by the existing SSE script on the card's own actions (a suggestion write, a command's own terminal record, ...).
Current timeline items live in #task-pinned. The instruction form stays outside both refreshed sections so live updates preserve an unfinished draft.
id="task-status" carries data-task-id so TaskDetailLiveScript (shared by both the card and execution layouts, §7 罠2) can find the task id without depending on #tab-panel, which the card layout does not have.
func TaskDetailCardSummary ¶ added in v0.5.0
TaskDetailCardSummary combines the current summary and full description in one compact disclosure. It renders nothing when both are empty.
func TaskDetailExecBody ¶ added in v0.4.0
func TaskDetailExecBody(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, availableActions []string, errorMsg string, activeTab string, projectName string, childTree []ChildTreeNode, identities []apiwire.TaskIdentity) templ.Component
TaskDetailExecBody follows the card layout with execution-specific disclosures. The live script stays outside every refreshed section.
func TaskDetailExecStatusSection ¶ added in v0.4.0
func TaskDetailExecStatusSection(task *orchestrator.Task, errorMsg string, projectName string, childTree []ChildTreeNode, identities []apiwire.TaskIdentity) templ.Component
TaskDetailExecStatusSection is TaskDetailCardStatusSection's execution-task counterpart: identity row is "<project> / <behavior>"; the movement row shows status + elapsed while executing, or the existing awaiting banner.
func TaskDetailExecTabPanel ¶ added in v0.4.0
func TaskDetailExecTabPanel(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, activeTab string, childTree []ChildTreeNode) templ.Component
TaskDetailExecTabPanel renders the tab panel content for the given activeTab, on an execution task's detail page. id="tab-panel" is the HTMX swap target for tab switching. Card detail has no tabs (§7 罠1), so this (and the tab machinery around it) is execution-only.
(死骸掃除, docs/plans/webui-detail-list-redesign.md §7 PR-1: this used to also take a `jobs []*JobView` parameter that flowed in from TaskDetail → TaskDetailTabsSection → here without ever being read — TaskDetailJobsSection, the only thing that would have consumed it, was never called from anywhere on the page. Both are gone now, along with fragment kind=jobs (internal/api/web.go).)
TaskDetailLiveScript does NOT render here (Opus review, PR #996, B1): this whole <div id="tab-panel"> is inside #tabs, which HTMX swaps wholesale on every tab-link click — a <script> that lived in here used to get torn down and re-inserted on every switch, and the second insertion never actually re-subscribed (see TaskDetailLiveScript's own doc comment for the failure mode). The script is rendered exactly once, by TaskDetailExecBody, outside #tabs entirely.
func TaskDetailExecTabsSection ¶ added in v0.4.0
func TaskDetailExecTabsSection(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, availableActions []string, activeTab string, childTree []ChildTreeNode) templ.Component
TaskDetailExecTabsSection wraps tab-list + tab-panel + action-bar under a single #tabs node, for an execution task's detail page (card detail has no tabs — §7 罠1). HTMX tab-link clicks swap this entire section so:
- the active class on the visible tabs updates
- the "more" details element is freshly rendered (closed by default, summary label reflects the new active tab when it's a hidden one)
- the action bar primary button becomes tab-contextual without a separate swap
This is also what GET /tasks/{id} renders directly (skipping Layout) when the request carries HX-Request: true and the task is NOT a card — see WebHandler.TaskDetail's own doc comment on the HX-Request branch for why a card never takes this path.
func TaskDetailLiveScript ¶ added in v0.4.0
TaskDetailLiveScript subscribes to /api/tasks/{id}/events (SSE) and keeps #task-status / #task-pinned / #task-timeline fresh, and ticks the "MM:SS ago" elapsed text on running-job rows. Shared verbatim by both the card and execution detail layouts (docs/plans/webui-detail-list-redesign.md §7 罠2 — both layouts render the same #task-status/#task-timeline ids and the same fragment kind=status/kind=timeline endpoints, so one copy of this script works for both) rather than duplicated per layout.
kind=pinned only ever finds a #task-pinned element on a card layout — an execution page's fetch simply finds nothing to replace (refresh()'s own `if (el)` guard), the same tolerant no-op the shared kind=timeline id mismatch already relies on.
Reads the task id off #task-status's data-task-id attribute — both TaskDetailCardStatusSection and TaskDetailExecStatusSection render that — rather than #tab-panel's (execution-only; the card layout has no tab-panel at all now that card detail has no tabs).
Both callers (TaskDetailCardBody, TaskDetailExecBody) render this OUTSIDE anything HTMX ever swaps — TaskDetailExecBody renders it as a sibling of TaskDetailExecTabsSection's #tabs, not inside it (Opus review, PR #996, blocking finding B1). It used to live inside TaskDetailExecTabPanel (i.e. inside #tabs), paired with an htmx:beforeSwap teardown that closed the EventSource and removed its own listener whenever #tabs was about to be swapped (a tab-link click). That was a one-way trip: the top-of-IIFE `if (window.__boidTimelineSubscriber) return` guard is a MODULE-level flag that survives the swap, so when the freshly-swapped-in #tabs (rendered by the same TaskDetailExecTabPanel, still gated on activeTab=="timeline") re-inserted this same <script> and it ran again, the guard immediately returned before ever calling openES() again — the very first tab switch on an execution task's detail page silently killed live updates for the rest of the page's life. Rendering the script once, outside the swapped subtree, removes the reason the teardown existed in the first place: the script node itself is never removed, so there is no stale EventSource to close and no listener to re-attach — the __boidTimelineSubscriber/__boidTimelineTicker guards alone are enough to keep this idempotent across the (now impossible) case of the script somehow rendering twice.
func TaskDetailSuggestionSection ¶ added in v0.3.11
func TaskDetailSuggestionSection(taskID string, status orchestrator.TaskStatus, suggestion orchestrator.Suggestion) templ.Component
TaskDetailSuggestionSection renders task_triage.detail.suggestion (or detail.attrs.suggestion — orchestrator.DetailSuggestion) as a compact card right under the status row: verb + action, then reason and basis on their own lines. This is the only place Basis is shown (the list row's 3行目, task_list_row.templ, only has room for verb + reason). Renders nothing when there is no suggestion — every non-triage task, and any triage task khi hasn't evaluated yet.
docs/plans/ingestion-identity.md PR-3 (B-3+B-4, J-6): Accept/Reject buttons close "既に開いている穴" — 決定14 moved judgment to the Web UI, but until this PR the Web UI had no path to RECORD a reject, so khi's re-suggestion suppression (rejection_index) never actually fired for a Web UI click. Each button POSTs an `answered` action (WebHandler.PostAnswerSuggestion) carrying the CURRENTLY-shown suggestion's own verb/basis as hidden fields — the daemon records them but never validates or cross-checks them (J-7). taskID is a plain string (not *orchestrator.Task) so this function's existing unit tests (tasks_test.go) don't need a full Task fixture just to exercise the suggestion-only rendering.
status gates the Accept/Reject buttons specifically (Opus review finding #3, 2026-08-19 revisit): `answered` is only a valid transition from preExecutionStatuses (captured/triaged/parked/ready/working, machine_card.go). A triage task that carries a stale, never-answered suggestion into done/dropped/aborted (auto-done, or nobody clicked before it advanced) used to still render live-looking buttons that redirected to an opaque `no transition for action "answered" from status "done"` error on click. orchestrator.NewCardMachine().CanApplyManualAction is the single source of truth for "would answered actually be accepted from this status" — the suggestion's own text still renders either way; only the buttons hide. NewCardMachine (not machineFor's dynamic task-based selection, PR-B) is correct here specifically because this section only ever renders when suggestion.Verb != "" — a suggestion only ever exists on a task_triage sidecar row (a card) in the first place, so which machine applies is never actually ambiguous at this call site.
PR-3 (suggestion 状態遷移化 follow-up) adds a SECOND, narrower gate inside the block CanApplyManualAction("answered", status) admits: card machine v2 pins exactly one status per VERB (e.g. "complete" only fires from "working", machine_card.go's own doc comment), but CanApplyManualAction("answered", status) alone says yes for ALL FOUR card statuses regardless of the suggestion's own verb — it only asks "can the answered ACTION apply here", never "would THIS VERB actually transition from here". Before this PR, a suggestion whose verb didn't match the card's current status (e.g. a stale "complete" suggestion sitting on a card a direct park click already moved back to parked) still rendered a live-looking Accept button that 409'd on click with `no transition for action "complete" from status "parked"`. components.SuggestionInapplicable (orchestrator.StateMachine. CanApplyTransitionAction) is the single source of truth for "would this SPECIFIC verb actually apply from this SPECIFIC status" — when it says no, Accept is replaced by a plain-language explanation (components.SuggestionInapplicableReason) but Reject still renders: an inapplicable suggestion must remain dismissible, or it lingers in the queue forever with no way to clear it (this PR's own description covers why the queue predicate itself is NOT changed to hide it instead).
func TaskDetailTimelineSection ¶
func TaskDetailTimelineSection(task *orchestrator.Task, groups []timeline.StatusGroup, childTree []ChildTreeNode) templ.Component
TaskDetailTimelineSection merges status, job, action and child history on one newest-first rail. Child state and question links live in the child entries themselves. The section refreshes on parent and child SSE events.
func TaskEditPage ¶
func TaskEditPage(task *orchestrator.Task, projects []*orchestrator.Project, errorMsg string) templ.Component
TaskEditPage renders the dedicated edit form for a pending task. All four fields (title / project / description / instructions) are shown on one page; Save POSTs to /tasks/{id}/edit.
func TaskExecActionBar ¶ added in v0.4.0
func TaskExecActionBar(task *orchestrator.Task, availableActions []string, activeTab string) templ.Component
TaskExecActionBar renders the sticky bottom action bar for an execution task detail page: state-aware primary (Start/Abort/Rerun) + "⋯" kebab (duplicate / abort / delete). Only shown on the Timeline tab — the other tabs (Description/Payload/Instructions) carry no action-bar-relevant state.
The card-only branches TaskCardActionBar now owns (the Reopen-without-Rerun variant, the working/park/drop/status-gated-done menu items) are gone from here: machine_execution.go's rule table never grants "working"/"park"/"drop" as an available action for an execution task, and "parked" is a status only a card ever reaches, so those branches rendered nothing for an execution task before this split either — removing them changes no execution task's rendered output (PR-1's "遷移機能等価").
func TaskIdentityLinks ¶ added in v0.5.0
func TaskIdentityLinks(identities []apiwire.TaskIdentity) templ.Component
func TaskList ¶
func TaskList(items []ListRow, filter orchestrator.TaskFilter, page int, hasMore bool, projects []*orchestrator.Project, workspaces []*orchestrator.WorkspaceSummary, currentURL string) templ.Component
func TaskListActionBar ¶
TaskListActionBar renders the sticky bottom bar for the task list page. The only action is "Create" — positioned on the left to mirror the detail page's primary-action layout so the mental model of "bottom-left = primary forward action" stays consistent across pages.
func TaskListContent ¶
func TaskListContent(items []ListRow, filter orchestrator.TaskFilter, page int, hasMore bool, projects []*orchestrator.Project, workspaces []*orchestrator.WorkspaceSummary, currentURL string) templ.Component
TaskListContent renders the inner content (filter form + task list) for HTMX partial swaps.
func TaskListFragment ¶
func TaskListFragment(items []ListRow, filter orchestrator.TaskFilter, page int, hasMore bool, currentURL string) templ.Component
TaskListFragment renders only the task list container (for HTMX partial responses). currentURL is embedded as the polling target so filter params are preserved across polls. page/hasMore drive the pagination nav (§3.5): page is the current 1-indexed page, hasMore reports whether WebHandler.TaskList found more rows past this page's LIMIT (it fetches pageSize+1 to answer this without a second COUNT query — see web.go's own doc comment).
func TaskReopen ¶
func TaskReopen(task *orchestrator.Task) templ.Component
TaskReopen renders the reopen form for a done/aborted/dropped task. Submitting the form calls POST /tasks/{id}/reopen with an optional message that is appended to the task's instruction history. The resulting status depends on which machine governs the task (internal/api's machineFor): an ordinary done/aborted task goes back to executing; a done/dropped CARD (card machine v2, docs/plans/suggestion-as-state-transition.md §3.2) goes back to parked instead — a card never re-executes as a job.
func TerminalNotReady ¶
TerminalNotReady renders an error page when a job is not running.
func TerminalPage ¶
TerminalPage renders the full-screen PTY terminal for an interactive running job. title should be built from jobPageTitle (e.g. "[main] claude-code"). jobId is the job UUID; wsPath is /api/jobs/{id}/attach/ws.
func TriageSummary ¶ added in v0.5.0
TriageSummary extracts the "summary" string from a task_triage detail JSON blob (docs/plans/cross-project-issue-triage.md データモデル節), preferring the top-level key and falling back to detail.attrs.summary — the daemon's attrs_set action folds a workspace's write into detail.attrs (orchestrator.FoldDetailAttrs), so that is the shape actually exercised in practice. Moved here verbatim from the pre-PR-4 internal/api/tree.go (BuildQueueItems' own helper of the same name) — the source blob and fallback rule are unchanged, only the caller (list-row Summary, not a queue-only view) is new.
Each candidate is decoded independently so a malformed or wrong-shaped value in one location cannot blank out a well-formed value in the other. Returns "" on any parse failure or when the field is absent — never panics, never partially-fabricates a value.
func WorkActivityLabel ¶ added in v0.5.0
func WorkActivityLabel(child *orchestrator.TaskTriageChild, statuses map[string]orchestrator.TaskStatus) string
WorkActivityLabel renders the work-child vocabulary: "Draft" (open, spec incomplete), "Ready to run" (specced, not yet dispatched), or —once dispatched— "Queued"/"Running"/"Needs input" keyed off the child's OWN task row's real status via statuses (never inferred from the JSON "dispatched" status alone). Returns "" for no active child, or a dispatched child whose real task is missing or already terminal.
Types ¶
type CardActivityState ¶ added in v0.5.0
CardActivityState is one card row's two independent activity axes, both possibly empty: WorkLabel from the card's sole open/specced/dispatched child, CommandLabel from its single active card command. A card can show either, neither, or both at once (a card command and a specced-but-not-yet -Go'd child can coexist).
type CardCommandFormState ¶ added in v0.5.0
type CardCommandFormState struct {
Occupied bool
Instruction string
// TargetKind/TargetID: the occupying continuation's real task id, set
// only when a followable one exists — empty means no link (see
// RunCardCommandResult's own doc comment, internal/api, on when this
// happens). A dead-end link rendered from an empty target must never
// happen.
TargetKind string
TargetID string
}
CardCommandFormState carries a failed command form's state back into the same render so its instruction remains available for correction or retry. Occupied adds the currently competing operation when one can be linked.
type CardCommandOption ¶ added in v0.5.0
CardCommandOption is one project.yaml card_commands entry rendered as a button — the Web UI's own display copy of api.CardCommandOption (this package cannot import internal/api).
type CardTimelineView ¶ added in v0.5.0
type CardTimelineView struct {
Activity CardActivityState
Pinned []timeline.CardItem
History []timeline.CardItem
HasMore bool
NextCursor string
AwaitingQuestionID string
}
CardTimelineView is a card detail page's rendering-ready timeline state: CardPinnedItems' result plus one BuildCardTimeline page, with child project ids resolved to display names and the one extra live fact (a pinned dispatched child's awaiting-question link) neither read model resolves on its own.
type ChildTerminalEvent ¶ added in v0.5.0
type ChildTerminalEvent struct {
Status orchestrator.TaskStatus
Time time.Time
HasTime bool
}
ChildTerminalEvent snapshots one actual terminal transition. Keeping the transition status here prevents a later reopen from rewriting history.
type ChildTreeNode ¶ added in v0.4.0
type ChildTreeNode struct {
Task *orchestrator.Task
QuestionID string
CreatedAt time.Time
HasCreatedAt bool
TerminalEvents []ChildTerminalEvent
}
ChildTreeNode is one direct child on an execution detail page.
type ForgeRow ¶ added in v0.1.0
ForgeRow is one gateway.forges.<id> entry as shown in the form-editor table.
type JobContextView ¶
type JobContextView struct {
ID string
TaskID string
ProjectID string
TaskTitle string
HandlerID string
RenameValue string // explicit fallback name used when no terminal title is available
DisplayName string // optional; preferred over HandlerID when non-empty (hook job's `name`)
Role string
HookID string // set when job is a hook job; used for hook replay form
Status string
ExitCode int
Interactive bool // true = PTY output contains ANSI redraw sequences; don't live-follow
CreatedAt time.Time
UpdatedAt time.Time
Output string
}
type ListRow ¶ added in v0.4.0
type ListRow struct {
Task *orchestrator.Task
ProjectName string
// Suggestion is task_triage.detail.suggestion (or detail.attrs.
// suggestion — orchestrator.DetailSuggestion), populated from the same
// batch triage lookup (WebHandler.triageByTaskID) the pre-PR-4 queue/
// Parked views used (ListTaskTriageByTaskIDs). Zero value when the task
// has no triage row, or no suggestion is attached — every execution
// task, and any card khi hasn't evaluated yet.
Suggestion orchestrator.Suggestion
// Summary is task_triage.detail.summary (or detail.attrs.summary —
// TriageSummary below), the 3行目 fallback text for a card with NO live
// suggestion (§5 論点6's card-side candidate: "無い行の有力候補は card =
// khi の summary attr" — left as an explicit open question by the design
// doc, decided here for PR-4 rather than shipping a blank 3行目 whenever
// a card has nothing pending). Zero value when the task has no triage
// row, no summary was ever written, or the task is an execution task
// (Summary is card-only vocabulary).
Summary string
// Activity is separate from the card's workflow status and suggestion.
Activity orchestrator.CardExecutionState
}
ListRow is one row of the flat, root-only task list. Card activity is a batched projection of shared execution-slot occupancy and descendant asks.
func BuildListRows ¶ added in v0.4.0
func BuildListRows(tasks []*orchestrator.Task, projectNames map[string]string, triageByTaskID map[string]*orchestrator.CardAttrs, activityByTaskID map[string]orchestrator.CardExecutionState) []ListRow
BuildListRows attaches each task's resolved project name and (for a card) its live suggestion — the two per-row enrichments the list template needs alongside the caller-resolved execution state. Input order is preserved: store.go's ListTasks already applies the view's ORDER BY (updated_at DESC, id — unified across every view by this same PR), so this must not re-sort.
Replaces internal/api's BuildTreeItems / BuildTreeItemsWithSuggestions / BuildQueueItems / BuildFlatItems (deleted by PR-4 alongside components.TreeItem — the four builders existed to serve four different tabs with four different shapes; one flat view needs exactly one builder).
func (ListRow) ProjectLabel ¶ added in v0.4.0
ProjectLabel returns the resolved project name when available, falling back to the raw project ID — same fallback convention as detailProjectLabel (tasks.templ) and the deleted components.TreeItem.
type QuestionTurn ¶
type QuestionTurn struct {
QuestionID string
Question string
Answer string
IsActive bool
WasAborted bool
}
QuestionTurn is the data needed to render a single Q&A turn: the question text, the user's answer (empty when not yet answered), and whether this turn is the active awaiting turn (form vs read-only).
type SessionView ¶ added in v0.0.2
type SessionView struct {
ID string
ProjectID string
ProjectName string
HandlerID string
DisplayName string
CreatedAt time.Time
}
SessionView is a running taskless job displayed in the sessions list.
type SettingsView ¶ added in v0.1.0
type SettingsView struct {
// Revision is the ETag GET /api/config returned — embedded verbatim as
// a data attribute so the page's own JS can round-trip it into the YAML
// tab's first POST /api/config's If-Match header, exactly like `boid
// config edit` does (cmd/config.go's runConfigEdit).
Revision string
// YAML is the full config.yaml document, byte-for-byte, as GET
// /api/config returned it — the raw-edit tab's initial textarea
// content.
YAML string
AllowedDomains []string
Forges []ForgeRow
// ForgeKindOptions is config.Schema's "gateway.forges.*.forge" enum
// (github/bitbucket today) — read from the schema rather than
// hard-coded here, so this dropdown never silently drifts out of sync
// with what POST /api/config/mutate will actually accept.
ForgeKindOptions []string
// NotifyCommand is notify.command's argv, one element per row (MAJOR 2,
// codex review round 1: a single space-joined text input was lossy for
// any argument containing an embedded space — e.g. ["sh", "-c", "echo
// hello"] round-tripped through split(/\s+/) as ["sh", "-c", "echo",
// "hello"], silently changing command semantics on any edit). Mirrors
// AllowedDomains' one-input-per-element list pattern instead. Saved
// back as a mutate `set` whose Value is exactly this list
// (config.KindStringArray's multi-arg shape, the same one `boid config
// set notify.command <arg>...` uses) — never joined or split.
NotifyCommand []string
WebPublicURL string
}
SettingsView is everything the /settings page needs to render both its form editor and its raw-YAML tab from a single GET /api/config snapshot (internal/api/web_settings.go's buildSettingsView).
Source Files
¶
- assets.go
- auth_confirm_templ.go
- card_timeline_templ.go
- exec_timeline.go
- hook_replay_templ.go
- jobs_templ.go
- layout_templ.go
- list_activity.go
- login_templ.go
- markdown.go
- question_page_templ.go
- sessions_templ.go
- settings_templ.go
- task_form_templ.go
- task_list_row_templ.go
- task_reopen_templ.go
- tasks_templ.go
- terminal_page_templ.go