Skip to content

Commit 414eb8e

Browse files
author
DavidQ
committed
Standardize editable and non-editable input field patterns using Palette Manager V2 styles - PR_26126_078-template-editable-vs-noneditable-input-pattern
1 parent 55089d4 commit 414eb8e

5 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
PR_26126_078 Template Editable Vs Non-Editable Input Pattern
2+
3+
Scope:
4+
- Updated Tool Template V2 only.
5+
- Added explicit Not Editable and Editable field examples to the Input Source section.
6+
- Matched Palette Manager V2 field styling patterns:
7+
- readonly display fields use muted readonly input styling
8+
- editable text fields use normal input styling with editable focus/entry behavior
9+
- Documented the patterns in tools/templates-v2/README.md.
10+
- Added Playwright assertions for readonly and editable behavior.
11+
12+
Runtime behavior:
13+
- Existing source input, NAV, launch-mode behavior, status clear, and template actions are unchanged.
14+
- No live tools, samples, schemas, roadmap, or tools/shared files were modified.
15+
16+
Validation:
17+
- node --check tools/templates-v2/tests/playwright/FirstClassToolStarter.spec.mjs passed.
18+
- No inline script/style/event-handler matches were found in tools/templates-v2/index.html.
19+
- git diff --check passed.
20+
- npx playwright test --config tools/templates-v2/playwright.config.mjs passed, 10 tests.
21+
- npm run test:workspace-v2 passed, 7 tests.
22+
23+
Manual test notes:
24+
- Open tools/templates-v2/index.html and confirm the Input Source section shows a readonly Not Editable field and editable Editable field.
25+
- Open tools/templates-v2/index.html?launch=workspace and confirm workspace NAV still appears without changing field pattern styling.

tools/templates-v2/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ First-Class Tool V2 surfaces use a consistent three-column layout:
104104

105105
The Tool Template V2 demonstrates this standard with Input Source on the left, Preview in the center, and Output Summary above Status on the right.
106106

107+
## Editable And Non-Editable Field Patterns
108+
109+
Tool Template V2 demonstrates both field patterns used by Palette Manager V2:
110+
111+
- Non-editable display fields use the `tool-starter__field--not-editable` pattern with `readonly` inputs. The visible demo label is `Not Editable`.
112+
- Editable text fields use the `tool-starter__field--editable` pattern with normal text inputs. The visible demo label is `Editable`.
113+
114+
Use non-editable fields for display/read-only values. Use editable fields for user text entry.
115+
107116
## Creating A New Tool
108117

109118
1. Copy `tools/templates-v2/` to `tools/<tool-id>/`.

tools/templates-v2/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ <h2 class="tools-platform-frame__eyebrow">First-Class Tools Surface V2</h2>
6060
<span>Source value</span>
6161
<input id="sourceInput" type="text" autocomplete="off" placeholder="Enter a value to process">
6262
</label>
63+
<div class="tool-starter__field-patterns" aria-label="Editable and non-editable field patterns">
64+
<label class="tool-starter__field tool-starter__field--compact tool-starter__field--not-editable" for="notEditableField">
65+
<span>Not Editable</span>
66+
<input id="notEditableField" type="text" autocomplete="off" value="Read-only display value" readonly>
67+
</label>
68+
<label class="tool-starter__field tool-starter__field--compact tool-starter__field--editable" for="editableField">
69+
<span>Editable</span>
70+
<input id="editableField" type="text" autocomplete="off" placeholder="No tags">
71+
</label>
72+
</div>
6373
<p id="sourceValidationMessage" class="tool-starter__hint">Input is required before Export can process.</p>
6474
</div>
6575
</section>

tools/templates-v2/styles/toolStarter.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,35 @@ textarea:hover {
304304
font-weight: 700;
305305
}
306306

307+
.tool-starter__field--compact {
308+
grid-template-columns: 96px minmax(0, 1fr);
309+
}
310+
311+
.tool-starter__field-patterns {
312+
display: grid;
313+
gap: 8px;
314+
}
315+
307316
.tool-starter__field input {
308317
width: 100%;
309318
min-width: 0;
310319
padding: 7px 9px;
311320
}
312321

322+
.tool-starter__field input[readonly] {
323+
color: var(--tool-starter-muted);
324+
cursor: default;
325+
}
326+
327+
.tool-starter__field--editable input {
328+
background: var(--tool-starter-input-surface);
329+
color: var(--tool-starter-text);
330+
}
331+
332+
.tool-starter__field--not-editable input {
333+
background: var(--tool-starter-input-surface);
334+
}
335+
313336
.tool-starter__hint {
314337
margin: 0;
315338
color: var(--tool-starter-muted);

tools/templates-v2/tests/playwright/FirstClassToolStarter.spec.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ test.describe("Tool Template V2", () => {
111111
await expect(rightPanel.locator(".accordion-v2").last()).toContainText("Status");
112112
});
113113

114+
test("shows editable and non-editable field patterns", async ({ page }) => {
115+
const notEditableField = page.locator("#notEditableField");
116+
const editableField = page.locator("#editableField");
117+
118+
await expect(page.locator("label[for='notEditableField']")).toContainText("Not Editable");
119+
await expect(notEditableField).toHaveAttribute("readonly", "");
120+
await expect(notEditableField).toHaveValue("Read-only display value");
121+
await expect(page.locator("label[for='editableField']")).toContainText("Editable");
122+
await expect(editableField).toBeEditable();
123+
await editableField.fill("tag-example");
124+
await expect(editableField).toHaveValue("tag-example");
125+
});
126+
114127
test("Hide Header and Details toggles header state", async ({ page }) => {
115128
const summary = page.locator("[data-tool-starter-summary]");
116129
const details = page.locator(".is-collapsible");

0 commit comments

Comments
 (0)