web: app shell — left destination rail, settings-hosted connection, viewport panes
The layout item's work plus the two defects its review found:
- the wide grid sized the list track from its MAX, so at 600-759px the detail pane
was clipped to 40-199px; cap the list below 900px and narrow the rail there
(measured now: detail 232px at 600, 332 at 700, 340 at 900, 880 at 1440);
- the shell said 'Not connected' on a fresh page because the prefilled proxy URL
validated; the status now reflects a SAVED endpoint ('Not configured' until then)
and refreshes as the draft changes.
Includes the rail + bottom dock, connection moved into Settings, viewport-only
scrolling with panes that scroll themselves, tab semantics, skip link, h1 per
route, and the design tokens.
This commit is contained in:
+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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user