Skip to content

[8569] Update staging publishing target indicator in UI#4824

Merged
sumerjabri merged 4 commits intocraftercms:developfrom
jvega190:enhancement/8569
Apr 10, 2026
Merged

[8569] Update staging publishing target indicator in UI#4824
sumerjabri merged 4 commits intocraftercms:developfrom
jvega190:enhancement/8569

Conversation

@jvega190
Copy link
Copy Markdown
Member

@jvega190 jvega190 commented Mar 13, 2026

craftercms/craftercms#8569

Summary by CodeRabbit

  • Bug Fixes
    • Item display logic updated so items in "staged" state correctly show the staged icon instead of the workflow icon, and staged items that are live-submitted or scheduled no longer incorrectly display staging.
  • Documentation
    • Added internal helper documentation clarifying staged-display priority and exclusions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 66bf0109-0879-45c0-842f-6be8f1c7efba

📥 Commits

Reviewing files that changed from the base of the PR and between e210e1f and e51eef5.

📒 Files selected for processing (1)
  • ui/app/src/components/ItemDisplay/ItemDisplay.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/app/src/components/ItemDisplay/ItemDisplay.tsx

Walkthrough

Reworked ItemDisplay rendering: added shouldItemShowAsStaged(item) and changed leading-icon logic to inWorkflow && !shouldItemShowAsStaged(item), so staged/new/modified items use the publishing-target icon; also reformatted the ItemDisplayProps generic declaration to multi-line. (43 words)

Changes

Cohort / File(s) Summary
ItemDisplay component
ui/app/src/components/ItemDisplay/ItemDisplay.tsx
Added shouldItemShowAsStaged(item) with JSDoc to detect staged new/modified items and updated leading-icon rendering to prefer ItemPublishingTargetIcon for those items (inWorkflow && !shouldItemShowAsStaged(item)); reformatted ItemDisplayProps generic declaration to multi-line.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • rart
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and only provides a GitHub issue link without elaborating on the changes, objectives, or implementation details required by the template. Expand the description to include ticket reference and detailed explanation of what's in the PR, such as the staging behavior changes and the new shouldItemShowAsStaged helper function.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: updating the staging publishing target indicator in the UI, which aligns with the control-flow logic change gating workflow-state icon rendering by staged state.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/app/src/components/ItemDisplay/ItemDisplay.tsx`:
- Around line 89-91: The current predicate in isStagedNewOrModified only checks
stateMap.staged and thus misses items where stateMap.submittedToStaging or
stateMap.submittedToLive are true; update the boolean expression used to compute
isStagedNewOrModified (in ItemDisplay.tsx, around the isStagedNewOrModified
constant) to treat submittedToStaging and submittedToLive as equivalent to
staged by OR-ing them with stateMap.staged before combining with the (new ||
modified) check so items ready for staging/live are correctly detected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6397dfee-085e-478d-ab4a-1c924bb9edfa

📥 Commits

Reviewing files that changed from the base of the PR and between bd4b967 and f896fab.

📒 Files selected for processing (1)
  • ui/app/src/components/ItemDisplay/ItemDisplay.tsx

