Skip to content

Commit 3cd9d55

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 414eb8e commit 3cd9d55

5 files changed

Lines changed: 22 additions & 8 deletions

File tree

docs/dev/reports/template_editable_noneditable_input_pattern.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Scope:
55
- Added explicit Not Editable and Editable field examples to the Input Source section.
66
- Matched Palette Manager V2 field styling patterns:
77
- readonly display fields use muted readonly input styling
8-
- editable text fields use normal input styling with editable focus/entry behavior
8+
- editable text fields use the taller Tags `No tags.` box styling with editable focus/entry behavior
99
- Documented the patterns in tools/templates-v2/README.md.
10-
- Added Playwright assertions for readonly and editable behavior.
10+
- Added Playwright assertions for readonly behavior, editable behavior, and the taller editable Tags-style box.
1111

1212
Runtime behavior:
1313
- Existing source input, NAV, launch-mode behavior, status clear, and template actions are unchanged.
@@ -21,5 +21,5 @@ Validation:
2121
- npm run test:workspace-v2 passed, 7 tests.
2222

2323
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.
24+
- Open tools/templates-v2/index.html and confirm the Input Source section shows a slim readonly Not Editable field and a taller editable Editable field containing `No tags.`.
2525
- 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ The Tool Template V2 demonstrates this standard with Input Source on the left, P
108108

109109
Tool Template V2 demonstrates both field patterns used by Palette Manager V2:
110110

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`.
111+
- Non-editable display fields use the `tool-starter__field--not-editable` pattern with `readonly` inputs, matching the Selected Swatch `Symbol` row. The visible demo label is `Not Editable`.
112+
- Editable text fields use the `tool-starter__field--editable` pattern with `tool-starter__editable-tags-box`, matching the Tags `No tags.` box. The visible demo label is `Editable`.
113113

114114
Use non-editable fields for display/read-only values. Use editable fields for user text entry.
115115

tools/templates-v2/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h2 class="tools-platform-frame__eyebrow">First-Class Tools Surface V2</h2>
6767
</label>
6868
<label class="tool-starter__field tool-starter__field--compact tool-starter__field--editable" for="editableField">
6969
<span>Editable</span>
70-
<input id="editableField" type="text" autocomplete="off" placeholder="No tags">
70+
<input id="editableField" class="tool-starter__editable-tags-box" type="text" autocomplete="off" value="No tags.">
7171
</label>
7272
</div>
7373
<p id="sourceValidationMessage" class="tool-starter__hint">Input is required before Export can process.</p>

tools/templates-v2/styles/toolStarter.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,20 @@ textarea:hover {
324324
cursor: default;
325325
}
326326

327+
.tool-starter__field--not-editable input {
328+
padding-block: 0;
329+
}
330+
327331
.tool-starter__field--editable input {
328332
background: var(--tool-starter-input-surface);
329333
color: var(--tool-starter-text);
330334
}
331335

332-
.tool-starter__field--not-editable input {
333-
background: var(--tool-starter-input-surface);
336+
.tool-starter__editable-tags-box {
337+
min-height: 36px;
338+
border-radius: 8px !important;
339+
background: var(--tool-starter-panel-strong);
340+
padding: 6px;
334341
}
335342

336343
.tool-starter__hint {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ test.describe("Tool Template V2", () => {
120120
await expect(notEditableField).toHaveValue("Read-only display value");
121121
await expect(page.locator("label[for='editableField']")).toContainText("Editable");
122122
await expect(editableField).toBeEditable();
123+
await expect(editableField).toHaveValue("No tags.");
124+
await expect(editableField).toHaveClass(/tool-starter__editable-tags-box/);
125+
await expect(async () => {
126+
const readonlyHeight = await notEditableField.evaluate((element) => element.getBoundingClientRect().height);
127+
const editableHeight = await editableField.evaluate((element) => element.getBoundingClientRect().height);
128+
expect(editableHeight).toBeGreaterThan(readonlyHeight);
129+
}).toPass();
123130
await editableField.fill("tag-example");
124131
await expect(editableField).toHaveValue("tag-example");
125132
});

0 commit comments

Comments
 (0)