Skip to content

New layout playground - #869

Draft
SharonStrats wants to merge 15 commits into
stagingfrom
new-layout-playground
Draft

SharonStrats wants to merge 15 commits into
stagingfrom
new-layout-playground

Conversation

@SharonStrats

Copy link
Copy Markdown
Collaborator

No description provided.

@SharonStrats

SharonStrats commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

@NoelDeMartin so here I added to the solid-ui-provider. I also extended the menu to allow me to change the font size and gap because the 3 dot menu has different styling. And oops I'm tired 😅 I just realized this is where I have moved the file explorer web components so I can use them in both solid-panes and folder-pane.

Highlevel for providers we have
solid-ui-provider. (auth, and I thought we should add store here which I've done)
file-explorer-provider
storage-pane-provider. (and source-pane-provider) sitting at this same level

@NoelDeMartin NoelDeMartin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have added a bunch of comments about specific things to improve, but in general I think it's looking good and using the Design System components correctly :).

The only thing I wonder is whether the file explorer should really be a component from solid-ui, or a dedicated pane. Either way, I think everything should be as encapsulated as possible. In general, I think it's better to expose as little public API as possible and just expose helpers or reusable functionality as necessary. Otherwise, you risk breaking dependencies if you later want to refactor something that should have been internal.

Comment thread src/components/file-explorer-header/FileExplorerProvider.ts
Comment thread src/components/file-explorer-header/index.ts
Comment thread src/components/resource-actions-menu/ResourceActionsMenu.ts

let icon: HTMLElement | undefined
if (pane.name === 'profile') {
icon = dom.createElement('icon-lucide-user')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should avoid using this imperative API. Instead, the icons can be rendered like this:

html`<icon-lucide-user slot="left-icon"></icon-lucide-user>`

Other than that, I don't see ~icons/lucide/user being imported in this file. Components should always be imported where they are declared (same for the users icon down below, etc.).

Comment thread src/components/file-explorer-header/FileExplorerProvider.ts
Comment thread src/components/menu-item/MenuItem.styles.css
Comment thread src/components/resource-actions-menu/ResourceActionsMenu.styles.css
menuItems?: ResourceActionMenuItem[]
}

export function getVisibleResourceActions (options: ResourceActionsMenuOptions): ResourceActionMenuItem[] {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this exported to the public and in a separate file? Couldn't it be just a private method in the component?

private: boolean
}

export async function loadDiscoveryState (subject: NamedNode): Promise<DiscoveryState> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure why this and the resource-actions-menu.ts helpers are exported from the library, and even declared outside of the component folders. Shouldn't these be internal helpers for the file explorer components?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll take a look at what you are saying. I had to have this in 2 places folder-pane and solid-panes if I remember right htat is why, but I'll see if I can do that better.

panes: Array<PaneDefinition> = context.session.paneRegistry.list
): Promise<Array<PaneDefinition>> {
const relevantPaneCandidates = panes.filter(
(pane) => pane.label(subject, context) && !pane.global && pane.name !== 'sharing'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure this is the best way to get the relevant pane, what if a pane has a fallback label for unknown subjects such as "Unknown"? I'm not super familiar with how components are resolved, or how do we decide which pane should be used to render a certain subject. But I think it should be more robust that just looking for an empty label.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I will have a look. I took this code how it was.

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Critical and moderate correctness, accessibility, registration, and build issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 High severity · 4 Medium severity

Open (7)
What changed in this PR

Adds a file-explorer layout playground with reusable headers, resource actions, discovery controls, and shared RDF store context.

Changes:

  • Adds file-explorer header, provider, metadata, and styling components.
  • Introduces resource-action and discovery APIs.
  • Updates store context, exports, typings, tests, Storybook, and dependencies.
File Reviewed change
test/​unit/​index.test.ts Updates root export expectations.
src/​types/​custom-elements.d.ts Adds custom-element typings.
src/​styles/​theme.css Adds gray theme tokens.
src/​storybook/​store/​StorybookStore.ts Simplifies Storybook store creation.
src/​storybook/​components/​StorybookProvider.ts Provides the shared store context.
src/​lib/​store/​NoopStore.ts Adds a no-op store.
src/​lib/​store/​index.ts Exports store APIs.
src/​lib/​store/​context.ts Defines store context.
src/​lib/​resource-actions-menu.ts Adds resource action bindings.
src/​lib/​forms/​store/​StoreContext.ts Removes the old store context.
src/​lib/​forms/​store/​NoopStore.ts Removes the old no-op store.
src/​lib/​file-explorer/​relevant-panes.ts Resolves relevant panes.
src/​lib/​file-explorer/​context.ts Extends explorer context data.
src/​lib/​discovery/​index.ts Exports discovery APIs.
src/​lib/​discovery/​discovery.ts Adds discovery state management.
src/​index.ts Exports new public APIs.
src/​components/​resource-actions-menu/​ResourceActionsMenu.ts Implements the resource action menu.
src/​components/​resource-actions-menu/​ResourceActionsMenu.styles.css Styles the action menu.
src/​components/​resource-actions-menu/​index.ts Exports action-menu APIs.
src/​components/​resource-actions-menu/​helpers.ts Builds menu actions.
src/​components/​rdf-input/​RDFInput.ts Migrates to shared store context.
src/​components/​rdf-form/​RDFForm.ts Migrates to shared store context.
src/​components/​provider/​Provider.ts Provides the application store.
src/​components/​menu/​Menu.styles.css Adds configurable menu width.
src/​components/​menu-item/​MenuItem.styles.css Adds configurable item styling.
src/​components/​file-explorer-header/​types.ts Defines header metadata types.
src/​components/​file-explorer-header/​metadata.ts Adds metadata utilities.
src/​components/​file-explorer-header/​index.ts Exports header components.
src/​components/​file-explorer-header/​FileExplorerProvider.ts Provides header and pane context.
src/​components/​file-explorer-header/​FileExplorerProvider.styles.css Styles the provider layout.
src/​components/​file-explorer-header/​FileExplorerHeaderSummary.ts Renders resource summaries.
src/​components/​file-explorer-header/​FileExplorerHeaderSummary.styles.css Styles resource summaries.
src/​components/​file-explorer-header/​FileExplorerHeaderControls.ts Implements header controls.
src/​components/​file-explorer-header/​FileExplorerHeaderControls.styles.css Styles header controls.
src/​components/​file-explorer-header/​FileExplorerHeader.ts Implements metadata loading and header composition.
src/​components/​file-explorer-header/​FileExplorerHeader.styles.css Styles the header container.
package.json Bumps the package version.
package-lock.json Updates locked dependencies and metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +4 to +6
import 'solid-ui/components/button'
import 'solid-ui/components/menu'
import 'solid-ui/components/menu-item'
Comment on lines +21 to +22
if (filteredPanes.length === 0) {
return relevantPaneCandidates.length > 0 ? [relevantPaneCandidates[0]] : []
Comment on lines +32 to +34
return firstRelevantPaneIndex < firstFilteredPaneIndex
? [relevantPaneCandidates[0]].concat(filteredPanes)
: filteredPanes
Comment on lines +74 to +81
const metadata = await solidLogicSingleton.resource.fetchMetadata(sym(this.fileExplorerContext.subjectUri))
this.responseMetadata = {
modified: metadata.modified,
isPublic: metadata.access.isPublic,
canEdit: metadata.access.canEdit,
canDelete: metadata.access.canDelete,
aclUri: metadata.aclUri
}
Comment on lines +79 to +82
if (this.paneIcon !== undefined && this._resolvedPaneIconFor !== this.paneIcon) {
this._resolvedPaneIconFor = this.paneIcon
this.resolvePaneIcon()
}
Comment on lines +210 to +213
const subject = store.sym(this.subjectUri)
const menuItems = await this.getPaneItems(subject, this.context as DataBrowserContext, this.relevantPanes)

this.menuItems = menuItems
Comment on lines +41 to +55
visibleItems.push({
kind: 'custom',
label: options.discoverPublicly ? 'Undiscover Publicly' : 'Discover Publicly',
icon: createDiscoveryIcon('icon-lucide-globe'),
action: options.handleDiscoverPublicClick ?? (() => {
}),
})

visibleItems.push({
kind: 'custom',
label: options.discoverPrivately ? 'Undiscover Privately' : 'Discover Privately',
icon: createDiscoveryIcon('icon-lucide-lock-keyhole'),
action: options.handleDiscoverPrivateClick ?? (() => {
}),
})

This branch has not been deployed

No deployments
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.

3 participants