web: one status glyph, a compact settings button and collapsible panes
- Run and pipeline rows use one coloured status glyph with the word in its tooltip; the run version sits at the right of the title line; the usage metrics row is gone. - Settings is an icon beside the connection status (rail and dock), not a destination tab; the destinations keep a roving tab even while Settings is open. - The rail and every list pane collapse to a narrow strip from an icon at their top-right (remembered per device). A collapsed runs list shows the status glyph, pipelines their flow glyph, chats their status word. - Tool calls open in a modal (rendered/expanded rows in place) instead of an inline popover; the chip stays a quiet line beside the message. - Refresh tooltips show the last data arrival (manual or socket) per destination.
This commit is contained in:
+98
-10
@@ -28,6 +28,7 @@ import { layoutGraph } from "./graph.js";
|
||||
import { readGraphExpanded } from "./graphPrefs.js";
|
||||
import { readArtifactView } from "./artifactViewPrefs.js";
|
||||
import { readChatStars } from "./chatStars.js";
|
||||
import { readLayoutPrefs, writeLayoutPrefs } from "./layoutPrefs.js";
|
||||
import { DEFAULT_ROUTE, parseRoute, serializeRoute } from "./routes.js";
|
||||
import { EMPTY_PIPELINE_FILTERS, PIPELINE_DETAIL_TABS } from "./pipelines.js";
|
||||
import {
|
||||
@@ -180,6 +181,8 @@ const state = {
|
||||
artifactView: readArtifactView(),
|
||||
// Starred chat sessions (chatStars.js): local, always sorted first.
|
||||
chatStars: readChatStars(),
|
||||
// The collapsed rail/list choices (layoutPrefs.js), restored per device.
|
||||
...readLayoutPrefs(),
|
||||
// Whether the CLOSED chats group is expanded (the chevron beside its name).
|
||||
chatClosedOpen: false,
|
||||
// The last time each destination's data arrived (manual refresh or a socket
|
||||
@@ -458,7 +461,9 @@ const railDestinations = h(
|
||||
"aria-label": "Destinations",
|
||||
"aria-orientation": "vertical",
|
||||
},
|
||||
...DESTINATIONS.map((destination) => destinationTab(destination, "rail")),
|
||||
...DESTINATIONS.filter((destination) => destination.key !== "settings").map((destination) =>
|
||||
destinationTab(destination, "rail"),
|
||||
),
|
||||
);
|
||||
|
||||
const dockDestinations = h(
|
||||
@@ -469,7 +474,9 @@ const dockDestinations = h(
|
||||
role: "tablist",
|
||||
"aria-label": "Destinations",
|
||||
},
|
||||
...DESTINATIONS.map((destination) => destinationTab(destination, "dock")),
|
||||
...DESTINATIONS.filter((destination) => destination.key !== "settings").map((destination) =>
|
||||
destinationTab(destination, "dock"),
|
||||
),
|
||||
);
|
||||
|
||||
const railSearch = h(
|
||||
@@ -517,6 +524,25 @@ function statusControl(id, mount) {
|
||||
const railStatus = statusControl("shellStatus", "rail");
|
||||
const dockStatus = statusControl("shellStatusNarrow", "dock");
|
||||
|
||||
function settingsControl(mount) {
|
||||
return h(
|
||||
"button",
|
||||
{
|
||||
id: mount === "rail" ? "railSettings" : "dockSettings",
|
||||
class: mount === "rail" ? "shell-settings rail-settings" : "shell-settings dock-settings",
|
||||
type: "button",
|
||||
title: "Settings",
|
||||
"aria-label": "Settings",
|
||||
"data-settings-destination": "settings",
|
||||
onclick: () => goToDestination("settings"),
|
||||
},
|
||||
icon("settings"),
|
||||
);
|
||||
}
|
||||
|
||||
const railSettings = settingsControl("rail");
|
||||
const dockSettings = settingsControl("dock");
|
||||
|
||||
const railSections = h("div", { id: "railSections", class: "rail-sections" });
|
||||
const sectionStrip = h("nav", {
|
||||
id: "sectionStrip",
|
||||
@@ -527,6 +553,14 @@ const sectionStrip = h("nav", {
|
||||
const appRail = h(
|
||||
"aside",
|
||||
{ id: "appRail", class: "app-rail", "aria-label": "Pipelines navigation" },
|
||||
h("button", {
|
||||
id: "railCollapse",
|
||||
class: "shell-collapse rail-collapse",
|
||||
type: "button",
|
||||
title: "Collapse navigation",
|
||||
"aria-label": "Collapse navigation",
|
||||
"aria-expanded": "true",
|
||||
}),
|
||||
h(
|
||||
"div",
|
||||
{ class: "rail-brand" },
|
||||
@@ -545,7 +579,7 @@ const appRail = h(
|
||||
railDestinations,
|
||||
h("div", { class: "rail-divider", role: "presentation" }),
|
||||
railSections,
|
||||
h("div", { class: "rail-footer" }, railStatus),
|
||||
h("div", { class: "rail-footer" }, h("div", { class: "rail-footer-row" }, railStatus, railSettings)),
|
||||
);
|
||||
|
||||
// The omni-search panel is part of the workspace flow: it takes height from the
|
||||
@@ -568,7 +602,7 @@ const workspace = h(
|
||||
const dock = h(
|
||||
"nav",
|
||||
{ id: "destinationDock", class: "destination-dock", "aria-label": "Destinations" },
|
||||
dockStatus,
|
||||
h("div", { class: "dock-status-row" }, dockStatus, dockSettings),
|
||||
h("div", { class: "dock-row" }, dockSearch, dockDestinations),
|
||||
);
|
||||
// The attention sheet lives in its own layer so it can overlay any view without
|
||||
@@ -581,6 +615,18 @@ const modalLayer = h("div", { id: "modalLayer" });
|
||||
const skipLink = h("a", { class: "skip-link", href: "#pane-main", text: "Skip to detail" });
|
||||
document.body.append(skipLink);
|
||||
document.body.append(h("div", { class: "app-root" }, appRail, workspace, dock));
|
||||
appRail.querySelector("#railCollapse")?.addEventListener("click", () => {
|
||||
state.railCollapsed = !state.railCollapsed;
|
||||
applyLayoutState();
|
||||
});
|
||||
document.addEventListener("click", (event) => {
|
||||
const button = event.target instanceof Element ? event.target.closest("#listCollapse") : null;
|
||||
if (!button) return;
|
||||
state.listCollapsed = !state.listCollapsed;
|
||||
writeLayoutPrefs(state);
|
||||
renderContent();
|
||||
});
|
||||
applyLayoutState();
|
||||
document.body.append(attentionLayer);
|
||||
document.body.append(modalLayer);
|
||||
|
||||
@@ -647,11 +693,17 @@ function clearServerUrlError() {
|
||||
/** Repaint the shell chrome in place; the rail itself is never rebuilt. */
|
||||
function renderHeader() {
|
||||
const activeKey = destinationForView(state.view);
|
||||
const activeIndex = destinationIndex(activeKey);
|
||||
for (const tab of document.querySelectorAll("[data-destination]")) {
|
||||
const isActive = tab.getAttribute("data-destination") === activeKey;
|
||||
const tabs = [...document.querySelectorAll("[data-destination]")];
|
||||
const keys = tabs.map((tab) => tab.getAttribute("data-destination"));
|
||||
// Settings is a separate control beside the status, so while it is open no
|
||||
// destination tab is selected; keep the first one in the roving order.
|
||||
const activeIndex = keys.indexOf(activeKey);
|
||||
const roving = activeIndex >= 0 ? activeIndex : 0;
|
||||
for (const tab of tabs) {
|
||||
const key = tab.getAttribute("data-destination");
|
||||
const isActive = key === activeKey;
|
||||
tab.setAttribute("aria-selected", isActive ? "true" : "false");
|
||||
tab.setAttribute("tabindex", rovingTabindex(activeIndex, DESTINATIONS.findIndex((d) => d.key === tab.getAttribute("data-destination"))));
|
||||
tab.setAttribute("tabindex", rovingTabindex(roving, keys.indexOf(key)));
|
||||
if (isActive) tab.setAttribute("aria-current", "page");
|
||||
else tab.removeAttribute("aria-current");
|
||||
}
|
||||
@@ -662,6 +714,12 @@ function renderHeader() {
|
||||
if (label) label.textContent = status.text;
|
||||
control.setAttribute("aria-label", `Connection status: ${status.text}. Open Settings`);
|
||||
}
|
||||
for (const control of document.querySelectorAll("[data-settings-destination='settings']")) {
|
||||
const active = activeKey === "settings";
|
||||
control.classList.toggle("active", active);
|
||||
if (active) control.setAttribute("aria-current", "page");
|
||||
else control.removeAttribute("aria-current");
|
||||
}
|
||||
railSearch.setAttribute("aria-expanded", state.searchOpen ? "true" : "false");
|
||||
dockSearch.setAttribute("aria-expanded", state.searchOpen ? "true" : "false");
|
||||
// aria-controls points at #searchPanel only while that panel exists.
|
||||
@@ -849,10 +907,37 @@ function paneHeading(title, { detailOpen, subtitle = "", actions = [] } = {}) {
|
||||
{ class: "pane-head" },
|
||||
h("div", { class: "pane-head-text" }, h(tag, { class: "pane-title", id: "listTitle", text: title }), subtitle ? h("h2", { class: "pane-subtitle", text: subtitle }) : null),
|
||||
);
|
||||
if (actions.length) head.append(h("div", { class: "pane-head-actions" }, ...actions));
|
||||
head.append(h("div", { class: "pane-head-actions" }, ...actions, listCollapseButton()));
|
||||
return head;
|
||||
}
|
||||
|
||||
/** The icon that collapses the list pane to a narrow strip and back. */
|
||||
function listCollapseButton() {
|
||||
const collapsed = state.listCollapsed === true;
|
||||
return h("button", {
|
||||
id: "listCollapse",
|
||||
class: "shell-collapse list-collapse",
|
||||
type: "button",
|
||||
title: collapsed ? "Expand list" : "Collapse list",
|
||||
"aria-label": collapsed ? "Expand list" : "Collapse list",
|
||||
"aria-expanded": collapsed ? "false" : "true",
|
||||
text: collapsed ? "\u203a" : "\u2039",
|
||||
});
|
||||
}
|
||||
|
||||
function applyLayoutState() {
|
||||
appRail.classList.toggle("collapsed", state.railCollapsed === true);
|
||||
const railButton = document.getElementById("railCollapse");
|
||||
if (railButton) {
|
||||
const label = state.railCollapsed ? "Expand navigation" : "Collapse navigation";
|
||||
railButton.title = label;
|
||||
railButton.setAttribute("aria-label", label);
|
||||
railButton.setAttribute("aria-expanded", state.railCollapsed ? "false" : "true");
|
||||
railButton.textContent = state.railCollapsed ? "\u203a" : "\u2039";
|
||||
}
|
||||
writeLayoutPrefs(state);
|
||||
}
|
||||
|
||||
function listSubtitle(view) {
|
||||
switch (view) {
|
||||
case "runs":
|
||||
@@ -1031,7 +1116,10 @@ function renderContent() {
|
||||
: state.selectedTemplateKey != null;
|
||||
const activePane = detailOpen ? "detail" : "list";
|
||||
const model = detailSections();
|
||||
const layout = h("div", { class: "pane-layout", "data-active-pane": activePane });
|
||||
const layout = h("div", {
|
||||
class: `pane-layout${state.listCollapsed ? " list-collapsed" : ""}`,
|
||||
"data-active-pane": activePane,
|
||||
});
|
||||
|
||||
if (view === "pipelines") {
|
||||
layout.append(
|
||||
|
||||
Reference in New Issue
Block a user