diff --git a/.agents/session-log.md b/.agents/session-log.md index ac54d13..b047c40 100644 --- a/.agents/session-log.md +++ b/.agents/session-log.md @@ -385,5 +385,7 @@ - 2026-04-08: Updated `.agents/workflow.md` so chat ownership is now a constant repo rule. The workflow file now defines stable Engine versus Desktop/UI ownership, cross-boundary stop rules, branch and dirty-tree preflight checks, and a requirement to record the validation actually run. - 2026-04-08: Started issue #214 renderer tab binding registry hardening. This slice is limited to `desktop/renderer/app.js` plus `.agents` continuity, and replaces the long `bindTabContentEvents` conditional chain with a local handler registry without changing renderer behavior. - 2026-04-08: Completed issue #214 renderer tab binding registry hardening. `bindTabContentEvents` now dispatches through a local `TAB_CONTENT_EVENT_BINDERS` registry in `desktop/renderer/app.js`, and `npm run smoke` still passes via local runs fallback. +- 2026-04-10: Started issue #342 to restore primary workbench ownership after the desktop kept reserving too much width for empty or low-value side panes. This slice introduces a workbench-priority layout mode in the renderer so support and internal rails collapse earlier on common laptop widths instead of compressing the active surface. +- 2026-04-10: Completed issue #342 primary workbench ownership. The renderer now marks workbench-heavy surfaces explicitly and collapses the outer support lane plus internal two-column workbench grids earlier, so `Runs`, `Compare`, `Candidates`, `Run Detail`, and `Paper Ops` stop holding two side rails at the same laptop-width breakpoint. Validation passed with `node --check desktop/renderer/app.js`, `npm run smoke:fallback`, and `npm run smoke:real-path`. - 2026-04-10: Started issue #346 to harden `desktop-smoke` result persistence after CI repeatedly failed with raw `ENOENT` on missing `result.json` in a planning-only PR. The slice is limited to `desktop/main.js`, `desktop/scripts/smoke.js`, and `.agents` continuity so smoke emits structured failures instead of crashing when Electron exits too early. - 2026-04-10: Added the desktop layout regression remediation block after reviewing the post-merge desktop state in real screenshots. Opened issues #342, #343, and #344 to target empty-pane collapse, stronger active-surface focus and context containment, and better runs-family density plus right-rail space budgeting without reopening core or `research_ui` scope. diff --git a/desktop/renderer/app.js b/desktop/renderer/app.js index 2641819..1bb6d27 100644 --- a/desktop/renderer/app.js +++ b/desktop/renderer/app.js @@ -105,6 +105,19 @@ const state = { workspacePersistTimer: null, }; +const WORKBENCH_PRIORITY_KINDS = new Set([ + "runs", + "run", + "compare", + "candidates", + "artifacts", + "paper", + "system", + "experiments", + "sweep-decision", + "job", +]); + const elements = { runtimeSummary: document.getElementById("runtime-summary"), runtimeMeta: document.getElementById("runtime-meta"), @@ -151,6 +164,7 @@ const elements = { workflowRunsList: document.getElementById("workflow-runs-list"), workflowOpenCompare: document.getElementById("workflow-open-compare"), workflowClearSelection: document.getElementById("workflow-clear-selection"), + workspaceGrid: document.querySelector(".workspace-grid"), }; const paletteActions = PALETTE_ACTION_SPECS.map((action) => ({ @@ -909,6 +923,7 @@ function renderChatAdapterStatus() { function renderTabs() { if (!state.tabs.length) { + syncWorkspaceLayoutMode(null); clearElement(elements.tabsBar); appendChildren( elements.tabContent, @@ -944,6 +959,7 @@ function renderTabs() { ); const activeTab = state.tabs.find((tab) => tab.id === state.activeTabId) || state.tabs[0]; state.activeTabId = activeTab.id; + syncWorkspaceLayoutMode(activeTab); elements.topbarTitle.textContent = activeTab.title; syncTopbarChrome(activeTab); syncNav(activeTab.navKind || activeTab.kind); @@ -982,6 +998,14 @@ function renderTabs() { bindTabContentEvents(activeTab); } +function syncWorkspaceLayoutMode(activeTab) { + if (!elements.workspaceGrid) return; + const kind = activeTab?.kind || ""; + const priority = WORKBENCH_PRIORITY_KINDS.has(kind) ? "high" : "normal"; + elements.workspaceGrid.dataset.activeTabKind = kind; + elements.workspaceGrid.dataset.workbenchPriority = priority; +} + function renderPalette() { elements.paletteOverlay.classList.toggle("hidden", !state.paletteOpen); if (!state.paletteOpen) return; diff --git a/desktop/renderer/styles.css b/desktop/renderer/styles.css index 7726d68..5ef9263 100644 --- a/desktop/renderer/styles.css +++ b/desktop/renderer/styles.css @@ -409,7 +409,7 @@ button:disabled { .tabs-shell { display: grid; grid-template-rows: auto auto 1fr; - min-height: 500px; + min-height: 420px; gap: 4px; } @@ -1572,6 +1572,35 @@ button:disabled { line-height: 1.55; } +@media (max-width: 1560px) { + .workspace-grid[data-workbench-priority="high"] { + grid-template-columns: 1fr; + } + + .workspace-grid[data-workbench-priority="high"] .support-column { + order: 2; + } + + .workspace-grid[data-workbench-priority="high"] .tabs-shell { + min-height: 0; + } + + .workspace-grid[data-workbench-priority="high"] .runs-workbench, + .workspace-grid[data-workbench-priority="high"] .compare-workbench, + .workspace-grid[data-workbench-priority="high"] .candidates-workbench, + .workspace-grid[data-workbench-priority="high"] .run-detail-grid, + .workspace-grid[data-workbench-priority="high"] .run-detail-evidence-grid, + .workspace-grid[data-workbench-priority="high"] .evidence-grid { + grid-template-columns: 1fr; + } + + .workspace-grid[data-workbench-priority="high"] .runs-workbench-side, + .workspace-grid[data-workbench-priority="high"] .run-detail-side { + position: static; + top: auto; + } +} + @media (max-width: 1200px) { .workspace-grid { grid-template-columns: 1fr; } .workflow-grid { grid-template-columns: 1fr; }