Skip to content
Merged
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
10 changes: 7 additions & 3 deletions app/components/DemoStage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ const liveUrl = computed(() => live && !demo.video && !demo.writing ? demo.liveU
<div v-if="presentation !== 'hero'" class="demo-stage__head">
<details v-if="showPrompt && presentation === 'compact'" class="demo-stage__task">
<summary class="data-label">
<span>Prompt</span>
<DemoRecording :demo />
<h2 class="data-label inline-flex min-w-0 flex-wrap items-baseline gap-3 font-normal">
<span>Prompt</span>
<DemoRecording :demo />
</h2>
</summary>
<p v-if="recording.usage" class="data-label demo-stage__usage">
{{ recording.usage.sentence }}
Expand All @@ -58,7 +60,9 @@ const liveUrl = computed(() => live && !demo.video && !demo.writing ? demo.liveU
</div>
<details v-if="showPrompt && presentation === 'full'" class="demo-stage__task demo-stage__task--full">
<summary class="data-label">
Prompt
<h2 class="data-label font-normal">
Prompt
</h2>
</summary>
<p class="demo-stage__prompt">
{{ demo.prompt }}
Expand Down
16 changes: 12 additions & 4 deletions layers/registry/app/components/SkillFileTreeNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ const emit = defineEmits<{
select: [path: string]
}>()

const open = ref(props.node.kind === 'dir' && props.node.initiallyOpen)
// Mount a folder's entries on first expansion. Keep them after closing so
// nested expansion state survives, without sending unopened files in HTML.
const folderState = ref<'unopened' | 'open' | 'closed'>(
props.node.kind === 'dir' && props.node.initiallyOpen ? 'open' : 'unopened',
)
const open = computed(() => folderState.value === 'open')
const renderedChildren = computed(() =>
props.node.kind === 'dir' && folderState.value !== 'unopened' ? props.node.children : [],
)

// Opening a file from a link or the breadcrumb reveals it in the tree.
watch(() => props.activePath, (active) => {
if (props.node.kind === 'dir' && active.startsWith(`${props.node.path}/`))
open.value = true
folderState.value = 'open'
}, { immediate: true })

function countFiles(node: TreeNode): number {
Expand Down Expand Up @@ -72,7 +80,7 @@ const inlineRenderable = computed(() =>
:aria-expanded="open"
:aria-controls="`${idPrefix}-${node.path}`"
:title="node.path"
@click="open = !open"
@click="folderState = open ? 'closed' : 'open'"
>
<SkillFileIcon
:name="open ? 'default-folder-opened' : 'default-folder'"
Expand Down Expand Up @@ -101,7 +109,7 @@ const inlineRenderable = computed(() =>
class="tree-children"
>
<SkillFileTreeNode
v-for="child in node.children"
v-for="child in renderedChildren"
:key="child.path"
:node="child"
:owner="owner"
Expand Down
Loading