Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions WORKLOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Worklog

## 2026-07-09

### nx/blocks/tree/tree.js — migrate tree block to nx2

Added `'tree'` to `NX_BLOCKS` in `nx2/scripts/nx.js` so the block always loads from `/nx/blocks`.

Updated imports in `nx/blocks/tree/tree.js` to nx2 equivalents (block stays in place per migration convention):
- `../../deps/lit/lit-core.min.js` → `da-lit` (importmap)
- `../../scripts/nexter.js` → `../../../nx2/scripts/nx.js` (for `getConfig`)
- `../../public/utils/tree.js` → `../../../nx2/public/utils/tree.js` (for `crawl`)
- `../../utils/styles.js` (default `getStyle`) → `{ loadStyle }` from `../../../nx2/utils/utils.js`

## 2026-06-26

### nx2/blocks/chat/chat.js — skill selection preserves pending attachments (feat/da-skill-attachment-fix)
Expand Down
24 changes: 8 additions & 16 deletions nx/blocks/tree/tree.css
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
:host {
display: block;
max-width: var(--grid-container-width);
margin: var(--spacing-500) auto;
max-width: var(--se-grid-container-width, var(--grid-container-width));
margin: var(--s2-spacing-500, var(--spacing-500)) auto;
}

form {
display: flex;
gap: var(--spacing-400);
gap: var(--s2-spacing-400, var(--spacing-400));
}

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.

.da-input {
flex: 1 1 auto;
display: block;
border: 2px solid var(--s2-gray-200);
border-radius: var(--s2-radius-100);
padding: 0 8px;
height: 32px;
margin: 0;
box-sizing: border-box;
}

.totals-header {
Expand All @@ -29,7 +21,7 @@ input {

.da-list-actions {
display: flex;
gap: var(--spacing-400);
gap: var(--s2-spacing-400, var(--spacing-400));
}

.da-list-actions button {
Expand All @@ -44,12 +36,12 @@ ul {

li .details {
background: var(--s2-gray-75);
border-radius: var(--s2-radius-100);
border-radius: var(--s2-corner-radius-100, var(--s2-radius-100));
display: flex;
margin-bottom: var(--spacing-200);
margin-bottom: var(--s2-spacing-200, var(--spacing-200));
align-items: center;
justify-content: space-between;
padding: 0 var(--spacing-400);
padding: 0 var(--s2-spacing-400, var(--spacing-400));
}

li a {
Expand Down
24 changes: 11 additions & 13 deletions nx/blocks/tree/tree.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { LitElement, html, nothing } from '../../deps/lit/lit-core.min.js';
import { getConfig } from '../../scripts/nexter.js';
import { crawl } from '../../public/utils/tree.js';
import getStyle from '../../utils/styles.js';
import { LitElement, html, nothing } from 'da-lit';
import { crawl } from '../../../nx2/public/utils/tree.js';
import { loadStyle } from '../../../nx2/utils/utils.js';

const { nxBase } = getConfig();
const style = await getStyle(import.meta.url);
const buttons = await getStyle(`${nxBase}/styles/buttons.js`);
const style = await loadStyle(import.meta.url);
const formStyle = await loadStyle(new URL('../../../nx2/styles/form.js', import.meta.url).href);

class NxBulk extends LitElement {
static properties = {
Expand All @@ -16,7 +14,7 @@ class NxBulk extends LitElement {

connectedCallback() {
super.connectedCallback();
this.shadowRoot.adoptedStyleSheets = [style, buttons];
this.shadowRoot.adoptedStyleSheets = [style, formStyle];
this._canSubmit = true;
}

Expand Down Expand Up @@ -116,8 +114,8 @@ class NxBulk extends LitElement {
<h2>Files - ${this._files.length}</h2>
<h2>${this._time ? html`${this._time}s` : nothing}</h2>
<div class="da-list-actions">
<button class="accent" @click=${this.handleCopy}>Copy list</button>
<button class="primary" @click=${this.toggleView}>Toggle view</button>
<button class="da-btn-primary" @click=${this.handleCopy}>Copy list</button>
<button class="da-btn-secondary" @click=${this.toggleView}>Toggle view</button>
</div>
</div>
<ul class="files-list">${this._files.map(this.renderFile)}</ul>`;
Expand All @@ -127,9 +125,9 @@ class NxBulk extends LitElement {
return html`
<h1>Crawl Tree</h1>
<form @submit=${this.handleSubmit}>
<input name="path" value="/da-sites/bacom" />
<button class="accent" .disabled=${!this._canSubmit}>Crawl</button>
<button class="primary">Cancel</button>
<input class="da-input" name="path" value="/da-sites/bacom" />
<button class="da-btn-primary" .disabled=${!this._canSubmit}>Crawl</button>
<button class="da-btn-secondary">Cancel</button>
</form>
${this._files ? this.renderFiles() : nothing}
`;
Expand Down
3 changes: 1 addition & 2 deletions nx2/scripts/nx.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
*/

const LOG = async (ex, el) => (await import('../utils/error.js')).default(ex, el);

const NX_BLOCKS = new Set(['importer', 'site-apps', 'hero', 'card', 'section-metadata', 'schema-editor', 'media-library', 'form', 'permissions', 'snapshot-admin']);
const NX_BLOCKS = new Set(['importer', 'site-apps', 'hero', 'card', 'section-metadata', 'schema-editor', 'media-library', 'form', 'tree', 'permissions', 'snapshot-admin']);

const EW_ORIGINS = {
dev: 'http://localhost:3001',
Expand Down
Loading