Feat/tree block nx2 migration#587
Open
hannessolo wants to merge 7 commits into
Open
Conversation
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>
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>
mhaack
reviewed
Jul 9, 2026
| } | ||
|
|
||
| input { | ||
| font-family: var(--body-font-family); |
Contributor
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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>
mhaack
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #540
https://main--da-live--adobe.aem.live/apps/traverse?nx=feat-tree-block-nx2-migration&nxver=2