Comment thread ui/app/src/components/ItemDisplay/ItemDisplay.tsx Outdated
@jvega190 jvega190 marked this pull request as ready for review March 13, 2026 15:53
@jvega190 jvega190 requested a review from rart as a code owner March 13, 2026 15:53
* Staging has priority over modified and null. Additionally, if an item is submitted to live, submitted to staging, or
* scheduled, it should not be shown as staged.
*/
function shouldItemShowAsStaged(item: ContentItem): boolean {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type the argument so that you don't have to cast the various complying interfaces...

Suggested change
function shouldItemShowAsStaged(item: ContentItem): boolean {
function shouldItemShowAsStaged(item: { stateMap?: Record<'staged' | 'new' | ..., boolean> }): boolean {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since LightItem doesn't have stateMap, it still complains that LightItem doesn't have an optional param stateMap so I end up needing the cast.
I set item: ContentItem | LightItem and validated stateMap prop inside the util. That way I don't have to do any casting. What do you think?

@jvega190 jvega190 requested a review from rart March 19, 2026 17:32
@sumerjabri sumerjabri merged commit 4fa31cd into craftercms:develop Apr 10, 2026
3 of 4 checks passed
sumerjabri pushed a commit that referenced this pull request Apr 22, 2026
* Update rimraf, @types/node

* Update mui/*

* Update @types/react, @types/jquery, webpack

* Update marked, react-router, react-window, video.js

* Update @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vitejs/plugin-react, @swc/core, @swc/cli

* Update @atlaskit/pragmatic-drag-and-drop, monaco-graphql, @eslint/compat, @eslint/eslintrc, babel-plugin-formatjs, eslint-plugin-react-refresh, css-loader, @eslint/eslintrc, @rollup/plugin-commonjs, @prettier/plugin-xml

* Update @eslint/js, eslint

* Update @prettier/plugin-xml, graphql, jotai, eslint-plugin-formatjs, globals, rollup, preact

* Update @formatjs/cli

* Update fast-xml-parser

* Yarn dedupe

* Remove deprecated eslintConfig from uppy/package.json, and removed unstable_config_lookup_from_file flag from root package.json

* [8579] Fix guest build (#4828)

* [7418] FE2 - Label control (#4669)

* [7418] Label control

* [7418] Standardize fallback handling

* [7418] Add dompurify sanitization when setting inner html

* [7418] Remove defaultValue

* [7418] use getPropertyValue in Label control

* [7418] Remove renderAsHTML property from label descriptor, use minimal setup of tinymce in text field

* [7418] Add RTE wrapper for TypeBuilder, update label control to use rte for text field, with `craftercms-label-control`. Update RichTextEditor control to support defaultInitOptions prop

* [7418] Add dompurify

* [7418] Add dompurify

* [7418] fix package.json format

* [7418] Add dompurify

* [7418] FE2- Checkbox control (#4658)

* [7418] Checkbox readonly and defaultValue updates

* [7418] Improve Checkbox readonly value extraction

* [7418] Remove retrieving logic from checkbox control, update retrieveFieldValue to omit empty strings as defaultValue

* [7418] Update checkbox validator, fix retrieveFieldValue fieldValue calculation

* [7418] Update booleanFieldExtractor to return false if nullish value

* [7418] Forcehttps control (#4820)

* [8555] Handle request publish activity as package (#4830)

* [8216] Update dropTargetsLookup in parseLegacyFormDefinition to use new DataSource type instead of legacy. (#4806)

* [8216] Update dropTargetsLookup in parseLegacyFormDefinition to use new DataSource type instead of legacy

* [8216] Fix NodeSelector create component

* [8216] Remove unnecessary cast

* [8444] Approver user listed in Dashboard is always the user that requested the publish (#4831)

* [8444] Approver user listed in Dashboard is always the user that requested the publish

* [8444] Fix approver for requests in RecentlyPublishedDashlet

* [8451] Studio UI doesn’t correctly display API responses when Git global configs are unset (#4797)

* Fix error handling in EditTypeView to ensure proper message display, add type to error

* [7418] FE2 -CheckboxGroup control (#4653)

* Update field validation logic
* Enhance listDirection parsing
* Guard placeholder items during filtering
* Validate window in useWindowWidth
* Parse minSize safely
* Update validator to consider empty (or non-array) values
* Simplify validateFieldValue logic
* Remove unused/duplicate util
* Remove unused import
* Move utils to bottom of component
* Update CheckboxGroup to render a max of 2 columns, and remove rendering of 3 columns logic
* Move checkboxGroup validator to fn
* Add skeleton for loading state, use props utils
* Fix property for selectAll
* Update indeterminate and checked conditions of selectAll checkbox to consider filtering
* Update checkboxGroupValidator currentValue type
* Return undefined for finalOptions nullish options

* [8592] Send field to serializers for datasources in TB2 (#4836)

* Fix datasources form in TB2
* Retrieve/pass field to serializer

* [8547] Workflow states options should only display valid options (#4808)

* Workflow states options should only display valid options
* Add error handling on fetchPublishingTargets

* [7511] Removing datasource without disconnecting it from properties corrupts form (#4838)

* [7511] cleanupStaleDatasourceValues

* [7511] Cleanup datasource values from xml

* [7511] Remove comment

* [7511] Update selector in EditTypeView to use :scope for value element

* [7511] consider parse errors

---------

Co-authored-by: git_repo_user <evalgit@example.com>

* [8569] Update staging publishing target indicator in UI (#4824)

* [8569] Update staging publishing target indicator in UI

* [8569] Update comment

* [8569] Added util `shouldItemShowAsStaged`

* [7418] Update shouldItemShowAsStaged to avoid casting item

* [8407] set 'includeChildren' to true if mainItems are all folders (#4833)

* [8407] Add 'include children' option to PublishDialog. Prevent publishing only folders

* [8407] Avoid duplicate items

* [8407] Empty childrenItems when reverting dependencies changes

* [8407] Fix validation on Array.every() on an empty array returns true

* [8407] calculatePackage subscription cleanup

* [8407] set 'includeChildren' to true if mainItems are all folders

* [8407] Set initial state of 'includeChildren' based on mainItems being folders

---------

Co-authored-by: git_repo_user <evalgit@example.com>

* [7418] Update tokenized prop name (#4686)

* [7418] Update tokenized prop name

* [7418] Create commonDescriptors to reuse

---------

Co-authored-by: git_repo_user <evalgit@example.com>

* [8599] Update the UI to use the new available languages API (#4840)

* [8599] Update the UI to use the new available languages API

* Return empty array if undefined

* CHANGELOG update

---------

Co-authored-by: git_repo_user <evalgit@example.com>

* [8595] Update the UI to consume the new create site API (#4842)

* [8595] Update the UI to consume the new create site API

* Update token authentication form validation

* Update CreateSiteMeta siteName type to name

* Refactor authentication handling to remove username requirement for token authentication

---------

Co-authored-by: git_repo_user <evalgit@example.com>

* [8598] Update the UI to consume the new dependencies APIs (#4841)

* [8598] Update the UI to consume the new dependencies APIs

* [8598] Update changelog

* Fix changelog

* Refactor error handling in BrokenReferencesDialogContainer to use extractErrorPayload

* Handle error on fetchContentItem

* Add comment stating why ContentItems are needed

* Add loading state to edit button in RenameItemView

* Guard against undefined lightItems, use extractErrorPayload

---------

Co-authored-by: git_repo_user <evalgit@example.com>

* yarn.lock update after merge, yarn dedupe

---------

Co-authored-by: git_repo_user <evalgit@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants