Skip to content

Feat/tree block nx2 migration#587

Open
hannessolo wants to merge 7 commits into
mainfrom
feat/tree-block-nx2-migration
Open

Feat/tree block nx2 migration#587
hannessolo wants to merge 7 commits into
mainfrom
feat/tree-block-nx2-migration

Conversation

@hannessolo

@hannessolo hannessolo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

hannessolo and others added 4 commits July 9, 2026 15:02
Add 'tree' to NX_BLOCKS and update all imports in nx/blocks/tree/tree.js
to nx2 equivalents (da-lit, nx2/scripts/nx.js, nx2/public/utils/tree.js,
nx2/utils/utils.js). Block stays in nx/ per migration convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getConfig() in nx2 returns undefined for nxBase if called before
setConfig(), unlike nx1's nexter.js which self-initializes. Compute
nx2Base directly from import.meta.url to avoid the dependency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previous fix pointed at nx2/styles/buttons.css, which doesn't exist —
buttons.css only lives in nx/styles/. Resolve the URL relative to the
block's own location.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jul 9, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

nx2 pages don't load nx/styles/nexter.css, so --s2-radius-*,
--spacing-*, --grid-container-width, and --body-font-family are
undefined — breaking margins, border-radius, and font on the tree
block and any nx1 buttons.css consumer.

Prefer nx2 names (--s2-corner-radius-*, --s2-spacing-*,
--se-grid-container-width, --s2-font-family) with the nx1 names as
fallback. Values line up: --s2-radius-100 (8px) → corner-radius-500;
--s2-radius-300 (16px) → corner-radius-800.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aem-code-sync aem-code-sync Bot temporarily deployed to feat/tree-block-nx2-migration July 9, 2026 13:44 Inactive
Comment thread nx/blocks/tree/tree.css
}

input {
font-family: var(--body-font-family);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the form fields we can/should use https://github.com/adobe/da-nx/blob/main/nx2/styles/form.css and can reduce this here.

Comment thread nx/styles/buttons.css

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same for this button styles, they can be replaced by https://github.com/adobe/da-nx/blob/main/nx2/styles/form.css

Address PR review from @mhaack: switch the tree block from
nx/styles/buttons.css to nx2/styles/form.css and reuse .da-input,
.da-btn-primary, .da-btn-secondary instead of the custom input CSS
and .accent/.primary/.negative classes.

- tree.js: load form.css (not buttons.css); Crawl → .da-btn-primary,
  Cancel/Toggle view → .da-btn-secondary, Copy list → .da-btn-primary,
  input → .da-input.
- tree.css: drop the ~10 lines of custom input styling; keep just
  '.da-input { flex: 1 1 auto; }' so it still fills the form row.
- nx/styles/buttons.css: revert to main. It's shared with other nx1
  blocks and the earlier nx2-fallback tweaks aren't needed for tree
  now that it doesn't load buttons.css.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aem-code-sync aem-code-sync Bot temporarily deployed to feat/tree-block-nx2-migration July 10, 2026 10:06 Inactive
@hannessolo hannessolo requested a review from mhaack July 10, 2026 10:10
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.

[nx2] tree (traverse)

3 participants