Skip to content

add preview project block from soup and project block#536

Merged
aquaductape merged 16 commits intomainfrom
Caleb/m-5375-support-folder-preview-mode
Jan 14, 2026
Merged

add preview project block from soup and project block#536
aquaductape merged 16 commits intomainfrom
Caleb/m-5375-support-folder-preview-mode

Conversation

@aquaductape
Copy link
Copy Markdown
Contributor

@aquaductape aquaductape commented Dec 10, 2025

  • enable preview when project entity is selected in unified-list
  • add preview project block

@aquaductape aquaductape requested a review from a team as a code owner December 10, 2025 21:31
@linear
Copy link
Copy Markdown

linear bot commented Dec 10, 2025

@aquaductape aquaductape changed the title support previewing project block from soup and project block add preview project block from soup and project block Dec 10, 2025
@gbirman
Copy link
Copy Markdown
Contributor

gbirman commented Dec 11, 2025

@aquaductape taking a look now

Copy link
Copy Markdown
Contributor

@gbirman gbirman left a comment

Choose a reason for hiding this comment

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

issues:

  • duplicate share buttons ( see below). this messed up tool bar exists for all previewed files/folders in project block because the share button will occupy full width but the filter/display buttons are only over the unified list view + we have two competing top bars. im not sure what ppl want from the ui exactly but can u sync with @synoet for what we should be doing because it's too jank atm
Image

@aquaductape aquaductape marked this pull request as draft December 23, 2025 22:02
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 8, 2026

@aquaductape aquaductape marked this pull request as ready for review January 9, 2026 23:34
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 9, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 9, 2026

Code review

Found 1 issue:

Conditional Hook Calls Violate Solid.js Patterns

File: js/app/packages/app/component/PreviewPanel.tsx (lines 43-77)

Issue: Hooks are called inside a conditional block that depends on props.selectedEntity.type. In Solid.js, component bodies run only once during initialization - they do not re-run when props change.

This means:

  • If a non-project entity is selected first, these hooks will never be initialized
  • If the entity type changes from project to non-project (or vice versa) while the component is mounted, the hooks will be in an inconsistent state

Lines 43-77 contain multiple hooks called inside if (props.selectedEntity.type === 'project'):

  • useSplitLayout() (line 44)
  • createSoupContext() (line 45)
  • useHotkeyDOMScope() (line 51)
  • createSignal() (line 55)
  • createMemo() (line 56)
  • createNavigationEntityListShortcut() (line 63)
  • onMount() (line 74)

Suggested fix: Extract the project-specific logic into a separate component and use <Show> or <Switch> to conditionally render it.

Reference:

if (props.selectedEntity.type === 'project') {
const { getSplitCount } = useSplitLayout();
const soupContext = createSoupContext({
isRenderedFromPreview: true,
parentContext: splitPanelContext.soupContext,
domRef: containerRef,
});
const [attachHotKeys, splitHotkeyScope] = useHotkeyDOMScope(
`split=${splitPanelContext.splitHotkeyScope}`
);
const [previewState, setPreviewState] = createSignal(false);
const splitName = createMemo(() => {
const { type, id } = splitPanelContext.handle.content();
if (type === 'component') return id;
return type;
});
createNavigationEntityListShortcut({
splitName,
splitHandle: splitPanelContext.handle,
splitHotkeyScope,
soupContext,
previewState: [previewState, setPreviewState],
getSplitCount: getSplitCount,
});
scopedSplitPanelContextType.soupContext = soupContext;
scopedSplitPanelContextType.previewState = [previewState, setPreviewState];
onMount(() => {
attachHotKeys(containerRef()!);
});
}

@aquaductape aquaductape dismissed gbirman’s stale review January 13, 2026 23:58

approved by rahul

@aquaductape aquaductape merged commit 2d0615e into main Jan 14, 2026
22 checks passed
@aquaductape aquaductape deleted the Caleb/m-5375-support-folder-preview-mode branch January 14, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants