Skip to content

Commit 762bc72

Browse files
author
DavidQ
committed
Standardize first-class tool panel roles and move status to right-bottom output area - PR_26126_069-tool-template-panel-role-standardization
1 parent ed61e63 commit 762bc72

8 files changed

Lines changed: 109 additions & 19 deletions

File tree

docs/dev/PROJECT_INSTRUCTIONS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,10 @@ No PR is complete with:
567567
- Tools must use consistent header, NAV, panel, accordion, status, and action patterns.
568568
- Left and right tool panels must use working accordion sections unless explicitly exempted.
569569
- Dead accordion controls are prohibited.
570+
- Left panel = user input/setup.
571+
- Center = primary work surface.
572+
- Right panel = output/status/logging/diagnostics.
573+
- Status/log sections belong at the bottom of the right panel unless explicitly justified otherwise.
570574

571575
## INPUT RESOLUTION RULES
572576

docs/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ Exercised tool entry points detected:
1818
(0%) Workspace Manager - not exercised by this Playwright run
1919

2020
Changed runtime JS files covered:
21-
(50%) tools/templates/first-class-tool-starter/js/ToolStarterApp.js - executed lines 98/98; executed functions 8/16
22-
(88%) tools/templates/first-class-tool-starter/js/controls/SourceInputControl.js - executed lines 33/33; executed functions 7/8
23-
(100%) tools/templates/first-class-tool-starter/js/bootstrap.js - executed lines 48/48; executed functions 4/4
24-
(100%) tools/templates/first-class-tool-starter/js/controls/ActionNavControl.js - executed lines 51/51; executed functions 5/5
21+
(100%) none changed - no changed runtime JS files
2522

2623
Files with executed line/function counts where available:
2724
(2%) src/engine/input/ActionInputService.js - executed lines 397/397; executed functions 1/51
@@ -157,12 +154,8 @@ Files with executed line/function counts where available:
157154
(100%) tools/templates/first-class-tool-starter/js/services/ToolStateSerializer.js - executed lines 13/13; executed functions 3/3
158155

159156
Uncovered or low-coverage changed JS files:
160-
(100%) none - no low-coverage changed runtime JS files
157+
(100%) none changed - no changed runtime JS files
161158

162159
Changed JS files considered:
163160
(0%) tests/playwright/PreviewGeneratorV2Baseline.spec.mjs - changed JS file not collected as browser runtime coverage
164161
(0%) tools/templates/first-class-tool-starter/tests/playwright/FirstClassToolStarter.spec.mjs - changed JS file not collected as browser runtime coverage
165-
(50%) tools/templates/first-class-tool-starter/js/ToolStarterApp.js - changed JS file with browser V8 coverage
166-
(88%) tools/templates/first-class-tool-starter/js/controls/SourceInputControl.js - changed JS file with browser V8 coverage
167-
(100%) tools/templates/first-class-tool-starter/js/bootstrap.js - changed JS file with browser V8 coverage
168-
(100%) tools/templates/first-class-tool-starter/js/controls/ActionNavControl.js - changed JS file with browser V8 coverage
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
PR_26126_069-tool-template-panel-role-standardization
2+
3+
Scope:
4+
- Updated the official first-class tool starter layout at tools/templates/first-class-tool-starter/.
5+
- Updated first-class tool template README and control/service contracts.
6+
- Added the panel role standard to docs/dev/PROJECT_INSTRUCTIONS.md under UI CONSISTENCY CONTRACT.
7+
- Updated existing Playwright coverage for panel role placement.
8+
- No live tools outside tools/templates, samples, schemas, roadmap, start_of_day folders, or tools/shared files were modified.
9+
10+
Changes:
11+
- Moved the Status accordion from the left column to the bottom of the right column.
12+
- Kept Output Summary above Status in the right column.
13+
- Left column now contains only user-editable/setup controls in the starter.
14+
- Center column remains the primary preview/work surface.
15+
- Right column now owns generated output, summary, status, and logging in the starter.
16+
- Documented the standard three-column first-class tool layout in:
17+
- tools/templates/first-class-tool-starter/README.md
18+
- tools/templates/first-class-tool-starter/docs/CONTROL_SERVICE_CONTRACTS.md
19+
- docs/dev/PROJECT_INSTRUCTIONS.md
20+
- Preserved Preview Generator V2 visual/theme alignment, src/engine/theme usage, and no tools/shared runtime dependency.
21+
- Preserved external CSS/JS only; no inline style block, inline script block, or inline event handlers were added.
22+
23+
Validation:
24+
- node --check tests/playwright/PreviewGeneratorV2Baseline.spec.mjs
25+
- node --check tools/templates/first-class-tool-starter/tests/playwright/FirstClassToolStarter.spec.mjs
26+
- rg check confirmed tools/templates/first-class-tool-starter/index.html has no inline style block, inline script block, or inline event handlers.
27+
- git diff --check
28+
- npm run test:workspace-v2
29+
- npx playwright test --config tools/templates/first-class-tool-starter/playwright.config.mjs --reporter=list
30+
31+
Playwright impacted: Yes
32+
- This PR changes template UI layout and panel-role placement.
33+
- npm run test:workspace-v2 passed.
34+
- Template-local Playwright passed.
35+
36+
Playwright behavior validated:
37+
- Starter left panel contains Input Source and does not contain Status.
38+
- Starter center panel contains Preview.
39+
- Starter right panel contains Output Summary and Status.
40+
- Status remains a working accordion and remains the last accordion in the right panel.
41+
- Existing starter nav modes, accordion behavior, required-field gating, primary action, and status clear behavior still work.
42+
43+
Manual test notes:
44+
- Open tools/templates/first-class-tool-starter/index.html.
45+
- Confirm the left panel contains only Input Source.
46+
- Confirm the center panel contains Preview.
47+
- Confirm the right panel contains Output Summary above Status.
48+
- Confirm Status collapses/expands and Clear still empties the status log.
49+
50+
Full samples smoke test:
51+
- Skipped. This PR only changes the first-class tool starter template, template documentation, project instructions wording, and targeted tests.

tests/playwright/PreviewGeneratorV2Baseline.spec.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ test.describe("Preview Generator V2 baseline", () => {
472472
await expect(page.locator("#toolExportButton")).toHaveText("Export");
473473
await expect(page.locator("#toolCopyJsonButton")).toHaveText("Copy JSON");
474474
await expect(page.locator("#toolExportToolStateButton")).toHaveText("Export toolState");
475+
await expect(page.locator(".tool-starter__panel--left #sourceInputContent")).toBeVisible();
476+
await expect(page.locator(".tool-starter__panel--left #statusLogContent")).toHaveCount(0);
477+
await expect(page.locator(".tool-starter__panel--center #previewPanelContent")).toBeVisible();
478+
await expect(page.locator(".tool-starter__panel--right #inspectorContent")).toBeVisible();
479+
await expect(page.locator(".tool-starter__panel--right #statusLogContent")).toBeVisible();
480+
await expect(page.locator(".tool-starter__panel--right .accordion-v2").last()).toContainText("Status");
475481

476482
const duplicateIds = await page.evaluate(() => {
477483
const ids = [...document.querySelectorAll("[id]")].map((element) => element.id);

tools/templates/first-class-tool-starter/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ The contracts define:
7979
- Do not use inline event handlers such as `onclick`, `onchange`, or `oninput`.
8080
- Do not add hidden defaults or silent fallback data.
8181

82+
## Panel Layout Standard
83+
84+
First-class tools use a consistent three-column layout:
85+
86+
- Left panel: user input, setup, and intent controls only.
87+
- Center panel: primary work surface, editor, canvas, or preview.
88+
- Right panel: generated output, summaries, diagnostics, logs, and status.
89+
- Status/log sections belong at the bottom of the right panel unless a PR explicitly justifies a different placement.
90+
91+
The starter demonstrates this standard with Input Source on the left, Preview in the center, and Output Summary above Status on the right.
92+
8293
## Creating A New Tool
8394

8495
1. Copy `tools/templates/first-class-tool-starter/` to `tools/<tool-id>/`.

tools/templates/first-class-tool-starter/docs/CONTROL_SERVICE_CONTRACTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ Common methods:
3939

4040
Controls communicate through injected callbacks, injected services, or the app/root coordinator. A control must not directly edit another control's DOM or internal state.
4141

42+
## Panel Role Contract
43+
44+
First-class tools use a consistent three-column layout contract:
45+
46+
- Left panel owns user input, setup, and intent controls only.
47+
- Center panel owns the primary work surface, editor, canvas, or preview.
48+
- Right panel owns generated output, summaries, diagnostics, logs, and status.
49+
- Status and log controls belong at the bottom of the right panel unless a PR explicitly justifies a different placement.
50+
51+
Controls should be placed according to these panel roles before adding new sections. A control that mixes input and output responsibilities should be split into separate controls.
52+
4253
## Service Contract
4354

4455
Services contain non-DOM logic.

tools/templates/first-class-tool-starter/index.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ <h2 class="tools-platform-frame__eyebrow">First-Class Tools Surface</h2>
6464
</div>
6565
</section>
6666

67-
<section class="accordion-v2 tool-starter__accordion is-open" data-accordion-v2-open="true">
68-
<button class="accordion-v2__header" type="button" aria-expanded="true" aria-controls="statusLogContent">
69-
<span>Status</span>
70-
<span class="accordion-v2__icon" aria-hidden="true">+</span>
71-
</button>
72-
<div id="statusLogContent" class="accordion-v2__content">
73-
<button id="clearStatusButton" type="button">Clear</button>
74-
<textarea id="statusLog" readonly rows="10" aria-label="Status log"></textarea>
75-
</div>
76-
</section>
7767
</aside>
7868

7969
<section class="tool-starter__panel tool-starter__panel--center" aria-label="Tool preview">
@@ -100,6 +90,17 @@ <h2 class="tools-platform-frame__eyebrow">First-Class Tools Surface</h2>
10090
<pre id="inspectorOutput" class="tool-starter__output">{}</pre>
10191
</div>
10292
</section>
93+
94+
<section class="accordion-v2 tool-starter__accordion is-open" data-accordion-v2-open="true">
95+
<button class="accordion-v2__header" type="button" aria-expanded="true" aria-controls="statusLogContent">
96+
<span>Status</span>
97+
<span class="accordion-v2__icon" aria-hidden="true">+</span>
98+
</button>
99+
<div id="statusLogContent" class="accordion-v2__content">
100+
<button id="clearStatusButton" type="button">Clear</button>
101+
<textarea id="statusLog" readonly rows="10" aria-label="Status log"></textarea>
102+
</div>
103+
</section>
103104
</aside>
104105
</main>
105106
<script type="module" src="../../../src/engine/theme/mount-shared-header.js"></script>

tools/templates/first-class-tool-starter/tests/playwright/FirstClassToolStarter.spec.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,19 @@ test.describe("First-Class Tool Starter", () => {
9797
await expect(workspaceNav.getByRole("button", { name: "Export manifest" })).toBeVisible();
9898
});
9999

100+
test("uses standardized panel roles", async ({ page }) => {
101+
const leftPanel = page.locator(".tool-starter__panel--left");
102+
const centerPanel = page.locator(".tool-starter__panel--center");
103+
const rightPanel = page.locator(".tool-starter__panel--right");
104+
105+
await expect(leftPanel.locator("#sourceInputContent")).toBeVisible();
106+
await expect(leftPanel.locator("#statusLogContent")).toHaveCount(0);
107+
await expect(centerPanel.locator("#previewPanelContent")).toBeVisible();
108+
await expect(rightPanel.locator("#inspectorContent")).toBeVisible();
109+
await expect(rightPanel.locator("#statusLogContent")).toBeVisible();
110+
await expect(rightPanel.locator(".accordion-v2").last()).toContainText("Status");
111+
});
112+
100113
test("Hide Header and Details toggles header state", async ({ page }) => {
101114
const summary = page.locator("[data-tool-starter-summary]");
102115
const details = page.locator(".is-collapsible");

0 commit comments

Comments
 (0)