mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-28 16:06:22 +00:00
feat: align the composer chat icon, share the folder row, add a home preview page
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
08ae81da4c
commit
96b7e96381
@@ -1508,7 +1508,8 @@
|
||||
{onKeyDown}
|
||||
className={twMerge(
|
||||
oneLine ? '!pl-4 !pr-2 !py-3' : toolbarInBox ? FIELD_PADDING_WITH_TOOLBAR : '',
|
||||
chatIcon && '!pl-2'
|
||||
// A set line height, not the font's own: the chat icon is placed against it.
|
||||
chatIcon && '!pl-2 !leading-5'
|
||||
)}
|
||||
>
|
||||
{#snippet leading()}
|
||||
|
||||
@@ -813,10 +813,14 @@
|
||||
self-guards (renders nothing when empty) so no blank row appears. -->
|
||||
{@render leading?.()}
|
||||
{#if chatIcon}
|
||||
<!-- The same mark as the "open in chat" buttons. On the field's first line: centred on the
|
||||
one-line box, level with the first line of text once it opens. -->
|
||||
<div class="flex {oneLine ? 'flex-1 min-w-0 items-center' : 'items-start'}">
|
||||
<MessagesSquare size={16} class="shrink-0 ml-4 text-ai {oneLine ? '' : 'mt-3.5'}" />
|
||||
<!-- The same mark as the "open in chat" buttons, centred on the field's first text line in
|
||||
both shapes: the slot is that line (1px border + 12px padding down, 20px tall), so it
|
||||
relies on the field's `!py-3`/`!pt-3` and the `leading-5` set alongside `chatIcon`.
|
||||
Centring on the field box instead follows its autosized height, which varies. -->
|
||||
<div class="flex items-start {oneLine ? 'flex-1 min-w-0' : ''}">
|
||||
<span class="flex items-center h-5 mt-[13px] ml-4 shrink-0">
|
||||
<MessagesSquare size={16} class="text-ai" />
|
||||
</span>
|
||||
{@render field()}
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { WorkspaceService } from '$lib/gen'
|
||||
import { copilotWorkspace, setCopilotInfo } from '$lib/aiStore'
|
||||
import { workspaceAIClients } from './lib'
|
||||
import { writable } from 'svelte/store'
|
||||
import { previewAiConfig } from '$lib/devPreview'
|
||||
|
||||
// The workspace of the most recent loadCopilot *request*, set synchronously before the
|
||||
// await — as opposed to `copilotWorkspace`, which only updates once a load resolves. A
|
||||
@@ -44,7 +45,7 @@ export function loadCopilot(workspace: string): Promise<void> {
|
||||
async function fetchAndApply(workspace: string, token: number) {
|
||||
workspaceAIClients.init(workspace)
|
||||
try {
|
||||
const info = await WorkspaceService.getCopilotInfo({ workspace })
|
||||
const info = previewAiConfig(await WorkspaceService.getCopilotInfo({ workspace }))
|
||||
if (token !== loadCopilotToken) return
|
||||
setCopilotInfo(info)
|
||||
copilotWorkspace.set(workspace)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
import DropdownV2 from '$lib/components/DropdownV2.svelte'
|
||||
import { pageHeader } from '$lib/components/pageHeaderRegistry.svelte'
|
||||
import { prefetchItemCount } from '../copilot/chat/starter/starterPrompts.svelte'
|
||||
import { previewAiConfig } from '$lib/devPreview'
|
||||
|
||||
const COLLAPSED_SETTING = 'home-ai-composer-collapsed'
|
||||
|
||||
@@ -107,7 +108,9 @@
|
||||
if (!workspace) return false
|
||||
let hidden = false
|
||||
try {
|
||||
hidden = (await WorkspaceService.getCopilotInfo({ workspace })).copilot_disabled === true
|
||||
hidden =
|
||||
previewAiConfig(await WorkspaceService.getCopilotInfo({ workspace })).copilot_disabled ===
|
||||
true
|
||||
} catch (e) {
|
||||
console.error(`Failed to read the AI config of workspace ${workspace}:`, e)
|
||||
}
|
||||
|
||||
@@ -2134,7 +2134,7 @@
|
||||
{/each}
|
||||
</div>
|
||||
{#if items && hasMore}
|
||||
<span class="block px-4 py-2 border-t text-xs font-normal text-secondary"
|
||||
<span class="block px-4 py-2 border-t text-center text-xs font-normal text-secondary"
|
||||
>{Math.min(nbDisplayed, items.length)} items{hasMoreServer && !searching
|
||||
? ''
|
||||
: ` out of ${items.length}`}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<script lang="ts">
|
||||
import { ChevronDown, ChevronUp } from 'lucide-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
|
||||
/** A row of the tree that groups others under it (a folder, a user, "Other users"): clicking
|
||||
* anywhere on it opens or closes what it groups. */
|
||||
interface Props {
|
||||
icon: any
|
||||
name: string
|
||||
opened: boolean
|
||||
onToggle: () => void
|
||||
/** Extra left padding in px, for a nested folder. */
|
||||
indent?: number
|
||||
/** The toggle's accessible name; the row's name when unset. */
|
||||
toggleLabel?: string
|
||||
/** The line under the name, usually its item count. */
|
||||
detail: Snippet
|
||||
}
|
||||
|
||||
let { icon: Icon, name, opened, onToggle, indent = 0, toggleLabel, detail }: Props = $props()
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
onclick={onToggle}
|
||||
data-list-row
|
||||
class="px-4 py-2 border-b w-full flex flex-row items-center justify-between cursor-pointer hover:bg-surface-hover"
|
||||
>
|
||||
<div
|
||||
class="flex flex-row items-center gap-4"
|
||||
style={indent > 0 ? `padding-left: ${indent}px;` : ''}
|
||||
>
|
||||
<Icon size={16} class="text-secondary shrink-0" />
|
||||
<div>
|
||||
<span class="whitespace-nowrap text-xs text-emphasis font-semibold">{name}</span>
|
||||
<div class="text-2xs font-normal text-secondary whitespace-nowrap">
|
||||
{@render detail()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Keyboard access only: its click bubbles to the row, which does the toggling. -->
|
||||
<button
|
||||
class="w-full flex flex-row-reverse"
|
||||
aria-expanded={opened}
|
||||
aria-label={toggleLabel ?? name}
|
||||
>
|
||||
{#if opened}
|
||||
<ChevronUp size={16} />
|
||||
{:else}
|
||||
<ChevronDown size={16} />
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -3,11 +3,11 @@
|
||||
import { createEventDispatcher, onDestroy, untrack, type Snippet } from 'svelte'
|
||||
import ResizeTransitionWrapper from '$lib/components/common/ResizeTransitionWrapper.svelte'
|
||||
|
||||
import { ChevronDown, ChevronUp, Folder, FolderTree, User } from 'lucide-svelte'
|
||||
import { Folder, FolderTree, User } from 'lucide-svelte'
|
||||
import TreeOwnerRow from './TreeOwnerRow.svelte'
|
||||
import PipelineRow from '../common/table/PipelineRow.svelte'
|
||||
import Item from './Item.svelte'
|
||||
import { countLeaves, type FolderItem, type ItemType, type UserItem } from './treeViewUtils'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
import { pluralize } from '$lib/utils'
|
||||
import { Button } from '$lib/components/common'
|
||||
|
||||
@@ -262,57 +262,30 @@
|
||||
|
||||
{#if isFolder(item) || isUser(item)}
|
||||
<div>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
onclick={toggleOwner}
|
||||
data-list-row
|
||||
class="px-4 py-2 border-b w-full flex flex-row items-center justify-between cursor-pointer hover:bg-surface-hover"
|
||||
<TreeOwnerRow
|
||||
icon={isUser(item) ? User : depth === 0 ? Folder : FolderTree}
|
||||
name={isUser(item) ? `u/${item.username}` : `${depth === 0 ? 'f/' : ''}${item.folderName}`}
|
||||
{opened}
|
||||
onToggle={toggleOwner}
|
||||
indent={visualDepth * 16}
|
||||
>
|
||||
<div
|
||||
class={twMerge('flex flex-row items-center gap-4 text-sm font-semibold')}
|
||||
style={visualDepth > 0 ? `padding-left: ${visualDepth * 16}px;` : ''}
|
||||
>
|
||||
<div class="flex justify-center items-center">
|
||||
{#if isUser(item)}
|
||||
<User size={16} class="text-secondary" />
|
||||
{:else if depth === 0}
|
||||
<Folder size={16} class="text-secondary" />
|
||||
{:else}
|
||||
<FolderTree size={16} class="text-secondary" />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="whitespace-nowrap text-xs text-emphasis font-semibold">
|
||||
{#if isUser(item)}u/{item.username}{:else}{#if depth === 0}f/{/if}{item.folderName}{/if}
|
||||
</span>
|
||||
<div class="text-2xs font-normal text-secondary whitespace-nowrap">
|
||||
{#if ownerCount != undefined}
|
||||
({pluralize(ownerCount, ' item')})
|
||||
{:else if isLazyOwner && !ownerState?.loaded}
|
||||
<!-- Lazy owner not expanded yet and no count for it: its true item count
|
||||
is unknown until loaded, so showing "(0 items)" would be misleading. -->
|
||||
|
||||
{:else if nodeHasMore}
|
||||
<!-- Partial: this node still has pages to load (its own once it has been
|
||||
loaded directly, otherwise its ancestor's), so what is grouped under
|
||||
it is only what has arrived so far. -->
|
||||
({loadedHere}+ items)
|
||||
{:else}
|
||||
({pluralize(loadedHere, ' item')})
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="w-full flex flex-row-reverse">
|
||||
{#if opened}
|
||||
<ChevronUp size={16} />
|
||||
{#snippet detail()}
|
||||
{#if ownerCount != undefined}
|
||||
({pluralize(ownerCount, ' item')})
|
||||
{:else if isLazyOwner && !ownerState?.loaded}
|
||||
<!-- Lazy owner not expanded yet and no count for it: its true item count
|
||||
is unknown until loaded, so showing "(0 items)" would be misleading. -->
|
||||
|
||||
{:else if nodeHasMore}
|
||||
<!-- Partial: this node still has pages to load (its own once it has been
|
||||
loaded directly, otherwise its ancestor's), so what is grouped under
|
||||
it is only what has arrived so far. -->
|
||||
({loadedHere}+ items)
|
||||
{:else}
|
||||
<ChevronDown size={16} />
|
||||
({pluralize(loadedHere, ' item')})
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
{/snippet}
|
||||
</TreeOwnerRow>
|
||||
<!-- ResizeObserver, not a slide: a freshly-opened owner fetches its rows, so its height
|
||||
changes twice (open-empty, then rows land) and a slide would only animate the first. -->
|
||||
<ResizeTransitionWrapper vertical innerClass="w-full">
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
import TreeView from './TreeView.svelte'
|
||||
import { countLeaves, groupItems, type ItemType, type UserItem } from './treeViewUtils'
|
||||
import { Button } from '$lib/components/common'
|
||||
import { ChevronDown, ChevronUp, Users } from 'lucide-svelte'
|
||||
import { Users } from 'lucide-svelte'
|
||||
import TreeOwnerRow from './TreeOwnerRow.svelte'
|
||||
import { getLocalSetting, pluralize, storeLocalSetting } from '$lib/utils'
|
||||
|
||||
interface Props {
|
||||
@@ -294,37 +295,19 @@
|
||||
{#if row.kind === 'otherUsers'}
|
||||
<!-- Same shape as an owner row, so it reads as part of the tree. It only reveals
|
||||
the user rows under it: each still loads its own items when opened. -->
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
onclick={toggleOtherUsers}
|
||||
data-list-row
|
||||
class="px-4 py-2 border-b w-full flex flex-row items-center justify-between cursor-pointer hover:bg-surface-hover"
|
||||
<TreeOwnerRow
|
||||
icon={Users}
|
||||
name="Other users"
|
||||
opened={otherUsersOpen}
|
||||
onToggle={toggleOtherUsers}
|
||||
toggleLabel={otherUsersOpen ? 'Hide other users' : 'Show other users'}
|
||||
>
|
||||
<div class="flex flex-row items-center gap-4">
|
||||
<Users size={16} class="text-secondary" />
|
||||
<div>
|
||||
<span class="whitespace-nowrap text-xs text-emphasis font-semibold"
|
||||
>Other users</span
|
||||
>
|
||||
<div class="text-2xs font-normal text-secondary whitespace-nowrap">
|
||||
({pluralize(otherUsers.length, 'user')}{otherUsersItemCount != undefined
|
||||
? ` · ${pluralize(otherUsersItemCount, 'item')}`
|
||||
: ''})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
iconOnly
|
||||
unifiedSize="xs"
|
||||
variant="subtle"
|
||||
startIcon={{ icon: otherUsersOpen ? ChevronUp : ChevronDown }}
|
||||
title={otherUsersOpen ? 'Hide other users' : 'Show other users'}
|
||||
aria-label="Other users"
|
||||
aria-expanded={otherUsersOpen}
|
||||
onClick={toggleOtherUsers}
|
||||
/>
|
||||
</div>
|
||||
{#snippet detail()}
|
||||
({pluralize(otherUsers.length, 'user')}{otherUsersItemCount != undefined
|
||||
? ` · ${pluralize(otherUsersItemCount, 'item')}`
|
||||
: ''})
|
||||
{/snippet}
|
||||
</TreeOwnerRow>
|
||||
{#if otherUsersOpen}
|
||||
<!-- Ranked after every root owner, so opening this row can't push folders out
|
||||
of what "expand all" auto-loads. -->
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import type { AIConfig } from './gen'
|
||||
|
||||
/**
|
||||
* Dev only: how this browser pretends the workspace's AI is set up, so the states a fresh
|
||||
* cloud workspace goes through can be seen without reconfiguring one. Set from the
|
||||
* `/kitchen_sink/home_preview` page; read nowhere in a production build.
|
||||
*/
|
||||
export type DevAiState = 'real' | 'free-tier' | 'free-tier-exhausted' | 'no-key' | 'hidden'
|
||||
|
||||
export type DevPreview = { ai: DevAiState; freeTierUsedPct: number }
|
||||
|
||||
const KEY = 'devPreview'
|
||||
|
||||
export function readDevPreview(): DevPreview | undefined {
|
||||
if (!import.meta.env.DEV) return undefined
|
||||
try {
|
||||
const raw = globalThis.window?.localStorage?.getItem(KEY)
|
||||
return raw ? (JSON.parse(raw) as DevPreview) : undefined
|
||||
} catch {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
export function writeDevPreview(preview: DevPreview | undefined): void {
|
||||
try {
|
||||
if (preview && preview.ai !== 'real') localStorage.setItem(KEY, JSON.stringify(preview))
|
||||
else localStorage.removeItem(KEY)
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** The workspace's AI config as the preview pretends it is; unchanged outside dev. */
|
||||
export function previewAiConfig(config: AIConfig): AIConfig {
|
||||
const preview = readDevPreview()
|
||||
switch (preview?.ai) {
|
||||
case 'free-tier':
|
||||
return {
|
||||
...config,
|
||||
free_tier: { exhausted: false, used_ratio: preview.freeTierUsedPct / 100 }
|
||||
}
|
||||
case 'free-tier-exhausted':
|
||||
return { ...config, providers: {}, free_tier: { exhausted: true, used_ratio: 1 } }
|
||||
case 'no-key':
|
||||
return { ...config, providers: {}, free_tier: undefined }
|
||||
case 'hidden':
|
||||
return { ...config, copilot_disabled: true }
|
||||
default:
|
||||
return config
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte'
|
||||
import { RotateCw, SquareArrowOutUpRight } from 'lucide-svelte'
|
||||
import { WorkspaceService } from '$lib/gen'
|
||||
import { Button } from '$lib/components/common'
|
||||
import Select from '$lib/components/select/Select.svelte'
|
||||
import Toggle from '$lib/components/Toggle.svelte'
|
||||
import ToggleButtonGroup from '$lib/components/common/toggleButton-v2/ToggleButtonGroup.svelte'
|
||||
import ToggleButton from '$lib/components/common/toggleButton-v2/ToggleButton.svelte'
|
||||
import DarkModeToggle from '$lib/components/sidebar/DarkModeToggle.svelte'
|
||||
import { readDevPreview, writeDevPreview, type DevAiState } from '$lib/devPreview'
|
||||
|
||||
// Home as a given account would see it, in a frame beside the controls: the real page,
|
||||
// told by this browser's dev overrides (`$lib/devPreview`, `cloudHostedOverride`) what to
|
||||
// pretend. Every change reloads the frame, since those overrides are read at load.
|
||||
|
||||
const CLOUD_KEY = 'cloudHostedOverride'
|
||||
const UNPINNED_KEY = 'home-ai-composer-collapsed'
|
||||
|
||||
const AI_STATES: { value: DevAiState; label: string }[] = [
|
||||
{ value: 'real', label: "The workspace's real setup" },
|
||||
{ value: 'free-tier', label: 'Free Windmill AI, partly used' },
|
||||
{ value: 'free-tier-exhausted', label: 'Free Windmill AI, used up' },
|
||||
{ value: 'no-key', label: 'No AI key configured' },
|
||||
{ value: 'hidden', label: 'AI hidden in the workspace' }
|
||||
]
|
||||
const WIDTHS = [
|
||||
{ value: 'full', label: 'Full' },
|
||||
{ value: '1024', label: '1024' },
|
||||
{ value: '768', label: '768' },
|
||||
{ value: '400', label: '400' }
|
||||
]
|
||||
|
||||
function readStorage(key: string): string | null {
|
||||
try {
|
||||
return localStorage.getItem(key)
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
function writeStorage(key: string, value: string | undefined) {
|
||||
try {
|
||||
if (value === undefined) localStorage.removeItem(key)
|
||||
else localStorage.setItem(key, value)
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const initial = readDevPreview()
|
||||
let ai = $state<DevAiState>(initial?.ai ?? 'real')
|
||||
let usedPct = $state(initial?.freeTierUsedPct ?? 60)
|
||||
let cloud = $state(readStorage(CLOUD_KEY) === '1')
|
||||
let workspace = $state<string | undefined>(readStorage('workspace') ?? undefined)
|
||||
let width = $state('full')
|
||||
let workspaces = $state<{ label: string; value: string }[]>([])
|
||||
let reloadKey = $state(0)
|
||||
|
||||
let src = $derived(workspace ? `/?workspace=${encodeURIComponent(workspace)}` : '/')
|
||||
|
||||
function apply() {
|
||||
writeDevPreview({ ai, freeTierUsedPct: usedPct })
|
||||
writeStorage(CLOUD_KEY, cloud ? '1' : undefined)
|
||||
reloadKey++
|
||||
}
|
||||
|
||||
function showComposerAgain() {
|
||||
writeStorage(UNPINNED_KEY, undefined)
|
||||
reloadKey++
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
const list = await WorkspaceService.listUserWorkspaces()
|
||||
workspaces = list.workspaces.map((w) => ({ label: `${w.name} (${w.id})`, value: w.id }))
|
||||
})
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Home preview</title></svelte:head>
|
||||
|
||||
<div class="flex h-screen bg-surface-secondary text-primary">
|
||||
<aside class="w-72 shrink-0 border-r bg-surface flex flex-col gap-5 p-4 overflow-y-auto">
|
||||
<div class="flex items-center justify-between">
|
||||
<h1 class="text-sm font-semibold text-emphasis">Home preview</h1>
|
||||
<DarkModeToggle />
|
||||
</div>
|
||||
|
||||
{#if !import.meta.env.DEV}
|
||||
<p class="text-xs text-secondary">
|
||||
The overrides only work in a dev build (<code>npm run dev</code>).
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<section class="flex flex-col gap-1.5">
|
||||
<span class="text-xs font-semibold text-emphasis">Workspace</span>
|
||||
<Select
|
||||
items={workspaces}
|
||||
bind:value={
|
||||
() => workspace,
|
||||
(v) => {
|
||||
workspace = v
|
||||
reloadKey++
|
||||
}
|
||||
}
|
||||
placeholder="Pick a workspace"
|
||||
size="sm"
|
||||
/>
|
||||
<span class="text-2xs text-hint">
|
||||
An empty one (e.g. <code>empty</code>) shows the first-visit state.
|
||||
</span>
|
||||
</section>
|
||||
|
||||
<section class="flex flex-col gap-1.5">
|
||||
<span class="text-xs font-semibold text-emphasis">AI setup</span>
|
||||
<Select
|
||||
items={AI_STATES}
|
||||
bind:value={
|
||||
() => ai,
|
||||
(v) => {
|
||||
ai = v ?? 'real'
|
||||
apply()
|
||||
}
|
||||
}
|
||||
size="sm"
|
||||
/>
|
||||
{#if ai === 'free-tier'}
|
||||
<label class="flex flex-col gap-1 text-2xs text-secondary">
|
||||
<span>Used: {usedPct}%</span>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="99"
|
||||
bind:value={usedPct}
|
||||
onchange={apply}
|
||||
class="accent-[rgb(var(--color-accent))]"
|
||||
/>
|
||||
</label>
|
||||
<span class="text-2xs text-hint">
|
||||
Home hides the usage line; it shows in a session once it has a message.
|
||||
</span>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<section class="flex flex-col gap-1.5">
|
||||
<span class="text-xs font-semibold text-emphasis">Hosting</span>
|
||||
<Toggle
|
||||
size="sm"
|
||||
bind:checked={
|
||||
() => cloud,
|
||||
(v) => {
|
||||
cloud = v
|
||||
apply()
|
||||
}
|
||||
}
|
||||
options={{ right: 'Cloud (app.windmill.dev)' }}
|
||||
/>
|
||||
<span class="text-2xs text-hint">
|
||||
Cloud-only UI (quotas, upgrade) also needs a backend started with CLOUD_HOSTED.
|
||||
</span>
|
||||
</section>
|
||||
|
||||
<section class="flex flex-col gap-1.5">
|
||||
<span class="text-xs font-semibold text-emphasis">Frame width</span>
|
||||
<ToggleButtonGroup selected={width} onSelected={(v) => (width = v)}>
|
||||
{#snippet children({ item })}
|
||||
{#each WIDTHS as w (w.value)}
|
||||
<ToggleButton value={w.value} label={w.label} {item} size="sm" />
|
||||
{/each}
|
||||
{/snippet}
|
||||
</ToggleButtonGroup>
|
||||
</section>
|
||||
|
||||
<section class="flex flex-col gap-2">
|
||||
<Button
|
||||
unifiedSize="sm"
|
||||
variant="default"
|
||||
startIcon={{ icon: RotateCw }}
|
||||
onClick={() => reloadKey++}
|
||||
>
|
||||
Reload the frame
|
||||
</Button>
|
||||
<Button unifiedSize="sm" variant="subtle" onClick={showComposerAgain}>
|
||||
Show the composer again if unpinned
|
||||
</Button>
|
||||
<Button
|
||||
unifiedSize="sm"
|
||||
variant="subtle"
|
||||
startIcon={{ icon: SquareArrowOutUpRight }}
|
||||
href={src}
|
||||
target="_blank"
|
||||
>
|
||||
Open in a tab
|
||||
</Button>
|
||||
</section>
|
||||
|
||||
<p class="text-2xs text-hint mt-auto">
|
||||
The settings are stored in this browser and apply to every tab of this dev server until set
|
||||
back to the real setup and cloud off.
|
||||
</p>
|
||||
</aside>
|
||||
|
||||
<main class="flex-1 min-w-0 flex justify-center overflow-auto p-4">
|
||||
<div
|
||||
class="h-full border rounded-md overflow-hidden bg-surface shrink-0"
|
||||
style:width={width === 'full' ? '100%' : `${width}px`}
|
||||
>
|
||||
{#key reloadKey}
|
||||
<iframe title="Home" {src} class="w-full h-full"></iframe>
|
||||
{/key}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
Reference in New Issue
Block a user