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
9 changes: 1 addition & 8 deletions apps/desktop/src/components/v3/FileList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,7 @@
<!-- We need to use sortedChanges here because otherwise we will end up
with incorrect indexes -->
{@const node = abbreviateFolders(changesToFileTree(sortedChanges))}
<FileTreeNode
isRoot
{stackId}
{node}
{showCheckboxes}
changes={sortedChanges}
{fileTemplate}
/>
<FileTreeNode isRoot {stackId} {node} {showCheckboxes} {fileTemplate} />
{:else}
<LazyloadContainer
minTriggerCount={80}
Expand Down
22 changes: 3 additions & 19 deletions apps/desktop/src/components/v3/FileTreeNode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@
node: TreeNode;
isRoot?: boolean;
showCheckboxes?: boolean;
changes: TreeChange[];
depth?: number;
initiallyExpanded?: boolean;
fileTemplate: Snippet<[TreeChange, number, number]>;
};

let {
stackId,
node,
isRoot = false,
showCheckboxes,
changes,
depth = 0,
fileTemplate
}: Props = $props();
let { stackId, node, isRoot = false, showCheckboxes, depth = 0, fileTemplate }: Props = $props();

// Local state to track whether the folder is expanded
let isExpanded = $state<boolean>(true);
Expand All @@ -40,7 +31,7 @@
{#if isRoot}
<!-- Node is a root and should only render children! -->
{#each node.children as childNode (childNode.name)}
<Self {stackId} {depth} node={childNode} {showCheckboxes} {changes} {fileTemplate} />
<Self {stackId} {depth} node={childNode} {showCheckboxes} {fileTemplate} />
{/each}
{:else if node.kind === 'file'}
{@render fileTemplate(node.change, node.index, depth)}
Expand All @@ -58,14 +49,7 @@
{#if isExpanded}
<AsyncRender>
{#each node.children as childNode (childNode.name)}
<Self
{stackId}
depth={depth + 1}
node={childNode}
{showCheckboxes}
{changes}
{fileTemplate}
/>
<Self {stackId} depth={depth + 1} node={childNode} {showCheckboxes} {fileTemplate} />
{/each}
</AsyncRender>
{/if}
Expand Down
Loading