Skip to content

feat(edit-content): restructure command bar & side panel around Actions tab (#35892)#36021

Open
oidacra wants to merge 15 commits into
mainfrom
issue-35892-restructure-command-bar-sidebar-actions-tab
Open

feat(edit-content): restructure command bar & side panel around Actions tab (#35892)#36021
oidacra wants to merge 15 commits into
mainfrom
issue-35892-restructure-command-bar-sidebar-actions-tab

Conversation

@oidacra
Copy link
Copy Markdown
Member

@oidacra oidacra commented Jun 5, 2026

Proposed Changes

Restructures the new Edit Contentlet command bar and side panel around a single Actions tab (#35892).

Command bar (dot-edit-content-form)

  • Slimmed to [status tag] | Preview … (overflow menu) ▢ (sidebar toggle) and made sticky on scroll.
  • Status now renders as a local p-tag; the lock toggle and inline workflow actions were removed from the bar.
  • New dot-edit-content-command-bar-actions overflow () menu — Permissions, Rules (pages only), View references — which owns the dialog-open logic relocated from the deleted sidebar wrappers.
  • Preview now resolves HTML pages via a new generatePageEditUrl helper in addition to URL-mapped content.

Side panel (dot-edit-content-sidebar)

  • The Info tab becomes Actions (lightning-bolt icon); the Settings tab is removed.
  • The lock control is relocated as a distinct outlined button with a lock icon, separated from the workflow actions by a divider.
  • Workflow actions render stacked full-width, one above another (new stacked mode on the shared dot-workflow-actions), first action primary. Firing stays in the form — the sidebar emits workflowActionFired and the layout delegates to DotEditContentFormComponent.fireWorkflowAction via its viewChild, so all validation/wizard/push-publish logic is untouched.
  • The Locales, Workflow and Details sections are independently collapsible and persist their open/closed state via DotLocalstorageService; headers use the design's uppercase treatment.
  • The information card drops the status chip and the References card (both now live in the command bar).

Removed the now-orphaned dot-edit-content-sidebar-permissions / dot-edit-content-sidebar-rules wrapper components (their dialogs are reused by the new overflow menu).

Out of scope (by design): Locales content is untouched (tracked in #35889) — only its section becomes collapsible. The lock control is relocated only; the richer "Release Lock"/steal-lock flow is deferred. Workflow/Details card visual restyle was intentionally left for a later pass.

Checklist

  • yarn nx lint edit-content / yarn nx lint ui — pass (pre-existing warnings only)
  • yarn nx test edit-content / yarn nx test ui — pass
  • yarn nx build dotcms-ui (AOT template type-check) — pass
  • yarn nx format:write

How to test

  1. Open an existing contentlet.
  2. Command bar shows [status tag] | Preview … ▢, sticks on scroll; no lock toggle / inline workflow actions.
  3. Actions tab: lock button (outlined + icon, divider below); workflow actions stacked full-width with the first action primary; firing Save/Publish still validates the form (scroll-to-error) and opens the wizard for push-publish / action-input.
  4. Locales / Workflow / Details collapse independently and persist across reload.
  5. menu opens Permissions, Rules (pages only) and View references; Settings tab is gone.
  6. Preview shown for a page and for URL-mapped content (existing only); hidden for new content. New contentlet → menu hidden.

…ns tab (#35892)

Command bar (dot-edit-content-form):
- Slim to [status tag] | Preview ... (overflow menu) [sidebar toggle], sticky on scroll.
- Status rendered as a local p-tag; lock toggle and inline workflow actions removed.
- New dot-edit-content-command-bar-actions overflow menu (Permissions, Rules for pages,
  View references) that owns the relocated dialog logic.
- Preview now supports HTML pages via generatePageEditUrl and URL-mapped content.

Side panel (dot-edit-content-sidebar):
- Info tab becomes Actions (bolt icon); Settings tab removed.
- Lock control relocated as a distinct outlined button with a lock icon, separated from the
  workflow actions by a divider.
- Workflow actions render stacked full-width (new `stacked` mode on dot-workflow-actions),
  one above another, first action primary; firing stays in the form via layout wiring
  (workflowActionFired output -> DotEditContentLayoutComponent.onWorkflowActionFired).
- Sections (Locales, Workflow, Details) are independently collapsible and persist their
  state via DotLocalstorageService; headers restyled to the design's uppercase treatment.
- Information card drops the status chip and References card (moved to the command bar).

Removed the now-orphaned sidebar permissions/rules wrapper components.
@github-actions github-actions Bot added Area : Backend PR changes Java/Maven backend code Area : Frontend PR changes Angular/TypeScript frontend code labels Jun 5, 2026
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jun 5, 2026

Claude finished @oidacra's task in 2m 34s —— View job


PR Review

  • Read changed files and analyze the diff
  • Review for bugs, edge cases, design issues, security concerns
  • Post findings

Four issues worth addressing, roughly in severity order.


1. closeOnEscape: false on Permissions and Rules dialogs violates project standard

CLAUDE.md"All dialogs must have closable: true and closeOnEscape: true"

In dot-edit-content-command-bar-actions.component.ts:130 and :159, both the Permissions and Rules dialogs are opened with closeOnEscape: false. The References dialog on :192 correctly uses closeOnEscape: true. The spec on line 148 also hardcodes closeOnEscape: false, so this is perpetuated in tests.

If the intent is to guard against accidental ESC inside the iframe, the flag should be set explicitly and the CLAUDE.md rule updated; otherwise both dialogs should flip to true. Fix this →


2. DotEditContentSidebarComponent.fireWorkflowAction has a bare null access

dot-edit-content-sidebar.component.ts:152

inode: this.$contentlet().inode,

$contentlet() can return null (its type is DotCMSContentlet | null). On a new contentlet before the first save, or during a loading cycle, this throws. The layout's onWorkflowActionFired doesn't have this problem because it reads this.$store.contentlet()?.inode. This path is also the only workflow path that skips form validation — the reset-workflow button in the Workflow section calls this method directly, not through the layout's validated onWorkflowActionFired. Whether bypassing validation is intentional for a reset action should be explicitly documented. Fix this →


3. $appendContext getter creates a new object on every change-detection cycle

dot-edit-content-form.component.ts:280

get $appendContext() {
    return { $store: this.$store, showSidebar: ..., ... };
}

This is a plain getter, not a signal computed. Every CD cycle a new object is returned, causing TabViewInsertDirective to see a changed reference for [dotTabViewAppendContext] and re-render the appended template. Because showPreview is a closure created inline here too, it also changes every cycle. Converting to a computed() signal or at least memoizing the stable parts would stop spurious re-renders.


4. $hasReferences fragile string comparison

dot-edit-content-form.component.ts:212

return !!relatedContent && relatedContent !== '0';

This works only because the store surfaces a string (not a number). If relatedContent returns 0 (number) or undefined, the guard behaves differently. Using Number(relatedContent) > 0 would be explicit and type-safe regardless of what the store returns.


Clean otherwise — the architecture around emitting workflowActionFired from the sidebar and delegating back to the form's fireWorkflowAction via viewChild is a good pattern that preserves all validation and wizard logic.

Override the Tag `success` color scheme in CustomLaraPreset so it uses a tinted
background with dark text ({green.100}/{green.700}) instead of Lara's default solid
fill + white text. Applies globally to every p-tag success, including the Edit
Content command-bar status; the primitives map 1:1 to the Claude Design green tones.
… fluid buttons (#35892)

- Make the status p-tag a fully-rounded pill globally via CustomLaraPreset (tag.root:
  9999px radius, 4px 12px padding, 600 weight) instead of a per-instance class, so a
  forgotten class can never make a tag look different.
- Replace the statusSeverity template method with memoized computeds ($contentStatus
  via DotContentletStatusPipe + $statusSeverity), backed by a pure exported
  contentStatusSeverity() so the mapping stays unit-testable. Avoids the per-CD method call.
- Use the native PrimeNG [fluid] input for full-width stacked workflow actions and the
  lock button instead of styleClass (class does not reach p-button's inner element).
…35892)

Move the tag's hardcoded shape/typography values into a css block driven by Tailwind
variables — same mechanism as the chip preset — instead of magic numbers: padding uses
var(--spacing), font-weight uses var(--font-weight-semibold), and the full pill radius
uses calc(infinity * 1px) (what Tailwind's rounded-full emits; there is no --radius-full).
…with the design (#35892)

- Invert sidebar backgrounds to match the design: the panel is now white and the
  Workflow/Details sections sit in surface-50 cards (was a gray panel with white cards).
- Sidebar width 360px (was 21.875rem ≈ 306px at the 14px root) and the left drop shadow
  is removed — only the thin border remains, per the design.
- Accordion headers: chevron moved to the right, points up when expanded, and gains a
  surface-50 hover background.
- Rename the "General" section to "Details" (new edit.content.sidebar.details.title key).
- Details card redesigned to the design spec: a single surface-50 card with a key/value
  grid (Content type link, Modified by + initials avatar, Modified) and a footer holding the
  Copy Identifier button and a "View as JSON" link. The copy button moved out of the section
  header; Created/Published columns were dropped to match the design.
- Tabs use an underline indicator (active border on the bottom, not the top) with no static
  tab background, via the global Tabs preset.
…er accordion titles (#35892)

- Lock button, Actions tab tooltip and the Details section title now reuse existing,
  already-translated message keys (Unlock / Make-Editable, Actions, details) via the dm
  pipe instead of brand-new keys. New keys only resolve after a backend rebuild, so they
  rendered as raw uppercase keys in a running instance; the existing keys translate
  immediately. Removed the now-unused new keys.
- The lock wording is action-based: "Lock for Editing" when unlocked, "Unlock" when locked.
- Vertically center the collapsible section titles: the section had asymmetric padding
  (pt-0 pb-3) which pushed the header toward the top divider; it is now symmetric (py-3),
  and the title uses leading-none so the uppercase text sits on the true vertical center.
…ing with the design (#35892)

- Sidebar borders (panel edge, tab list, section dividers) now use the same surface-200
  gray as the command bar instead of the darker gray-300/gray-400.
- Lock button: keep the outlined treatment (drop the secondary fill so its background no
  longer differs from the other buttons); icon reflects state (lock/unlock).
- Workflow card grid now mirrors the Details card exactly (same 110px/1fr columns, text
  size, gaps and muted-label / dark-value colors) so both cards read identically.
- Add a divider between the workflow actions and the first collapsible section, and
  normalise the lock / actions / section vertical rhythm (pb-3 / py-3) so the gaps are
  consistent instead of the oversized space that appeared after the actions.
- Tighten the command-bar item spacing (gap-2) so the status tag, preview, overflow menu
  and sidebar toggle sit closer together as in the design.
…erflow menu items flush and taller (#35892)

- Actions tab content padding is 18px (was 14px) to match the design.
- Command-bar overflow menu: items are flush (no list padding, no item border-radius) so the
  hover fills full width, and taller (py-3 on the item link) instead of cramped.
…de + lock/actions spacing (#35892)

- Collapsible sidebar sections now slide open/closed by animating the actual height via a
  grid-template-rows (0fr <-> 1fr) CSS transition with ease — a true slide-down/up that works
  for any content height, with no @angular/animations (avoids the deprecated trigger API) and
  no content fade.
- Lock button bottom spacing and the workflow-actions top/bottom spacing are 14px (pb-4 / py-4).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant