Skip to content

fix(admin-ui): port folder drop confirmation and sidebar truncation fixes to 6.5.0 - #5563

Closed
Pavel910 wants to merge 181 commits into
release/6.5.0from
fm/port-fixes-650
Closed

fix(admin-ui): port folder drop confirmation and sidebar truncation fixes to 6.5.0#5563
Pavel910 wants to merge 181 commits into
release/6.5.0from
fm/port-fixes-650

Conversation

@Pavel910

@Pavel910 Pavel910 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Intent

Port two fixes from release/6.4.7 to release/6.5.0: (1) wire dropConfirmation to FolderTree and block visual update until confirmed — applied to shared packages (admin-ui, app-aco) via cherry-pick, and to the 6.5.0 presentation-layer equivalent ContentEntriesListLayout.tsx manually; includes extensions/folderDropConfirmation test extension and webiny.config.tsx registration. (2) Truncate long sidebar menu item names to prevent layout overflow — applied unchanged via cherry-pick; includes .mcp.json. PR targets release/6.5.0.

What Changed

  • Folder drop confirmation: Rewired useTree to defer the visual tree update (presenter.handleDrop) until the onDrop callback resolves, and updated FolderTree and List in app-aco to wrap showConfirmMoveFolderDialog in a Promise that rejects on cancel — blocking the tree reorder when the user dismisses the confirmation dialog. Wired dropConfirmation prop to FolderTree in the CMS ContentEntriesListLayout, and added the extensions/folderDropConfirmation test extension with its webiny.config.tsx registration.
  • Sidebar text truncation: Added min-w-0 to SidebarMenuSubItem and SidebarMenuSubButton flex containers, wrapped button text in a <span className="truncate"> element, and applied right padding when an action slot is present — preventing long folder/menu names from overflowing the sidebar layout.
  • Experiments / A/B testing removal: Deleted the entire experiments and variants feature tree from api-website-builder, app-website-builder, and website-builder-sdk (domain models, use cases, repositories, GraphQL schema, presenters, UI components, bucketing/analytics logic, and PostHog provider). Removed the abTesting feature flag from feature-flags, the canUseAbTesting license capability from wcp, and all experiment-related re-exports from website-builder-react, sdk-frontend, and sdk-nextjs. Moved createComponent from website-builder-react to website-builder-sdk and re-exported it as an alias.

Risk Assessment

✅ Low: The fix-round commit correctly applies the Promise/reject drop-confirmation pattern to FolderTree.tsx, matching the reference implementation in List.tsx. The broader change is a clean port of two fixes (drop confirmation + sidebar truncation) and a thorough removal of the AB testing feature, with no dangling references or broken interfaces.

Testing

All 34 targeted tests pass across admin-ui Tree and app-aco FolderTreePresenter. The drop-confirmation behavioral contract (reject blocks visual update) was verified with a focused test. Sidebar truncation is CSS-only and requires visual verification in a running app — no screenshot was captured because the dev server setup for Webiny is heavyweight.

Evidence: Tree tests output (TreePresenter + useTreeDropBehavior)
The following environment variables were included from the root ".env" file:


---------------------------

 RUN  v4.1.10 /Users/paveldenisjuk/.no-mistakes/worktrees/7cefe28bb051/01KZBQ1B9JJJQA7XBHRX1DK0XJ


 Test Files  2 passed (2)
      Tests  5 passed (5)
   Start at  16:32:40
   Duration  183ms (transform 61ms, setup 101ms, import 72ms, tests 9ms, environment 0ms)
Evidence: FolderTreePresenter tests output (29 tests)
The following environment variables were included from the root ".env" file:


---------------------------

 RUN  v4.1.10 /Users/paveldenisjuk/.no-mistakes/worktrees/7cefe28bb051/01KZBQ1B9JJJQA7XBHRX1DK0XJ


 Test Files  1 passed (1)
      Tests  29 passed (29)
   Start at  16:32:41
   Duration  1.85s (transform 129ms, setup 34ms, import 201ms, tests 1.52s, environment 0ms)
Evidence: Drop behavior verification writeup
# Drop Confirmation Behavior Verification

## Fix 1: useTree drop ordering change

The critical behavioral change in `packages/admin-ui/src/Tree/useTree.ts` reorders
the drop handling:

**Before:** `presenter.handleDrop()` was called FIRST (updating visual state),
then `props.onDrop()` was called. If the user cancelled the confirmation dialog,
the tree had already visually updated — leaving the UI in an inconsistent state.

**After:** `props.onDrop()` is called FIRST. If it throws (user cancels the
confirmation dialog), `presenter.handleDrop()` is never called — blocking the
visual update and keeping the UI consistent.

### Verification steps performed:

1. Created a focused test (`useTreeDropBehavior.test.ts`) that reproduces the
   drop orchestration logic from `useTree.ts`:
   - When `onDrop` resolves: `presenter.handleDrop` is called → nodes update ✅
   - When `onDrop` rejects (user cancels): `presenter.handleDrop` is NOT called → nodes stay unchanged ✅
   - When no `onDrop` callback provided: `presenter.handleDrop` is called → nodes update ✅

2. All 3 tests passed, confirming the behavioral contract.

3. Verified the same Promise/reject pattern is applied consistently in both:
   - `packages/app-aco/src/presentation/folderTree/FolderTree.tsx` (presentation layer)
   - `packages/app-aco/src/components/FolderTree/List/List.tsx` (legacy layer)

4. Verified `useConfirmMoveFolderDialog` supports `onClose` callback (used for reject).

5. Verified `dropConfirmation` prop is wired through from extension → config → component.

## Fix 2: Sidebar truncation (CSS-only)

Visual CSS change — `truncate`, `min-w-0`, `overflow-hidden` classes added to
sidebar menu components. Requires running the app to visually verify.
- Outcome: ⚠️ 1 warning across 1 run (5m4s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ packages/api-core/src/features/wcp/WcpContext/WcpContext.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/api-core/src/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/api-core/src/graphql/wcp/WcpSchemaFactory.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/api-core/src/legacy/wcp/LegacyWcpContext.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/api-file-manager/__tests__/features/assetDelivery/assetDelivery.di.test.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/api-website-builder/src/graphql/createGraphQL.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/api-website-builder/src/graphql/experiments/experiments.gql.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/api-website-builder/src/index.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/app-admin/src/components/Wcp.tsx - merge conflict rebasing onto origin/next
  • ⚠️ packages/app-admin/src/features/wcp/ReactLicense.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/feature-flags/src/FeatureFlags.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/feature-flags/src/types.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/project/src/decorators/GetFeatureFlagsWithLicense.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/project/src/extensions/FeatureFlags.tsx - merge conflict rebasing onto origin/next
  • ⚠️ packages/wcp/src/License.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/wcp/src/NullLicense.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/wcp/src/index.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/wcp/src/testing/createTestWcpLicense.ts - merge conflict rebasing onto origin/next
  • ⚠️ packages/wcp/src/types.ts - merge conflict rebasing onto origin/next
🔧 **Review** - 3 issues found → auto-fixed ✅
  • 🚨 packages/app-aco/src/presentation/folderTree/FolderTree.tsx:217 - FolderTree.tsx (presentation layer used by ContentEntriesListLayout) was not updated with the Promise/reject pattern applied to List.tsx. The onDrop callback at line 217 calls showConfirmMoveFolderDialog as fire-and-forget: no await, no Promise wrapper, no onClose rejection. Because useTree.ts now requires onDrop to throw to block the visual update (presenter.handleDrop), cancelling the confirmation dialog in the CMS content entries view will still cause the tree to visually reorder even though no folder was moved. The fix in List.tsx (lines 104-115) wraps the dialog in a Promise with reject on close — FolderTree.tsx needs the same treatment.
  • ⚠️ packages/app-aco/src/presentation/folderTree/FolderTree.tsx:213 - FolderTree.tsx line 213-214: when folder or targetFolder is not found, onDrop returns without throwing. With the new useTree.ts logic, a normal return still allows presenter.handleDrop to execute, causing a visual reorder with no actual backend move. List.tsx (line 101) was fixed to throw new Error("Folder not found") in this case. FolderTree.tsx should do the same.
  • ⚠️ packages/sdk-frontend/src/index.ts:21 - In sdk-frontend/src/index.ts, the previously exported createComponent (from @webiny/cms-sdk) is renamed to createCmsComponent. Any consumer importing { createComponent } from '@webiny/sdk-frontend' will get a compile error. This is an intentional refactor but is a breaking change for the public API of this package.

🔧 Fix: fix FolderTree.tsx: Promise/reject drop confirmation pattern
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 warning
  • ⚠️ packages/admin-ui/src/Sidebar/components/items/SidebarMenuSubButton.tsx - Sidebar truncation (fix 2) is a CSS-only change (truncate, min-w-0, overflow-hidden classes on SidebarMenuSubButton, SidebarMenuSubItem, SidebarRoot, SidebarContent). No automated test can verify visual truncation — requires running the app with a long sidebar menu item name to confirm the layout does not overflow. The CSS classes themselves are standard Tailwind utilities and correctly placed, but visual confirmation was not captured.
  • yarn test packages/admin-ui/src/Tree/ — TreePresenter (2 tests) + useTreeDropBehavior (3 tests) — all pass
  • yarn test packages/app-aco/src/presentation/folderTree/FolderTreePresenter.test.ts — 29 tests — all pass
  • Wrote and ran useTreeDropBehavior.test.ts: verified onDrop-reject blocks presenter.handleDrop (visual update not applied when user cancels)
  • Verified Promise/reject pattern applied consistently in FolderTree.tsx and List.tsx
  • Verified dropConfirmation prop wired: extension → ContentEntryListConfig → Browser.Folder.DropConfirmation → FolderTree
  • Confirmed build errors in admin-ui are pre-existing (identical on base commit)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

adrians5j and others added 30 commits July 2, 2026 23:39
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#5382)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…#5385)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…#5387)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…5388)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#5395)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#5397)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
adrians5j and others added 25 commits August 4, 2026 15:52
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…SS template (#5547)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…5548)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
… from sdk-frontend

Move createComponent from framework-specific packages (website-builder-react,
website-builder-vue) to the framework-agnostic website-builder-sdk. Both
framework packages now re-export from the SDK.

Export createCmsComponent (from cms-sdk) and createWbComponent (from
website-builder-sdk) as distinct aliases from sdk-frontend to resolve the
naming conflict.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The resolver was exported from the resolvers index but never imported or
registered in the DI container, causing CmsQuery.getModel to always
return null.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The <fieldId> in the description string was parsed as a JSX element,
causing React warnings about unrecognized tags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ache (#5550)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…lds (#5525)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The `runner` context is not available in job-level `env`, so
`WORKDIR: ${{ runner.temp }}/slop-cop` made the workflow file invalid
("Unrecognized named-value: 'runner'"). Derive WORKDIR from the runner's
built-in $RUNNER_TEMP inside each step instead. The analysis step keeps
${{ runner.temp }} in its step-level env, where the context is allowed;
both resolve to the same directory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NFTbnZYKArMQiiCyUKuP6G
…test yarn cache (#5554)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The model was asked for raw JSON and occasionally emitted slightly
malformed JSON (unescaped quote/comma in a finding), so JSON.parse threw
("Expected ',' or ']' ... position 1550") and the analysis bailed
(non-blocking, so no comment was posted).

Switch to a forced Anthropic tool call: the model fills a `report` tool
whose input schema the API validates, and we read the already-parsed
object from `tool_use.input`. No text parsing, so malformed JSON is no
longer possible. Drops the brittle parseResult helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NFTbnZYKArMQiiCyUKuP6G
The report used `##`/`###` markdown headings, which GitHub renders as
oversized section titles. Switch the title, section labels, and per-finding
titles to bold text so the comment stays compact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NFTbnZYKArMQiiCyUKuP6G
…onents (#5559)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…visual update until confirmed

- Pass dropConfirmation prop from ContentEntryListConfig to FolderTree in SidebarContent
- Move presenter.handleDrop after onDrop callback in Tree's useTree so the visual
  tree update only applies after the consumer's callback resolves
- Wrap confirmation dialog in a promise so onDrop blocks until user confirms or cancels
- Pass onClose callback through useConfirmMoveFolderDialog to detect cancellation
- Add test extension for Browser.Folder.DropConfirmation
…t overflow

- Override Radix ScrollArea's display:table inner div to display:block in
  SidebarContent to prevent content-driven width expansion
- Add overflow-hidden to the sidebar's inner container
- Add truncate to sub-menu item text in SidebarMenuSubButton
- Add min-w-0 to sub-menu flex containers so children can shrink
- Add right padding on sub-menu items with pin actions to prevent
  ellipsis from rendering behind the pin icon
- Add stdlib and codegraph MCP servers to .mcp.json
…EntriesListLayout

Port the dropConfirmation prop to the 6.5.0 presentation-layer equivalent
of SidebarContent.tsx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Width

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Pavel910
Pavel910 force-pushed the fm/port-fixes-650 branch from c5899a3 to d5409f2 Compare August 6, 2026 14:48
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

🚓 Slop Cop

✅ Nothing worth flagging. The diff looks consistent with the PR's stated intent and the code-style rules.

Diff matches the stated intent (drop-confirmation + sidebar truncation port); no integrity or style issues found.

Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push.

@Pavel910
Pavel910 changed the base branch from next to release/6.5.0 August 6, 2026 15:05
@Pavel910

Pavel910 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Closing — branch was based on next instead of release/6.5.0. Will redo with correct base.

@Pavel910 Pavel910 closed this Aug 6, 2026
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.

4 participants