Merge branch 'main' into web-run-polish
This commit is contained in:
+22
-15
@@ -43,7 +43,7 @@ export function createAttentionView(rt) {
|
||||
|
||||
|
||||
/**
|
||||
* The attention bell action, shown in the top bar on every view (R15). Its
|
||||
* The attention bell action, shown in the Runs list heading (R15). Its
|
||||
* accessible name comes from `attentionBadgeLabel`; the visible badge is drawn
|
||||
* only when something genuinely needs the operator, and the count comes from the
|
||||
* same pure model the sheet reads.
|
||||
@@ -83,22 +83,29 @@ function attentionCount() {
|
||||
* loads, without rebuilding the header and disturbing the URL field.
|
||||
*/
|
||||
function refreshAttentionBell() {
|
||||
const button = document.querySelector("#attentionBell");
|
||||
if (!button) return;
|
||||
const count = attentionCount();
|
||||
const label = attentionBadgeLabel(count);
|
||||
button.setAttribute("aria-label", label);
|
||||
button.title = label;
|
||||
let badge = button.querySelector(".attention-badge");
|
||||
if (count > 0) {
|
||||
if (!badge) {
|
||||
badge = h("span", { class: "attention-badge", "aria-hidden": "true" });
|
||||
button.append(badge);
|
||||
const button = document.querySelector("#attentionBell");
|
||||
if (button) {
|
||||
button.setAttribute("aria-label", label);
|
||||
button.title = label;
|
||||
let badge = button.querySelector(".attention-badge");
|
||||
if (count > 0) {
|
||||
if (!badge) {
|
||||
badge = h("span", { class: "attention-badge", "aria-hidden": "true" });
|
||||
button.append(badge);
|
||||
}
|
||||
badge.dataset.count = String(count);
|
||||
badge.textContent = String(count);
|
||||
} else if (badge) {
|
||||
badge.remove();
|
||||
}
|
||||
badge.dataset.count = String(count);
|
||||
badge.textContent = String(count);
|
||||
} else if (badge) {
|
||||
badge.remove();
|
||||
}
|
||||
// The Runs destination mirrors the same count, so an operator on any surface
|
||||
// can see that something needs attention without first opening Runs.
|
||||
for (const destinationBadge of document.querySelectorAll("[data-attention-badge]")) {
|
||||
destinationBadge.hidden = count <= 0;
|
||||
destinationBadge.textContent = count > 0 ? String(count) : "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +113,7 @@ function refreshAttentionBell() {
|
||||
|
||||
/**
|
||||
* The attention sheet: the ordered list from the pure `attentionEntries` model,
|
||||
* opened from the bell in the top bar. It is a single managed dialog — Escape,
|
||||
* opened from the bell in the Runs heading. It is a single managed dialog — Escape,
|
||||
* a backdrop click and the Close button all close it — with the exact app
|
||||
* wording: title `Needs you`, rows of status icon + the run label + the
|
||||
* `{pipeline} · {detail}` line + a trailing `Dismiss`, and the empty state
|
||||
|
||||
+20
-6
@@ -258,6 +258,7 @@ export function createChatView(rt) {
|
||||
let chatClock = null;
|
||||
let chatNow = Date.now();
|
||||
const renderContent = (...args) => rt.renderContent(...args);
|
||||
const focusDetailHeading = (...args) => rt.focusDetailHeading(...args);
|
||||
const renderActionFailedDialog = (...args) => rt.views.dialogs.renderActionFailedDialog(...args);
|
||||
|
||||
/** Remember one conversation's scroll position (index of the first visible row). */
|
||||
@@ -406,6 +407,7 @@ function startNewChat() {
|
||||
state.chatCreate = newChatCreateState(newChatOperationId());
|
||||
state.chatDirectoriesError = "";
|
||||
renderContent();
|
||||
focusDetailHeading();
|
||||
loadChatDirectories();
|
||||
}
|
||||
|
||||
@@ -504,6 +506,7 @@ async function openChatSession(id) {
|
||||
error: "",
|
||||
});
|
||||
renderContent();
|
||||
focusDetailHeading();
|
||||
// Attach the shared live stream once per session per connection; its failure is
|
||||
// non-fatal — history stays usable and the badge reads "not live".
|
||||
subscribeChatSession(id);
|
||||
@@ -511,6 +514,9 @@ async function openChatSession(id) {
|
||||
// only after the next pushed shell frame.
|
||||
loadChatShells(id);
|
||||
await loadChatHistory(id);
|
||||
// The history load repaints the pane; keep the row activation's focus contract
|
||||
// true after it lands, not only for the loading paint.
|
||||
focusDetailHeading();
|
||||
}
|
||||
|
||||
/** Replace one conversation's fields, keeping every other field intact. */
|
||||
@@ -1443,7 +1449,7 @@ function renderChatList() {
|
||||
}),
|
||||
);
|
||||
list.append(toolbar);
|
||||
const rows = h("div", { id: "chatRows", class: "chat-rows" });
|
||||
const rows = h("div", { id: "chatRows", class: "chat-rows list-scroll" });
|
||||
fillChatRows(rows);
|
||||
list.append(rows);
|
||||
return list;
|
||||
@@ -1620,7 +1626,13 @@ function renderChatCreate() {
|
||||
},
|
||||
h("span", { class: "chat-create-back-glyph", "aria-hidden": "true", text: "←" }),
|
||||
),
|
||||
h("h2", { class: "chat-bar-title chat-create-title", text: CHAT_CREATE_TITLE }),
|
||||
// The create pane is a chat detail too: its title is the route's h1.
|
||||
h("h1", {
|
||||
class: "chat-bar-title chat-create-title",
|
||||
id: "detailTitle",
|
||||
tabindex: "-1",
|
||||
text: CHAT_CREATE_TITLE,
|
||||
}),
|
||||
);
|
||||
pane.append(bar);
|
||||
|
||||
@@ -1799,14 +1811,16 @@ function renderChatConversation() {
|
||||
const thread = state.chatThreads.get(state.chatActiveId) ?? null;
|
||||
const title = effective ? sessionTitle(effective) : state.chatActiveId.slice(0, 18);
|
||||
// The pending approval card (C10), derived from the stored frame plus the local
|
||||
// answer. While it is actionable the top bar offers a jump control and the
|
||||
// answer. While it is actionable the chat pane offers a jump control and the
|
||||
// running indicator stands down (a turn blocked on a decision is not generating).
|
||||
const approval = approvalCard(thread?.permission, thread?.permissionAnswer);
|
||||
const awaiting = approval?.actionable === true;
|
||||
|
||||
const bar = h("div", { class: "chat-bar" });
|
||||
const titles = h("div", { class: "chat-bar-titles" });
|
||||
titles.append(h("h2", { class: "chat-bar-title", text: title }));
|
||||
// The open conversation is the route's one h1; the list heading above becomes
|
||||
// its h2 while the detail is open.
|
||||
titles.append(h("h1", { class: "chat-bar-title", id: "detailTitle", tabindex: "-1", text: title }));
|
||||
const meta = chatHeaderMeta({
|
||||
model: session?.model,
|
||||
tag: session?.tag,
|
||||
@@ -2151,7 +2165,7 @@ function renderChatTranscript(
|
||||
// deliberately unlike a message bubble (see ChatCommandNoticeItem).
|
||||
for (const notice of notices) transcript.append(renderChatCommandNotice(sessionId, notice));
|
||||
// The approval card is the transcript's last item (C10) — after the notices and
|
||||
// after the running indicator when it is shown — so the top bar's jump control
|
||||
// after the running indicator when it is shown — so the pane's jump control
|
||||
// and a fresh card both land at the end.
|
||||
if (approval) transcript.append(renderChatApproval(sessionId, approval));
|
||||
wrap.append(transcript);
|
||||
@@ -2173,7 +2187,7 @@ function renderChatTranscript(
|
||||
return wrap;
|
||||
}
|
||||
|
||||
/** The top bar's approval jump control (C10), naming the pending request. */
|
||||
/** The chat pane's approval jump control (C10), naming the pending request. */
|
||||
function approvalJumpButton() {
|
||||
return h("button", {
|
||||
class: "ghost chat-approval-jump",
|
||||
|
||||
@@ -35,7 +35,7 @@ export function createPipelinesView(rt) {
|
||||
function renderPipelineList() {
|
||||
const list = h("div", { class: "list" });
|
||||
list.append(renderPipelineControls());
|
||||
const rows = h("div", { id: "pipelineRows" });
|
||||
const rows = h("div", { id: "pipelineRows", class: "list-scroll" });
|
||||
fillPipelineRows(rows);
|
||||
list.append(rows);
|
||||
return list;
|
||||
@@ -259,7 +259,11 @@ function renderPipelineRow(pipeline, latestRuns, runsKnown, now) {
|
||||
}
|
||||
return h(
|
||||
"button",
|
||||
{ class: `row${state.selectedPipelineId === pipeline.id ? " selected" : ""}`, onclick: () => selectPipeline(pipeline) },
|
||||
{
|
||||
class: `row${state.selectedPipelineId === pipeline.id ? " selected" : ""}`,
|
||||
"data-pipeline-id": String(pipeline.id),
|
||||
onclick: () => selectPipeline(pipeline),
|
||||
},
|
||||
...children,
|
||||
);
|
||||
}
|
||||
@@ -271,23 +275,7 @@ function renderPipelineDetail() {
|
||||
pane.append(h("div", { class: "muted pad", text: "Select a pipeline." }));
|
||||
return pane;
|
||||
}
|
||||
pane.append(h("h2", { text: d.name || `pipeline ${d.id}` }));
|
||||
pane.append(
|
||||
h(
|
||||
"div",
|
||||
{ class: "detail-tabs" },
|
||||
...PIPELINE_DETAIL_TABS.map((tab) =>
|
||||
h("button", {
|
||||
class: `detail-tab${state.pipelineTab === tab.key ? " active" : ""}`,
|
||||
text: tab.label,
|
||||
onclick: () => {
|
||||
state.pipelineTab = tab.key;
|
||||
renderContent();
|
||||
},
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
pane.append(h("h1", { class: "detail-title", id: "detailTitle", tabindex: "-1", text: d.name || `pipeline ${d.id}` }));
|
||||
if (state.pipelineTab === "graph") {
|
||||
pane.append(h("p", { class: "graph-note muted", text: graphNote() }));
|
||||
const stages = d.graph?.stages ?? [];
|
||||
|
||||
@@ -123,24 +123,16 @@ function renderRunDetail(now = Date.now()) {
|
||||
// the Android run detail does, so opening the run is enough — no tab hunt.
|
||||
const decision = pendingDecision(d);
|
||||
if (decision) pane.append(renderDecisionCard(decision));
|
||||
pane.append(
|
||||
h("h1", {
|
||||
class: "run-detail-title",
|
||||
id: "detailTitle",
|
||||
tabindex: "-1",
|
||||
text: runLabelFor(d),
|
||||
}),
|
||||
);
|
||||
const actions = renderRunActions(d);
|
||||
if (actions) pane.append(actions);
|
||||
pane.append(
|
||||
h(
|
||||
"div",
|
||||
{ class: "detail-tabs" },
|
||||
...RENDERED_RUN_TABS.map((tab) =>
|
||||
h("button", {
|
||||
class: `detail-tab${state.runTab === tab.key ? " active" : ""}`,
|
||||
text: tab.label,
|
||||
onclick: () => {
|
||||
state.runTab = tab.key;
|
||||
renderContent();
|
||||
},
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
if (state.runTab === "graph") {
|
||||
pane.append(renderRunGraphTab(d));
|
||||
} else if (state.runTab === "input") {
|
||||
@@ -702,7 +694,6 @@ function renderRunActions(d) {
|
||||
|
||||
function renderRunTitleRow(d) {
|
||||
const row = h("div", { class: "run-title-row" });
|
||||
row.append(h("h2", { class: "run-detail-title", text: runLabelFor(d) }));
|
||||
if (state.renameValue == null) {
|
||||
row.append(
|
||||
h("button", {
|
||||
|
||||
@@ -35,7 +35,7 @@ function renderRunList(now = Date.now()) {
|
||||
const pane = h("div", { class: "list runs" });
|
||||
pane.append(renderRunToolbar());
|
||||
|
||||
const scroll = h("div", { class: "run-scroll" });
|
||||
const scroll = h("div", { class: "run-scroll list-scroll" });
|
||||
if (state.loading && !state.runs.length) {
|
||||
scroll.append(h("div", { class: "muted pad", text: "Loading…" }));
|
||||
pane.append(scroll);
|
||||
@@ -121,6 +121,7 @@ function renderRunRow(run, now) {
|
||||
const identity = runIdentity(run.title, run.name);
|
||||
const row = h("button", {
|
||||
class: `row run-row${state.selectedRunId === run.id ? " selected" : ""}`,
|
||||
"data-run-id": String(run.id),
|
||||
onclick: () => selectRun(run.id),
|
||||
});
|
||||
|
||||
|
||||
+47
-4
@@ -1,6 +1,6 @@
|
||||
// Omni-search: the top-bar panel, kind/sort controls, rows and result routing.
|
||||
// Debounce/staleness/ordering/empty-state decisions are pure in search.js; this
|
||||
// module owns the DOM and the route hand-off.
|
||||
// Omni-search: the shell's Search control, kind/sort controls, rows and result
|
||||
// routing. Debounce/staleness/ordering/empty-state decisions are pure in
|
||||
// search.js; this module owns the DOM and the route hand-off.
|
||||
|
||||
import { h } from "../dom.js";
|
||||
import { describeError } from "../format.js";
|
||||
@@ -28,6 +28,9 @@ export function createSearchView(rt) {
|
||||
const { state, repo, searchHost } = rt;
|
||||
let searchTimer = null;
|
||||
let searchEdit = null;
|
||||
// Where focus goes when the panel closes: the rail or dock Search control that
|
||||
// opened it, so Escape/Close never drops the operator on <body>.
|
||||
let searchTriggerId = null;
|
||||
const renderHeader = (...args) => rt.renderHeader(...args);
|
||||
const renderContent = (...args) => rt.renderContent(...args);
|
||||
const selectPipeline = (...args) => rt.selectPipeline(...args);
|
||||
@@ -40,6 +43,8 @@ export function createSearchView(rt) {
|
||||
/** Open the search field and ask for focus; the current view is left alone. */
|
||||
function openSearch() {
|
||||
if (state.searchOpen) return;
|
||||
const trigger = document.activeElement;
|
||||
searchTriggerId = trigger && trigger.id ? trigger.id : null;
|
||||
state.searchOpen = true;
|
||||
state.searchError = "";
|
||||
state.searchFocusPending = true;
|
||||
@@ -68,6 +73,9 @@ function closeSearch() {
|
||||
state.searchFocusPending = false;
|
||||
renderHeader();
|
||||
renderSearch();
|
||||
const trigger = searchTriggerId ? document.getElementById(searchTriggerId) : null;
|
||||
searchTriggerId = null;
|
||||
if (trigger && trigger.getClientRects().length > 0) trigger.focus();
|
||||
}
|
||||
|
||||
function cancelSearchDebounce() {
|
||||
@@ -220,6 +228,35 @@ function renderSearch() {
|
||||
);
|
||||
sortSelect.value = state.searchSort;
|
||||
|
||||
const fieldRow = h(
|
||||
"div",
|
||||
{ class: "search-field-row" },
|
||||
h("input", {
|
||||
id: "searchInput",
|
||||
class: "search-input",
|
||||
type: "text",
|
||||
placeholder: "Search pipelines, runs and artifacts",
|
||||
value: state.searchQuery,
|
||||
spellcheck: "false",
|
||||
autocomplete: "off",
|
||||
"aria-label": "Search",
|
||||
oninput: (event) => onSearchInput(event.target.value),
|
||||
onkeydown: (event) => {
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
sendSearchNow();
|
||||
}
|
||||
},
|
||||
}),
|
||||
h("button", {
|
||||
id: "searchClose",
|
||||
class: "ghost search-close",
|
||||
type: "button",
|
||||
text: "Close search",
|
||||
onclick: () => closeSearch(),
|
||||
}),
|
||||
);
|
||||
|
||||
const controls = h(
|
||||
"div",
|
||||
{ class: "search-controls" },
|
||||
@@ -241,7 +278,13 @@ function renderSearch() {
|
||||
|
||||
const area = h("div", { id: "searchResults", class: "search-results", "aria-live": "polite" });
|
||||
fillSearchResults(area);
|
||||
searchHost.replaceChildren(h("div", { id: "searchPanel", class: "search-panel" }, controls, area));
|
||||
searchHost.replaceChildren(
|
||||
h("div", { id: "searchPanel", class: "search-panel", role: "search", "aria-label": "Search" }, fieldRow, controls, area),
|
||||
);
|
||||
if (state.searchFocusPending) {
|
||||
document.getElementById("searchInput")?.focus();
|
||||
state.searchFocusPending = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,8 @@ import {
|
||||
notificationEnvironment,
|
||||
notificationPermissionState,
|
||||
} from "../notify.js";
|
||||
import { bannerState } from "../connection.js";
|
||||
import { bannerState, protocolMismatch } from "../connection.js";
|
||||
import { PROTOCOL_VERSION } from "../protocol.js";
|
||||
|
||||
export function createSettingsView(rt) {
|
||||
const { state, repo, setServerUrlDraft, endpointConfigured } = rt;
|
||||
@@ -48,6 +49,7 @@ export function createSettingsView(rt) {
|
||||
function renderSettingsView() {
|
||||
const pane = h("div", { class: "settings" });
|
||||
pane.append(
|
||||
h("h1", { class: "settings-page-title", id: "detailTitle", tabindex: "-1", text: "Settings" }),
|
||||
renderSettingsConnection(),
|
||||
renderSettingsWorkspace(),
|
||||
renderSettingsNotifications(),
|
||||
@@ -138,6 +140,12 @@ function renderSettingsConnection() {
|
||||
card.append(h("p", { class: "settings-status-line", text: line }));
|
||||
});
|
||||
section.append(card, renderTrustWarning());
|
||||
const warning = protocolMismatch(PROTOCOL_VERSION, state.serverProtocol);
|
||||
if (warning) {
|
||||
section.append(
|
||||
h("p", { class: "settings-warning-line settings-protocol-warning", role: "alert", text: warning }),
|
||||
);
|
||||
}
|
||||
return section;
|
||||
}
|
||||
|
||||
@@ -223,7 +231,7 @@ function renderTrustWarning() {
|
||||
/**
|
||||
* Route a Settings connection control through the page's existing single client,
|
||||
* mirroring AppViewModel: Disconnect closes the shared socket, Connect is
|
||||
* connect-only (validate + persist + open — never the header's toggle), and
|
||||
* connect-only (validate + persist + open — never a toggle), and
|
||||
* Reconnect re-opens the same validated endpoint now. Nothing here opens a second
|
||||
* connection.
|
||||
*/
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
export function createTemplatesView(rt) {
|
||||
const { state, repo } = rt;
|
||||
const renderContent = (...args) => rt.renderContent(...args);
|
||||
const focusDetailHeading = (...args) => rt.focusDetailHeading(...args);
|
||||
const pushRoute = (...args) => rt.pushRoute(...args);
|
||||
const setError = (...args) => rt.setError(...args);
|
||||
const refreshPipelines = (...args) => rt.views.pipelines.refreshPipelines(...args);
|
||||
@@ -60,14 +61,6 @@ function templateGraphFor(key) {
|
||||
|
||||
function renderTemplateGallery() {
|
||||
const pane = h("div", { class: "list gallery" });
|
||||
pane.append(
|
||||
h(
|
||||
"div",
|
||||
{ class: "pane-head" },
|
||||
h("h2", { text: "Templates" }),
|
||||
h("button", { class: "ghost", text: "Refresh templates", onclick: () => loadTemplates(true) }),
|
||||
),
|
||||
);
|
||||
if (state.templateLoading && !state.templates.length) {
|
||||
pane.append(h("div", { class: "muted pad", text: "Loading templates…" }));
|
||||
return pane;
|
||||
@@ -76,7 +69,7 @@ function renderTemplateGallery() {
|
||||
pane.append(h("div", { class: "muted pad", text: "No templates are available on this server." }));
|
||||
return pane;
|
||||
}
|
||||
const cards = h("div", { class: "cards" });
|
||||
const cards = h("div", { class: "cards list-scroll" });
|
||||
for (const entry of state.templates) {
|
||||
const card = templateCard(entry, templateGraphFor(entry.key));
|
||||
cards.append(
|
||||
@@ -84,6 +77,7 @@ function renderTemplateGallery() {
|
||||
"button",
|
||||
{
|
||||
class: `card${state.selectedTemplateKey === entry.key ? " selected" : ""}`,
|
||||
"data-template-key": entry.key,
|
||||
onclick: () => selectTemplate(entry.key),
|
||||
},
|
||||
h("span", { class: "card-name", text: templateGalleryName(card.name) }),
|
||||
@@ -105,15 +99,7 @@ function renderTemplateDetail() {
|
||||
}
|
||||
const graph = templateGraphFor(entry.key);
|
||||
pane.append(renderTemplateDetailActions());
|
||||
pane.append(
|
||||
h(
|
||||
"div",
|
||||
{ class: "tabstrip" },
|
||||
templateTabButton("summary", "Summary"),
|
||||
templateTabButton("graph", "Graph"),
|
||||
templateTabButton("source", "Source"),
|
||||
),
|
||||
);
|
||||
pane.append(h("h1", { class: "detail-title", id: "detailTitle", tabindex: "-1", text: templateDetailName(entry) }));
|
||||
if (state.templateTab === "graph") pane.append(renderTemplateGraphTab(graph));
|
||||
else if (state.templateTab === "source") pane.append(renderTemplateSourceTab(entry, graph));
|
||||
else pane.append(renderTemplateSummaryTab(entry, graph));
|
||||
@@ -287,20 +273,8 @@ async function createFromTemplate(entry) {
|
||||
renderContent();
|
||||
}
|
||||
|
||||
function templateTabButton(tab, label) {
|
||||
return h("button", {
|
||||
class: `minitab${state.templateTab === tab ? " active" : ""}`,
|
||||
text: label,
|
||||
onclick: () => {
|
||||
state.templateTab = tab;
|
||||
renderContent();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function renderTemplateSummaryTab(entry, graph) {
|
||||
const wrap = h("div", { class: "tabbody" });
|
||||
wrap.append(h("h2", { text: templateDetailName(entry) }));
|
||||
if ((entry.description ?? "").trim()) {
|
||||
wrap.append(h("p", { class: "body", text: entry.description }));
|
||||
}
|
||||
@@ -392,6 +366,7 @@ function selectTemplate(key) {
|
||||
state.selectedTemplateKey = key || null;
|
||||
resetTemplateCreateState();
|
||||
renderContent();
|
||||
if (key) focusDetailHeading();
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user