Skip to content

fix(content-drive): hide Upload button when items are selected (#36369)#36371

Queued
zJaaal wants to merge 4 commits into
mainfrom
issue-36369-content-drive-hide-upload-button-on-selection
Queued

fix(content-drive): hide Upload button when items are selected (#36369)#36371
zJaaal wants to merge 4 commits into
mainfrom
issue-36369-content-drive-hide-upload-button-on-selection

Conversation

@zJaaal

@zJaaal zJaaal commented Jun 30, 2026

Copy link
Copy Markdown
Member

Proposed Changes

Fixes #36369

While doing QA on Content Drive, the Upload button stayed visible even when items were selected in the grid. Uploading in that state stored the asset in the root/current folder rather than the selection — confusing, since the selection implies an action context.

The toolbar already establishes the right pattern: when selectedItems().length > 0 ($showWorkflowActions), the "Add New" button is hidden and the workflow/bulk actions are swapped in via the $displayButton() animation state. The Upload button was simply hardcoded outside that gate and left always-visible.

This PR moves the Upload button inside the same @if ($displayButton()) block (with matching enter/leave animations), so both creation actions hide/show together on selection.

Behavior

Selection Upload button
None Visible — uploads to the current/navigated folder (unchanged)
One or more items Hidden (consistent with "Add New")
Cleared Reappears

Per team decision (Slack thread), we hide the button rather than redirecting the upload target to the selected folder — this avoids coupling a spatial drag-and-drop gesture to a checkbox selection and the ambiguity that comes with it. No changes to upload-target logic or drag-and-drop.

Checklist

  • Tests added/updated (visible with empty selection, hidden on single/multiple selection, hides alongside "Add New", reappears when cleared)
  • pnpm nx test portlets-content-drive — 672/672 pass
  • pnpm nx lint portlets-content-drive — clean

Screenshots

Manual QA: select one or more items in the grid → Upload button hides alongside "Add New"; clear the selection → both reappear.

🤖 Generated with Claude Code

The toolbar already hides the "Add New" button and swaps in the workflow/
bulk actions when items are selected (via $showWorkflowActions =
selectedItems().length > 0), but the Upload button was hardcoded as
always-visible and left out of that swap. As a result it stayed clickable
in a selection context, where an upload would land in the root/current
folder rather than the selection — confusing users.

Move the Upload button inside the same $displayButton() animation gate as
"Add New" so both creation actions hide/show together on selection. No
changes to upload-target logic or drag-and-drop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @zJaaal's task in 1m 21s —— View job


Rollback Safety Analysis

  • Read rollback-unsafe categories reference
  • Get full PR diff
  • Analyze diff against all categories
  • Apply label

Verdict: ✅ Safe to Roll Back

All changes in this PR are pure frontend (Angular template, TypeScript component, spec file) and documentation. Checked against every category in the rollback-unsafe reference:

Category Verdict
C-1 Structural data model change ✅ Not present
C-2 Elasticsearch mapping change ✅ Not present
C-3 Content JSON model version bump ✅ Not present
C-4 DROP TABLE / DROP COLUMN ✅ Not present
H-1 One-way data migration ✅ Not present
H-2 RENAME TABLE / COLUMN ✅ Not present
H-3 PK restructuring ✅ Not present
H-4 New ContentType field type ✅ Not present
H-5 Storage provider change ✅ Not present
H-6 DROP PROCEDURE / FUNCTION ✅ Not present
H-7 NOT NULL column without default ✅ Not present
H-8 VTL viewtool contract change ✅ Not present
M-1 Column type change ✅ Not present
M-2 Push publishing bundle format ✅ Not present
M-3 REST/GraphQL API contract change ✅ Not present
M-4 OSGi interface change ✅ Not present

Summary of changes:

  • dot-content-drive-toolbar.component.html — Upload button moved inside the @if ($displayButton()) block (UI-only)
  • dot-content-drive-toolbar.component.ts — JSDoc comment update only
  • dot-content-drive-toolbar.component.spec.ts — New/updated unit tests
  • core-web/libs/sdk/experiments/README.md — Updated support link URL

No database migrations, no Elasticsearch changes, no API contract changes, no data transformations. Rolling back to N-1 requires no manual intervention.

Label applied: AI: Safe To Rollback

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🤖 dotBot Review (Bedrock)

Reviewed 4 file(s); 0 candidate(s) → 0 confirmed, 0 uncertain (unverified, kept for review).

✅ No issues found after verification.


us.deepseek.r1-v1:0 · Run: #28466148233 · tokens: in: 10556 · out: 1850 · total: 12406 · calls: 4 · est. ~$0.024

The selection effect sets addNewButton:false immediately, so the hide is
synchronous and asserted right after detectChanges(). Waiting for the
delayed transition would mount dot-content-drive-workflow-actions, which
needs MessageService (out of this unit test's scope). Add a comment so the
synchronous assertion isn't mistaken for a missing animation wait.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added Area : SDK PR changes SDK libraries and removed AI: Safe To Rollback labels Jun 30, 2026
@zJaaal zJaaal added this pull request to the merge queue Jun 30, 2026
Any commits made after this event will not be merged.
@mergify

mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code Area : SDK PR changes SDK libraries

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[BUG] Content Drive: hide Upload button when items are selected

3 participants