templates

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 22 Imported by: 0

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthConfirm added in v0.1.0

func AuthConfirm(token string) templ.Component

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 HookReplayList

func HookReplayList(taskID, status string, hooks []orchestrator.Hook, errorMsg string) templ.Component

func JobDetail

func JobDetail(job *JobContextView) templ.Component

func Layout

func Layout(title string, backURL string) templ.Component

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 Login

func Login(errorMsg string) templ.Component

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) 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-Shape/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 TaskDetail

func TaskDetail(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, availableActions []string, errorMsg string, activeTab string, projectName string, children []ChildRow, suggestion orchestrator.Suggestion, childTree []ChildTreeNode) templ.Component

TaskDetail is the task detail page's single entry point — one URL (/tasks/{id}) for both entities, layout selected by task.Type (the same axis machineFor uses, docs/plans/webui-detail-list-redesign.md §7 PR-1): a card gets TaskDetailCardBody ("判断の場" — movement + children + body text are the main content, history is secondary), anything else gets TaskDetailExecBody ("プロセスの観測窓" — timeline stays the main content, via the existing tab structure).

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, timelineGroups []timeline.StatusGroup, availableActions []string, errorMsg string, projectName string, children []ChildRow, suggestion orchestrator.Suggestion) templ.Component

TaskDetailCardBody assembles a card detail page's content (§3.3): meta (identity + movement + suggestion + children, item 1/2), Description in the body (item 3), timeline (item 4, full — no default-collapse-to-N yet, left to a later PR per the design doc's own "実装時に調整"), then the escape-hatch action bar (item 5). 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 TaskDetailCardDescription added in v0.4.0

func TaskDetailCardDescription(task *orchestrator.Task) templ.Component

TaskDetailCardDescription renders a card's Description directly in the page body (§3.3 item 3 — "本文" — decided: not a tab, unlike an execution task's Description). Renders nothing when Description is empty, same posture as TaskDetailChildrenSection/TaskDetailSuggestionSection next to it on the page.

func TaskDetailCardStatusSection added in v0.4.0

func TaskDetailCardStatusSection(task *orchestrator.Task, errorMsg string, projectName string, children []ChildRow, suggestion orchestrator.Suggestion) templ.Component

TaskDetailCardStatusSection renders the card detail page's frameless meta strip: the identity row (素性の段, §3.1) followed by the movement row (動きの段) — a bare status badge, or the transition edge "parked —go→ working" when a suggestion is live. The suggestion's own Accept/Reject UI is folded in right here (via TaskDetailSuggestionSection) rather than living in the bottom action bar — §3.3 item 5's role split: approving a suggestion means applying the transition the movement row is already showing, so the affordance belongs next to what it acts on. The action bar (TaskCardActionBar) stays reserved for direct, suggestion- independent operator moves — the escape hatch design doc §3.2 requires.

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 TaskDetailChildrenSection added in v0.3.6

func TaskDetailChildrenSection(rows []ChildRow) templ.Component

TaskDetailChildrenSection lists a triage card's children — the spec ledger merged with live status (ChildRow, above) — right under the status row, so the questions a reader has before pressing Go, or before deciding whether this card even needs attention right now, are answerable from the card itself:

  1. "is this card actually dispatch-ready" — nose hit this blind after the Shape launcher's first real dispatch: no child had been specced yet, and the Web UI gave no signal (cross-project-issue-triage 実地テスト, 2026-08-14). The status badge (+ "no spec yet") answers it.
  2. "what will actually happen" — the 2026-08-14 version stopped at title+status, so a card with two specced children (a Bitbucket reply task and a leftover verification stub) looked identical to one with two real ones (2026-08-21). The behavior badge, project, and the collapsed spec body answer it.
  3. "did a dispatched child ask me something" (§7 PR-2 — closes §2.4's "子が 4回 ask を上げたが親からは dispatched にしか見えなかった" gap): a dispatched child whose live status is awaiting gets a ⚠ link straight to /tasks/{child}/questions/{qid}, one tap from the parent card.

Project is shown as a NAME: the stored value is a project id (WebHandler.triageChildrenForDisplay resolves it), which on its own tells the reader nothing about where the child would run.

spec 折り畳みの中身は description のみ — instruction は毎回テンプレで冗長な ため出さない (2026-08-25 nose, §3.3 item 2; the pre-PR-2 version of this section rendered both).

Renders nothing for the (overwhelming majority of) tasks with no children.

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) templ.Component

TaskDetailExecBody assembles an execution task detail page's content (§3.4 item 1 — meta; item 2 — root child tree, §7 PR-2; items 3-5 — the existing tab structure is kept as-is).

TaskDetailLiveScript renders here, as a sibling AFTER TaskDetailExecTabsSection — deliberately outside the #tabs node HTMX swaps on every tab-link click (Opus review, PR #996, blocking finding B1). It used to render inside TaskDetailExecTabPanel (inside #tabs) with an htmx:beforeSwap teardown that closed the EventSource whenever #tabs was about to be swapped; the very first tab click tore the connection down and the script's own top-of-IIFE re-entry guard then silently prevented the freshly-swapped-in copy from ever reopening it — SSE updates died permanently after one tab switch. Rendering it once here means #tabs can swap as much as it wants; the script node itself is never touched.

func TaskDetailExecChildTreeSection added in v0.4.0

func TaskDetailExecChildTreeSection(nodes []ChildTreeNode) templ.Component

TaskDetailExecChildTreeSection renders a root execution task's full descendant subtree (§3.4 item 2): one flat, depth-first list, indented by ChildTreeNode.Depth. Deliberately NOT built from the list page's own row/query machinery (BuildListRows/ListTasks, or the pre-PR-4 tree these replaced — task_tree.templ/BuildTreeItems, both deleted by PR-4) — this is its own small component over WebHandler.execChildTree's app-side, non-CTE traversal.

Renders nothing for a non-root task (its own children, if any, are shown on ITS OWN detail page instead — §3.4's "root のみ") or a root task with no children — the overwhelming majority of execution tasks.

func TaskDetailExecStatusSection added in v0.4.0

func TaskDetailExecStatusSection(task *orchestrator.Task, errorMsg string, projectName string, childTree []ChildTreeNode) 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 (moved here from TaskDetailTimelineSection — see that function's own doc comment — so it surfaces immediately instead of only inside the Timeline tab). childTree renders right below the movement row (§3.4 item 2, §7 PR-2) — WebHandler.execChildTree only ever populates it for a root task (parent_id == ""), so it is silently empty (renders nothing, TaskDetailExecChildTreeSection's own guard) for every non-root execution task, i.e. the overwhelming majority of callers.

func TaskDetailExecTabPanel added in v0.4.0

func TaskDetailExecTabPanel(task *orchestrator.Task, timelineGroups []timeline.StatusGroup, activeTab string) 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) 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

func TaskDetailLiveScript() templ.Component

TaskDetailLiveScript subscribes to /api/tasks/{id}/events (SSE) and keeps #task-status / #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.

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. "done" 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 "done" 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 "done" 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) templ.Component

TaskDetailTimelineSection renders the action-and-job history grouped by status visit. The grouping, sort, and label text are built by internal/timeline so the TUI and Web UI render the same structure. Shared verbatim by both the card and execution detail layouts (§7 罠2 — same #task-timeline id, same fragment kind=timeline in both).

The awaiting call-to-action (TaskDetailAwaitingBanner) used to render at the top of this section; it moved to TaskDetailExecStatusSection's movement row (§3.1 部品A — exec's movement row is "状態+経過/awaitingバナー") so it surfaces immediately instead of only once the reader is already inside the (execution-only) Timeline tab, and so it does not render twice when Timeline is the default active tab.

Layout: one continuous left rail across the whole timeline; each row (status header + events) sits on the rail with its own marker (○ for status header, ● for jobs with status color, ◆ for state-transition actions). Times right-align in a shared column, and the status header uses the same HH:MM:SS format as events so the eye finds them without re-parsing per row.

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 (Shape, 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 TaskList

func TaskList(items []ListRow, filter orchestrator.TaskFilter, page int, hasMore bool, projects []*orchestrator.Project, workspaces []*orchestrator.WorkspaceSummary, currentURL string) templ.Component

func TaskListActionBar

func TaskListActionBar() templ.Component

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 TaskNew

func TaskNew(projects []*orchestrator.Project, errorMsg string, form url.Values) templ.Component

TaskNew renders the minimal task-creation form. Only the fields a human realistically touches when creating a task from the Web UI are shown (title / project / behavior / description / auto-start). Per-task overrides for worktree / readonly / base_branch / branch_prefix have been removed: those are now derived from the canonical behavior name (supervisor / executor) combined with the project-top `worktree:` / `base_branch:` fields in project.yaml. The back arrow in the header acts as cancel, so no separate cancel button is needed.

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

func TerminalNotReady(jobId string, reason string) templ.Component

TerminalNotReady renders an error page when a job is not running.

func TerminalPage

func TerminalPage(title string, backURL string, jobId string, wsPath string) templ.Component

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.

Types

type ChildRow added in v0.4.0

type ChildRow struct {
	Child orchestrator.TaskTriageChild
	// LiveStatus is the dispatched child's live orchestrator.TaskStatus
	// value, or "" when Child.Status isn't "dispatched" or the live lookup
	// didn't resolve (no TaskRef, vanished task, etc — 論点8's "突き合わせ
	// 不能なら台帳のみ").
	LiveStatus string
	// AwaitingQuestionID is the qid to link to when LiveStatus == "awaiting"
	// and the child's own payload carries an unanswered question
	// (orchestrator.GetAwaitingPayload) — "" otherwise, including when
	// LiveStatus == "awaiting" but no question id was found.
	AwaitingQuestionID string
}

ChildRow merges one entry of a card's spec ledger (task_triage.detail.children, orchestrator.TaskTriageChild) with the live status of its dispatched task row (docs/plans/webui-detail-list-redesign.md §3.3 item 2 / §7 PR-2). WebHandler.cardChildrenFromTriage builds these — see that function's doc comment for how LiveStatus/AwaitingQuestionID get populated and the 論点8 edge-case rules (matching ledger vs. live status, unreachable TaskRef) that govern it.

func (ChildRow) DisplayStatus added in v0.4.0

func (r ChildRow) DisplayStatus() string

DisplayStatus is ChildRow's single chip value (§3.3 item 2: "1子=1行、 現在地のチップ1個") — the live task status when it resolved, the ledger status otherwise. Both the chip rendered below and WebHandler.childRowRank's sort read this one method, so the two can never disagree about which status governs a row.

type ChildTreeNode added in v0.4.0

type ChildTreeNode struct {
	Task  *orchestrator.Task
	Depth int
}

ChildTreeNode is one node of a root execution task's descendant subtree (docs/plans/webui-detail-list-redesign.md §3.4 item 2 / §7 PR-2). WebHandler.execChildTree walks the tree depth-first and flattens it into this slice — Depth (1 for a direct child, 2 for a grandchild, …) is what TaskDetailExecChildTreeSection indents by, so a multi-level supervisor tree renders without needing a nested Go slice-of-slices shape.

type ForgeRow added in v0.1.0

type ForgeRow struct {
	ID        string
	Host      string
	Forge     string
	SecretKey string
}

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
	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
}

ListRow is one row of the flat, top-level-only task list (docs/plans/ webui-detail-list-redesign.md §3.5, PR-4). It replaces components.TreeItem (task_tree.templ, BuildTreeItems family — both deleted by this PR): the list no longer needs tree-shape fields (Depth/ HasChildren/ParentID) now that tabs AND the tree are both gone — the list only ever shows root (parent_id-less) tasks (WebHandler.TaskList filters ParentID == ""), and a card's own children are read from the task's own aggregate child-count columns (orchestrator.Task.{Total,Done,Aborted, Open,Awaiting}ChildCount, store.go's taskChildCountCols) rather than a second recursive query the way the old tree needed.

func BuildListRows added in v0.4.0

func BuildListRows(tasks []*orchestrator.Task, projectNames map[string]string, triageByTaskID map[string]*orchestrator.CardAttrs) []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 beyond what orchestrator.Task itself already carries via its own child-count columns. Input order is preserved untouched: 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

func (r ListRow) ProjectLabel() string

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).

Directories

Path Synopsis
templ: version: v0.3.1001
templ: version: v0.3.1001

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL