refactor(ui): redesign the shared key/value field across its three consumers (#37191) - #37284
Draft
adrianjm-dotCMS wants to merge 1 commit into
Draft
refactor(ui): redesign the shared key/value field across its three consumers (#37191)#37284adrianjm-dotCMS wants to merge 1 commit into
adrianjm-dotCMS wants to merge 1 commit into
Conversation
…nsumers (#37191) Rework the one shared Key/Value editor in `libs/ui` to the new design and roll it out to all three of its consumers: the Edit Content field, the Content Type Field Variables tab, and the Apps custom-properties panel. The redesign is assembled from stock PrimeNG 21 — no new component enters the workspace, and the net component count for the feature is zero. What changed for the user: - Values render as plain text at rest and become an input when activated; Enter commits, Escape restores. - Row actions (drag handle, remove) are revealed on hover instead of competing for attention on every row. - Hidden values move from a toggle switch in its own column to an eye inside the value field. It is a button in both states, so hiding a value is reversible. - The hidden indicator is never hover-gated: which values are secret has to be readable at a glance. - Empty state gains an icon and reuses the existing `keyValue.value_no_rows.label` copy, which already matched the design. - Reordering is offered in all three consumers rather than only one. Implementation notes worth knowing: - The row components attach by attribute selector (`tr[dotKeyValueTableRow]`), so their host IS the `tr`. PrimeNG themes its table with direct-child combinators (`.p-datatable-tbody > tr > td`), and an element wrapper between the tbody and the tr silently defeats every table style the theme provides. This is why the previous markup rendered with no borders or header band. - `onRowReorder` must not re-apply the move: PrimeNG's `onRowDrop` already calls `reorderArray` on the array bound to `[value]`. The handler only re-publishes it with a fresh reference so the signal notifies. - Hover-hidden actions use `opacity-0`, never `display:none` or an `@if` — those remove the control from the tab order and strand keyboard and touch users. A test asserts the mechanism, not merely that the icon is invisible. Also removed along the way: `DotKeyValueUtil` (87 lines nothing imported), a stale `[autoFocus]` binding in the Apps template together with the spec stub that made it look real, a duplicated copy of the row template that tests were asserting against instead of the real one, the now-unused `dragAndDrop` input, and both SCSS files. Icons follow the repo standard (Material Symbols); PrimeIcons are gone from this component's authored markup. No new i18n key was needed. Tests: 61 in `libs/ui` (from 31), 24 in `edit-content`, 70 in `dotcms-ui`, plus Playwright smokes for each consumer. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
18 tasks
Contributor
|
Claude finished @adrianjm-dotCMS's task in 1m 35s —— View job SDK Compatibility Analysis
Result: No SDK breaking changes detected. This PR is scoped entirely to the shared Key/Value editor in
None of the changed files touch any SDK-relevant surface:
A grep across the full non-test diff for No comment or label added per the SDK-compatibility check instructions (no breaking change found). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #37191
Proposed Changes
Reworks the one shared Key/Value editor in
libs/uito the new design and rolls it out to all threeof its consumers — the Edit Content field, the Content Type Field Variables tab, and the
Apps custom-properties panel — so they finally look and behave the same.
Built from stock PrimeNG 21. No new component enters the workspace; the net component count for
this feature is zero.
What changed for the user
Three findings worth a reviewer's attention
.p-datatable-tbody > tr > td). The row components used element selectors withdisplay: contents, so the component element sat between thetbodyand thetrand no table style from the theme ever applied — no borders, no header band. They now attach by attribute selector (tr[dotKeyValueTableRow]), making the host thetritself.onRowReordermust not re-apply the move. PrimeNG'sonRowDropalready callsreorderArrayon the array bound to[value]. Recomputing fromdragIndex/dropIndexapplies it twice. The handler only re-publishes the array with a fresh reference so the signal notifies.opacity-0, neverdisplay:noneor an@if. Those remove the control from the tab order and strand keyboard and touch users with no visible symptom for anyone on a mouse. A test asserts the mechanism, not merely that the icon is invisible.Removed along the way
DotKeyValueUtil— 87 lines nothing imported.[autoFocus]binding in the Apps template, plus the spec stub that made it look real. It compiled only becausestrictTemplatesis off in that app.dragAndDropinput, once reordering became universal and it had nothing left to gate.Checklist
keyValue.value_no_rows.labelAdditional Info
Tests: 61 in
libs/ui(from 31), 24 inedit-content, 70 indotcms-ui, plus Playwright smokes for each consumer. Lint and build clean.Not yet run: the Playwright specs have a clean typecheck but have not been executed, and the manual keyboard-only pass is still pending. Flagging it rather than implying green.
Scope: frontend only. Order persistence for Field Variables and Apps was scoped out of this issue — it would mean database, REST and encrypted-storage work.
spec.md,data-model.mdandcontracts/are included as the reviewed contract; the Spec-Kit process artifacts are gitignored by design.Screenshots
🤖 Generated with Claude Code