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
6 changes: 5 additions & 1 deletion app/src/renderer/Core/Core.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@

unsubs.push(handlePreloadEvents())

await checkAndCreateDemoItems()
try {
await checkAndCreateDemoItems()
} catch (err) {
log.error('Error creating demo items:', err)
}
// cleanup temporary resources created for chat
await resourceManager.deleteResourcesByTags([ResourceTag.createdForChat(true)])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@
</h3>
<SearchInput bind:value={searchQuery} />
</header>

<div class="categories-scroll-container" bind:this={categoryScrollContainer}>
<div class="categories-scroll-content">
{#each categories as category}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}
</script>

<div class="dialog-backdrop" onclick={handleClose}></div>
<div class="dialog-backdrop"></div>
<dialog open>
<header>
{#if mode === 'edit'}
Expand Down Expand Up @@ -182,14 +182,16 @@
z-index: 10000;
background: light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.3));
backdrop-filter: blur(1px);
max-width: none !important;
}

dialog {
position: fixed;
z-index: 10001;
inset: 0;

margin: 0 auto;
margin-top: 10%;
margin-top: 15% !important;
width: 100%;
max-width: 70ch;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

<style lang="scss">
.sidecar {
position: absolute;
top: 0;
left: calc(100% + 3.5rem);
max-width: 400px;
position: relative;
margin-bottom: 2rem !important;
width: 100%;
border: 1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(71, 85, 105, 0.3));
border-radius: 12px;
Expand All @@ -25,21 +23,10 @@
&:hover {
opacity: 1;
}
}

@media screen and (max-width: 1590px) {
.sidecar {
top: unset;
left: unset;
position: relative;
margin-top: 2rem;
margin-left: 1rem;
max-width: unset;

:global(li) {
max-width: 430px;
max-height: 4rem;
}
:global(li) {
max-width: 430px;
max-height: 4rem;
}
}
</style>
9 changes: 4 additions & 5 deletions app/src/renderer/Resource/routes/IndexRoute.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@

{#if $ttyQuery.length <= 0}
<section class="contents-wrapper">
{#if viewLocation === ViewLocation.Tab && $ttyQuery.length <= 0}
<NotebookSidecarExample onselect={handleRunExample} />
{/if}

<NotebookContents />
</section>
{/if}

{#if viewLocation === ViewLocation.Tab && $ttyQuery.length <= 0}
<NotebookSidecarExample onselect={handleRunExample} />
{/if}
</main>

<!-- <NotebookSidebar title="Surf" bind:open={resourcesPanelOpen} /> -->
Expand All @@ -282,7 +282,6 @@
flex-shrink: 1;
padding-inline: 0.5rem;

transform: translateY(0px);
transition:
opacity 223ms ease-out,
transform 223ms ease-out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
section {
padding-inline: 12px;

transform: translateY(0px);
transition:
opacity 223ms ease-out,
transform 223ms ease-out;
Expand Down
25 changes: 17 additions & 8 deletions packages/services/src/lib/demoitems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,23 @@ export async function createDemoNote(note: DemoNote, notebook: Notebook) {
const notebookManager = useNotebookManager()
const resourceManager = useResourceManager()

const existingOnboardingNotes = await resourceManager.listResourcesByTags([
SearchResourceTags.Deleted(false),
SearchResourceTags.ResourceType(ResourceTypes.DOCUMENT_SPACE_NOTE),
SearchResourceTags.Onboarding(note.id)
])

if (existingOnboardingNotes.length > 0) {
const resource = existingOnboardingNotes[0] as ResourceNote
const existingOnboardingNotes = await resourceManager.listResourcesByTags(
[
SearchResourceTags.Deleted(false),
SearchResourceTags.ResourceType(ResourceTypes.DOCUMENT_SPACE_NOTE),
SearchResourceTags.Onboarding(note.id)
],
{
limit: 1
}
)

if (!existingOnboardingNotes) {
throw new Error('Failed to list existing onboarding notes')
}

if (existingOnboardingNotes.items.length > 0) {
const resource = existingOnboardingNotes.items[0] as ResourceNote
log.debug('Onboarding note already exists, skipping creation', note, resource.id)

await resource.updateContent(note.content)
Expand Down