Merge branch 'main' into feat/1907-chat-thinking
Quality / check (pull_request) Successful in 12m49s
Quality / check (pull_request) Successful in 12m49s
This commit is contained in:
commit
607bfddd0e
29 files changed
+821
-60
No files matched your search
+1
-1
@@ -116,7 +116,7 @@ watch(() => accounts.status?.user, (user) => {
|
||||
<span class="max-md:hidden"><AccountMenu /></span>
|
||||
</div>
|
||||
</header>
|
||||
<div id="main-content" ref="main" tabindex="-1" class="scroll-mt-16 w-full flex-1 px-6 py-5 pb-[calc(var(--chat-dock-clear,6rem)+1rem)] outline-none max-lg:p-4 max-lg:pb-[calc(var(--chat-dock-clear,6rem)+1rem)]"
|
||||
<div id="main-content" ref="main" tabindex="-1" class="@container scroll-mt-16 w-full flex-1 px-6 py-5 pb-[calc(var(--chat-dock-clear,6rem)+1rem)] outline-none max-lg:p-4 max-lg:pb-[calc(var(--chat-dock-clear,6rem)+1rem)]"
|
||||
:class="workflowsPage && 'max-md:flex max-md:min-h-0 max-md:flex-col'">
|
||||
<!--
|
||||
Keyed on the path and its parameters but not the query: a query-only
|
||||
|
||||
@@ -260,7 +260,7 @@ function onKeydown(event: KeyboardEvent): void {
|
||||
aria-controls="slash-palette"
|
||||
:aria-expanded="isCommandMenuOpen ? 'true' : 'false'"
|
||||
:aria-activedescendant="isCommandMenuOpen && commandMatches.length ? `slash-palette-option-${commandSelection}` : undefined"
|
||||
class="max-h-40 min-h-11 flex-1 resize-none rounded-none border-0 bg-transparent! px-0 py-1 text-label shadow-none focus-visible:ring-0"
|
||||
class="max-h-40 min-h-11 flex-1 resize-none rounded-none border-0 bg-transparent! px-0 py-1 text-label pointer-coarse:text-base shadow-none focus-visible:ring-0"
|
||||
@input="onInput"
|
||||
@keydown="onKeydown"
|
||||
/>
|
||||
|
||||
+63
-12
@@ -1,15 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { ChevronDown, ChevronUp } from "@lucide/vue";
|
||||
import { useMediaQuery, useStorage, useWindowSize } from "@vueuse/core";
|
||||
import { useEventListener, useMediaQuery, useStorage, useWindowSize } from "@vueuse/core";
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useLiveResource } from "@/stores/session";
|
||||
import { cn } from "@/lib/utils";
|
||||
import ChatBar from "./ChatBar.vue";
|
||||
import ChatComposer from "./ChatComposer.vue";
|
||||
import ChatTranscript from "./ChatTranscript.vue";
|
||||
import { composerText, escapeOwnedByLayer, isSending, useChat } from "./state";
|
||||
import { composerText, escapeOwnedByLayer, isSending, reloadTranscript, useChat } from "./state";
|
||||
import { setDockOpen, unseenCount } from "./unseen";
|
||||
|
||||
/**
|
||||
* Chat is a bar docked at the bottom of every page, not a route: the operator
|
||||
@@ -26,6 +29,9 @@ import { composerText, escapeOwnedByLayer, isSending, useChat } from "./state";
|
||||
* Dragging the header to an edge pins it; dragging it away, or double-clicking
|
||||
* the header, unpins it. The side and width are remembered per browser.
|
||||
*
|
||||
* On a phone the bar rides above the on-screen keyboard, which iOS does not
|
||||
* resize the page for, and swiping down on the conversation header hides it.
|
||||
*
|
||||
* It stays mounted, so the session and any turn in flight survive a navigation.
|
||||
* It is mounted outside the app shell: `.shell`'s backdrop-filter makes it a
|
||||
* containing block for `position: fixed`, so a bar nested inside would anchor to
|
||||
@@ -33,7 +39,12 @@ import { composerText, escapeOwnedByLayer, isSending, useChat } from "./state";
|
||||
*/
|
||||
useChat();
|
||||
|
||||
// A task this conversation started reports its outcome into it. The dock stays
|
||||
// mounted while collapsed, so a reply that lands then is still read and counted.
|
||||
useLiveResource("chat", () => void reloadTranscript());
|
||||
|
||||
const expanded = ref(false);
|
||||
watch(expanded, setDockOpen, { immediate: true });
|
||||
const MIN_WIDTH = 320;
|
||||
const EDGE = 64;
|
||||
type Side = "left" | "right";
|
||||
@@ -49,6 +60,20 @@ const width = computed(() =>
|
||||
Math.round(Math.min(Math.max(saved.value.width, MIN_WIDTH), Math.max(MIN_WIDTH, Math.min(720, viewport.value - 480)))),
|
||||
);
|
||||
const side = computed(() => (desktop.value && expanded.value ? saved.value.side : null));
|
||||
// The part of the layout viewport the on-screen keyboard covers, and the height
|
||||
// left above it. Fixed elements stay anchored to the layout viewport, so without
|
||||
// this the bar sits under the keyboard.
|
||||
const keyboard = ref(0);
|
||||
const visibleHeight = ref(window.innerHeight);
|
||||
function followViewport(): void {
|
||||
const vv = window.visualViewport;
|
||||
keyboard.value = vv ? Math.max(0, Math.round(window.innerHeight - vv.height - vv.offsetTop)) : 0;
|
||||
visibleHeight.value = vv ? vv.height : window.innerHeight;
|
||||
}
|
||||
useEventListener(() => window.visualViewport, ["resize", "scroll"], followViewport);
|
||||
const phoneBottom = computed(() =>
|
||||
keyboard.value > 0 ? `${keyboard.value + 8}px` : "max(0.5rem, env(safe-area-inset-bottom))",
|
||||
);
|
||||
const composer = ref<InstanceType<typeof ChatComposer> | null>(null);
|
||||
|
||||
// Nothing outside the dock closes it: every navigation control is outside it,
|
||||
@@ -113,12 +138,13 @@ function edgeAt(x: number): Side | null {
|
||||
|
||||
// Pointer travel before a press on the header becomes a drag, so a click or a
|
||||
// double-click on it never moves the dock.
|
||||
const INTERACTIVE = "button, a, input, select, textarea, [role=combobox]";
|
||||
const DRAG_START = 4;
|
||||
const offset = ref<{ x: number; y: number } | null>(null);
|
||||
const target = ref<Side | null>(null);
|
||||
function startDrag(event: PointerEvent): void {
|
||||
if (!desktop.value || event.button !== 0) return;
|
||||
if ((event.target as HTMLElement).closest("button, a, input, select, textarea, [role=combobox]")) return;
|
||||
if (event.button !== 0 || (event.target as HTMLElement).closest(INTERACTIVE)) return;
|
||||
if (!desktop.value) return startSwipe(event);
|
||||
const grip = event.currentTarget as HTMLElement;
|
||||
const { clientX: x0, clientY: y0 } = event;
|
||||
grip.setPointerCapture(event.pointerId);
|
||||
@@ -141,8 +167,27 @@ function startDrag(event: PointerEvent): void {
|
||||
grip.addEventListener("pointerup", end);
|
||||
grip.addEventListener("pointercancel", end);
|
||||
}
|
||||
// A downward flick on the header hides the conversation. It must be mostly
|
||||
// vertical so a sideways slip does not collapse it.
|
||||
const SWIPE = 48;
|
||||
function startSwipe(event: PointerEvent): void {
|
||||
const grip = event.currentTarget as HTMLElement;
|
||||
const { clientX: x0, clientY: y0 } = event;
|
||||
const end = (e: PointerEvent): void => {
|
||||
grip.removeEventListener("pointerup", end);
|
||||
grip.removeEventListener("pointercancel", end);
|
||||
const dy = e.clientY - y0;
|
||||
if (e.type === "pointerup" && dy >= SWIPE && dy > Math.abs(e.clientX - x0) * 1.5) {
|
||||
// The keyboard is for the composer, which is no longer in front of it.
|
||||
(document.activeElement as HTMLElement | null)?.blur();
|
||||
expanded.value = false;
|
||||
}
|
||||
};
|
||||
grip.addEventListener("pointerup", end);
|
||||
grip.addEventListener("pointercancel", end);
|
||||
}
|
||||
function togglePin(event: MouseEvent): void {
|
||||
if (!desktop.value || (event.target as HTMLElement).closest("button, a, input, select, textarea, [role=combobox]")) return;
|
||||
if (!desktop.value || (event.target as HTMLElement).closest(INTERACTIVE)) return;
|
||||
saved.value.side = saved.value.side ? null : "right";
|
||||
}
|
||||
|
||||
@@ -185,15 +230,15 @@ function usePrompt(text: string): void {
|
||||
<div
|
||||
:class="cn(
|
||||
'pointer-events-none fixed z-40',
|
||||
side ? cn('inset-y-0', side === 'left' ? 'left-0' : 'right-0') : 'inset-x-0 bottom-4 flex justify-center px-3 max-md:bottom-2',
|
||||
side ? cn('inset-y-0', side === 'left' ? 'left-0' : 'right-0') : 'inset-x-0 bottom-4 flex justify-center px-3',
|
||||
)"
|
||||
:style="side ? { width: `${width}px` } : undefined"
|
||||
:style="side ? { width: `${width}px` } : desktop ? undefined : { bottom: phoneBottom }"
|
||||
>
|
||||
<aside
|
||||
ref="dock"
|
||||
aria-label="Chat with Archie"
|
||||
:class="cn(
|
||||
'pointer-events-auto relative flex flex-col border-border-strong bg-popover shadow-[var(--shadow-md)]',
|
||||
'touch-hit pointer-events-auto relative flex flex-col border-border-strong bg-popover shadow-[var(--shadow-md)]',
|
||||
side
|
||||
? cn('h-full w-full', side === 'left' ? 'border-r' : 'border-l')
|
||||
: 'w-full max-w-xl rounded-lg border',
|
||||
@@ -216,11 +261,11 @@ function usePrompt(text: string): void {
|
||||
/>
|
||||
<div
|
||||
v-if="expanded"
|
||||
:class="desktop && 'cursor-grab select-none active:cursor-grabbing'"
|
||||
:class="desktop ? 'cursor-grab select-none active:cursor-grabbing' : 'touch-none'"
|
||||
@pointerdown="startDrag"
|
||||
@dblclick="togglePin"
|
||||
>
|
||||
<div v-if="desktop" class="flex justify-center pt-1.5" aria-hidden="true">
|
||||
<div class="flex justify-center pt-1.5" aria-hidden="true">
|
||||
<span class="h-1 w-8 rounded-full bg-border-strong" />
|
||||
</div>
|
||||
<ChatBar>
|
||||
@@ -240,7 +285,11 @@ function usePrompt(text: string): void {
|
||||
</Tooltip>
|
||||
</ChatBar>
|
||||
</div>
|
||||
<div v-if="expanded" :class="cn('flex min-h-0 flex-col', side ? 'flex-1' : 'h-[min(28rem,55dvh)]')">
|
||||
<div
|
||||
v-if="expanded"
|
||||
:class="cn('flex min-h-0 flex-col', side ? 'flex-1' : 'h-[min(28rem,55dvh)]')"
|
||||
:style="side || desktop ? undefined : { height: `min(28rem, ${Math.round(visibleHeight * 0.55)}px)` }"
|
||||
>
|
||||
<ChatTranscript @prompt="usePrompt" />
|
||||
</div>
|
||||
<div @focusin="expanded = true">
|
||||
@@ -251,10 +300,12 @@ function usePrompt(text: string): void {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
aria-label="Show conversation"
|
||||
:class="cn(unseenCount && 'w-auto gap-1 px-2')"
|
||||
:aria-label="unseenCount ? `Show conversation, ${unseenCount} new` : 'Show conversation'"
|
||||
@click="expanded = true"
|
||||
>
|
||||
<ChevronUp />
|
||||
<Badge v-if="unseenCount" variant="default" aria-hidden="true">{{ unseenCount }}</Badge>
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Show conversation</TooltipContent>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<script setup lang="ts">
|
||||
import { ArrowDownIcon } from "@lucide/vue";
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
|
||||
import { MessageScrollerButton, useMessageScrollerScrollable } from "@/components/ui/message-scroller";
|
||||
import { setAtEnd, unseenCount } from "./unseen";
|
||||
|
||||
/**
|
||||
* The scroller's jump-to-latest button. It reads where the reader is for the
|
||||
* unseen count and says how many replies are waiting below.
|
||||
*
|
||||
* The scroller measures on the frames after it mounts, and until then it
|
||||
* reports "not scrollable", which would look like the end. The reader counts
|
||||
* as at the end only once it has measured.
|
||||
*/
|
||||
const scrollable = useMessageScrollerScrollable();
|
||||
const measured = ref(false);
|
||||
let frame = 0;
|
||||
onMounted(() => {
|
||||
frame = requestAnimationFrame(() => {
|
||||
frame = requestAnimationFrame(() => {
|
||||
measured.value = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
onUnmounted(() => {
|
||||
cancelAnimationFrame(frame);
|
||||
setAtEnd(false);
|
||||
});
|
||||
watch(
|
||||
() => measured.value && !scrollable.value.end,
|
||||
(end) => setAtEnd(end),
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
const label = computed(() => `${unseenCount.value} new ${unseenCount.value === 1 ? "reply" : "replies"}`);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<MessageScrollerButton :size="unseenCount ? 'sm' : 'icon-sm'" :class="unseenCount ? 'gap-1.5 whitespace-nowrap' : undefined">
|
||||
<ArrowDownIcon />
|
||||
<template v-if="unseenCount">{{ label }}</template>
|
||||
<span v-else class="sr-only">Scroll to end</span>
|
||||
</MessageScrollerButton>
|
||||
</template>
|
||||
@@ -4,18 +4,17 @@ import { computed } from "vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
MessageScroller,
|
||||
MessageScrollerButton,
|
||||
MessageScrollerContent,
|
||||
MessageScrollerItem,
|
||||
MessageScrollerProvider,
|
||||
MessageScrollerViewport,
|
||||
} from "@/components/ui/message-scroller";
|
||||
import { useLiveResource } from "@/stores/session";
|
||||
import ChatAskCard from "./ChatAskCard.vue";
|
||||
import ChatBubble from "./ChatBubble.vue";
|
||||
import ChatChooseCard from "./ChatChooseCard.vue";
|
||||
import ChatUpdateCard from "./ChatUpdateCard.vue";
|
||||
import ChatEmptyState from "./ChatEmptyState.vue";
|
||||
import ChatJumpButton from "./ChatJumpButton.vue";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import {
|
||||
@@ -27,7 +26,6 @@ import {
|
||||
sessionError,
|
||||
streamingTurn,
|
||||
type ChatMessage,
|
||||
reloadTranscript,
|
||||
} from "./state";
|
||||
|
||||
/**
|
||||
@@ -95,9 +93,6 @@ const rows = computed(() => {
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
// A task this conversation started reports its outcome into it.
|
||||
useLiveResource("chat", () => void reloadTranscript());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -160,7 +155,7 @@ useLiveResource("chat", () => void reloadTranscript());
|
||||
</MessageScrollerContent>
|
||||
</MessageScrollerViewport>
|
||||
|
||||
<MessageScrollerButton />
|
||||
<ChatJumpButton />
|
||||
</MessageScroller>
|
||||
</MessageScrollerProvider>
|
||||
</template>
|
||||
@@ -0,0 +1,47 @@
|
||||
import { computed, ref, watch } from "vue";
|
||||
|
||||
import { isLoadingSession, messages, type ChatMessage } from "./state";
|
||||
|
||||
/**
|
||||
* Counts the replies the operator has not seen. A reply is seen once the
|
||||
* conversation is open and scrolled to its end; one that lands before that,
|
||||
* such as a finished task's outcome while the dock is collapsed or the reader
|
||||
* is scrolled up, adds to the count until then.
|
||||
*
|
||||
* It counts replies by position, not by id: a streamed reply is appended
|
||||
* locally without an id and a later reload returns it with one, and that must
|
||||
* not count twice.
|
||||
*/
|
||||
const dockOpen = ref(false);
|
||||
const atEnd = ref(false);
|
||||
const seen = ref(0);
|
||||
|
||||
function isReply(message: ChatMessage): boolean {
|
||||
// Cards the operator's own command produced are not something Archie said.
|
||||
return (message.from ?? message.From ?? "") !== "web" && !message.update && !message.choose;
|
||||
}
|
||||
|
||||
const total = computed(() => messages.value.filter(isReply).length);
|
||||
const viewing = computed(() => dockOpen.value && atEnd.value);
|
||||
|
||||
export const unseenCount = computed(() => Math.max(0, total.value - seen.value));
|
||||
|
||||
// Opening or switching a conversation loads it, which is not news; a reload
|
||||
// that drops a message must also lower the mark so the next reply still counts.
|
||||
watch(
|
||||
[total, viewing, isLoadingSession],
|
||||
([count, watching, loading], [, , wasLoading]) => {
|
||||
if (watching || loading || wasLoading || count < seen.value) seen.value = count;
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
/** The dock reports whether the conversation is open above the composer. */
|
||||
export function setDockOpen(open: boolean): void {
|
||||
dockOpen.value = open;
|
||||
}
|
||||
|
||||
/** The scroller's jump button reports whether the reader is at the end. */
|
||||
export function setAtEnd(end: boolean): void {
|
||||
atEnd.value = end;
|
||||
}
|
||||
@@ -23,12 +23,12 @@ const setupIncomplete = computed(() => setupPanelState(setup.value).kind === "in
|
||||
<template>
|
||||
<h1 class="sr-only">Dashboard</h1>
|
||||
<Alert v-if="error" variant="destructive" class="mb-4"><AlertDescription>Archie is not responding: {{ error }}</AlertDescription></Alert>
|
||||
<div :class="setupIncomplete ? 'grid items-start gap-4 lg:grid-cols-[minmax(0,1fr)_320px]' : 'mx-auto max-w-5xl'">
|
||||
<div :class="setupIncomplete ? 'grid items-start gap-4 @3xl:grid-cols-[minmax(0,1fr)_320px]' : 'mx-auto max-w-5xl'">
|
||||
<div class="grid min-w-0 gap-4">
|
||||
<QuickTask class="mb-2" />
|
||||
<NeedsAttentionCard />
|
||||
<LiveActivityCard v-if="summary" />
|
||||
</div>
|
||||
<SetupPanel v-if="setupIncomplete" class="max-lg:-order-1" />
|
||||
<SetupPanel v-if="setupIncomplete" class="@max-3xl:-order-1" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -80,10 +80,10 @@ async function run() {
|
||||
<template>
|
||||
<div>
|
||||
<form class="grid gap-1.5" @submit.prevent="run">
|
||||
<div class="flex gap-2 max-sm:flex-wrap">
|
||||
<div class="flex gap-2 @max-xl:flex-wrap">
|
||||
<Input v-model="prompt" class="min-w-0 flex-1" placeholder="Describe what Archie should do" aria-label="Task" />
|
||||
<Select v-model="workflow" :disabled="!definitions.length">
|
||||
<SelectTrigger class="w-56 max-sm:flex-1" aria-label="Workflow"><span class="flex min-w-0 items-center gap-1.5"><span class="text-fg-muted">Workflow</span><SelectValue /></span></SelectTrigger>
|
||||
<SelectTrigger class="w-56 @max-xl:flex-1" aria-label="Workflow"><span class="flex min-w-0 items-center gap-1.5"><span class="text-fg-muted">Workflow</span><SelectValue /></span></SelectTrigger>
|
||||
<SelectContent position="popper">
|
||||
<SelectGroup>
|
||||
<SelectItem v-for="d in definitions" :key="d.id" :value="d.id">{{ d.name || d.id }}</SelectItem>
|
||||
|
||||
@@ -58,7 +58,7 @@ const groups = computed(() => {
|
||||
{{ group.label }}
|
||||
<span class="font-normal text-fg-subtle">{{ group.entries.length }}</span>
|
||||
</h2>
|
||||
<ul class="grid gap-2 lg:grid-cols-2">
|
||||
<ul class="grid gap-2 @3xl:grid-cols-2">
|
||||
<li v-for="entry in group.entries" :key="entry.name" class="flex">
|
||||
<Item variant="outline" class="h-full flex-nowrap items-start bg-card">
|
||||
<ItemMedia class="mt-0.5 size-8 rounded-md bg-muted">
|
||||
|
||||
@@ -95,7 +95,7 @@ const tones = {
|
||||
<Section>
|
||||
<ItemGroup aria-label="Extensions">
|
||||
<Item v-for="extension in store.extensions" :key="extension.name" as="li" variant="outline">
|
||||
<div class="min-w-0 w-full lg:w-auto lg:flex-1">
|
||||
<div class="min-w-0 w-full @3xl:w-auto @3xl:flex-1">
|
||||
<p class="truncate text-label font-medium">
|
||||
{{ extension.display_name || extension.name }}
|
||||
<span class="font-mono text-caption text-fg-subtle">{{ extension.version }}</span>
|
||||
|
||||
@@ -56,14 +56,14 @@ function removeIdentity(id: string) {
|
||||
<KindGate v-if="!grants" :kind="KIND" />
|
||||
<ItemGroup v-if="grants">
|
||||
<Item as="div" role="listitem" variant="outline" size="sm" class="flex-wrap">
|
||||
<span class="w-40 shrink-0 text-label max-sm:w-24 max-sm:truncate">Default</span>
|
||||
<span class="w-40 shrink-0 text-label @max-xl:w-24 @max-xl:truncate">Default</span>
|
||||
<ToggleGroup class="flex-wrap" type="multiple" variant="outline" size="sm" :model-value="grants.identities?.[SYSTEM_ID] ?? []" aria-label="Default grants" @update:model-value="(v) => setIdentity(SYSTEM_ID, v as string[])">
|
||||
<ToggleGroupItem v-for="service in store.credentialServices" :key="service" :value="service" class="font-mono text-caption">{{ service }}</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
<DraftHint :kind="KIND" path="identities" />
|
||||
</Item>
|
||||
<Item v-for="[id, services] in others" :key="id" as="div" role="listitem" variant="outline" size="sm">
|
||||
<span class="w-40 shrink-0 truncate text-label max-sm:w-24">{{ org.identityName(String(id)) }}</span>
|
||||
<span class="w-40 shrink-0 truncate text-label @max-xl:w-24">{{ org.identityName(String(id)) }}</span>
|
||||
<ToggleGroup class="flex-wrap" type="multiple" variant="outline" size="sm" :model-value="services ?? []" :aria-label="`${org.identityName(String(id))} grants`" @update:model-value="(v) => setIdentity(String(id), v as string[])">
|
||||
<ToggleGroupItem v-for="service in store.credentialServices" :key="service" :value="service" class="font-mono text-caption">{{ service }}</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
|
||||
@@ -26,18 +26,18 @@ const items = computed(() =>
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex gap-8 max-lg:flex-col max-lg:gap-4">
|
||||
<div class="flex gap-8 @max-3xl:flex-col @max-3xl:gap-4">
|
||||
<nav
|
||||
id="config-sidebar"
|
||||
:aria-label="props.scope === 'org' ? 'Organisation' : 'Instance'"
|
||||
class="shrink-0 lg:w-48 max-lg:-mx-4 max-lg:w-auto max-lg:scroll-fade-x max-lg:overflow-x-auto max-lg:[scrollbar-width:none] max-lg:border-b max-lg:px-4"
|
||||
class="shrink-0 @3xl:w-48 @max-3xl:-mx-4 @max-3xl:w-auto @max-3xl:scroll-fade-x @max-3xl:overflow-x-auto @max-3xl:[scrollbar-width:none] @max-3xl:border-b @max-3xl:px-4"
|
||||
>
|
||||
<ul class="flex flex-col gap-0.5 lg:sticky lg:top-20 max-lg:flex-row max-lg:gap-1">
|
||||
<ul class="flex flex-col gap-0.5 @3xl:sticky @3xl:top-20 @max-3xl:flex-row @max-3xl:gap-1">
|
||||
<li v-for="(item, index) in items" :key="item.path" class="contents">
|
||||
<Separator v-if="item.dividerBefore === ''" class="my-4 max-lg:hidden" />
|
||||
<Separator v-if="item.dividerBefore === ''" class="my-4 @max-3xl:hidden" />
|
||||
<p
|
||||
v-else-if="item.dividerBefore"
|
||||
:class="cn('mb-1 px-3 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase max-lg:hidden', index > 0 && 'mt-4')"
|
||||
:class="cn('mb-1 px-3 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase @max-3xl:hidden', index > 0 && 'mt-4')"
|
||||
>
|
||||
{{ item.dividerBefore }}
|
||||
</p>
|
||||
|
||||
@@ -175,7 +175,7 @@ function setAllowed(id: string, text: string) {
|
||||
<Section title="Aliases">
|
||||
<p v-if="!aliases.default" class="mb-3 text-label text-warn" role="alert">Set the default alias.</p>
|
||||
<div v-for="alias in aliasNames" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
|
||||
<Label :for="`alias-${alias}`" class="w-28 text-label font-medium max-sm:w-full">{{ alias }}</Label>
|
||||
<Label :for="`alias-${alias}`" class="w-28 text-label font-medium @max-xl:w-full">{{ alias }}</Label>
|
||||
<template v-if="alias === 'embedding'">
|
||||
<Select :model-value="embeddingProvider" @update:model-value="(v) => setEmbedding(String(v), embeddingModel)">
|
||||
<SelectTrigger class="w-44 font-mono" aria-label="Embedding provider"><SelectValue placeholder="unset" /></SelectTrigger>
|
||||
@@ -198,7 +198,7 @@ function setAllowed(id: string, text: string) {
|
||||
:id="`alias-${alias}`"
|
||||
:model-value="aliases[alias] ?? ''"
|
||||
:options="modelOptions"
|
||||
class="min-w-0 max-w-md flex-1 font-mono max-sm:max-w-none max-sm:basis-full"
|
||||
class="min-w-0 max-w-md flex-1 font-mono @max-xl:max-w-none @max-xl:basis-full"
|
||||
placeholder="unset"
|
||||
:aria-invalid="!!aliasIssue(alias)"
|
||||
@update:model-value="(v) => setAlias(alias, String(v))"
|
||||
@@ -221,10 +221,10 @@ function setAllowed(id: string, text: string) {
|
||||
<template v-if="policies && otherOrgs.length">
|
||||
<Section title="Org access">
|
||||
<div v-for="o in otherOrgs" :key="o.id" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
|
||||
<span class="w-28 truncate text-label font-medium max-sm:w-full" :title="o.id">{{ o.name }}</span>
|
||||
<span class="w-28 truncate text-label font-medium @max-xl:w-full" :title="o.id">{{ o.name }}</span>
|
||||
<Input
|
||||
:model-value="allowedText(o.id)"
|
||||
class="min-w-0 max-w-md flex-1 font-mono max-sm:max-w-none max-sm:basis-full"
|
||||
class="min-w-0 max-w-md flex-1 font-mono @max-xl:max-w-none @max-xl:basis-full"
|
||||
placeholder="no models"
|
||||
:aria-label="`Models ${o.name} may use`"
|
||||
@update:model-value="(v) => setAllowed(o.id, String(v))"
|
||||
|
||||
@@ -351,3 +351,19 @@
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Widens a control's tap area to 44px on a phone without changing how it looks
|
||||
or what space it takes. Apply it to a container of buttons. */
|
||||
@utility touch-hit {
|
||||
@media (max-width: 767px) {
|
||||
& button:not(.absolute) {
|
||||
position: relative;
|
||||
}
|
||||
& button::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset-block: min(0px, calc((100% - 44px) / 2));
|
||||
inset-inline: min(0px, calc((100% - 44px) / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ const changeVariant: Record<string, "ok" | "info" | "danger"> = {
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<div class="grid gap-5 sm:grid-cols-2">
|
||||
<div class="grid gap-5 @xl:grid-cols-2">
|
||||
<section v-if="doc.acceptance?.length" class="flex min-w-0 flex-col gap-2">
|
||||
<h3 class="text-title font-semibold">Acceptance criteria</h3>
|
||||
<ul class="list-disc space-y-1 pl-5 text-label">
|
||||
|
||||
@@ -56,13 +56,13 @@ const nodeClass = computed(() =>
|
||||
|
||||
<template>
|
||||
<li
|
||||
class="relative grid grid-cols-[1.75rem_1fr] gap-2 pb-4 before:absolute before:top-4 before:bottom-0 before:left-[0.6875rem] before:w-px before:bg-border-strong last:before:hidden max-md:grid-cols-1 max-md:border-b max-md:border-border max-md:pb-3 max-md:before:hidden"
|
||||
class="relative grid grid-cols-[1.75rem_1fr] gap-2 pb-4 before:absolute before:top-4 before:bottom-0 before:left-[0.6875rem] before:w-px before:bg-border-strong last:before:hidden @max-2xl:grid-cols-1 @max-2xl:border-b @max-2xl:border-border @max-2xl:pb-3 @max-2xl:before:hidden"
|
||||
>
|
||||
<span
|
||||
:class="nodeClass"
|
||||
:title="meta.label"
|
||||
aria-hidden="true"
|
||||
class="max-md:hidden"
|
||||
class="@max-2xl:hidden"
|
||||
/>
|
||||
<div class="min-w-0">
|
||||
<!--
|
||||
|
||||
@@ -52,7 +52,7 @@ const run = provideTaskRun(taskId);
|
||||
<TaskNotes :id="rawId" />
|
||||
<TaskReviewGate v-if="run.task" :task="run.task" @done="run.refreshAll()" />
|
||||
|
||||
<div class="grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]">
|
||||
<div class="grid items-start gap-6 @3xl:grid-cols-[minmax(0,1fr)_20rem]">
|
||||
<div class="flex min-w-0 flex-col gap-6">
|
||||
<TaskApproval
|
||||
v-if="run.task?.approval === 'plan' && run.task.plan"
|
||||
@@ -72,7 +72,7 @@ const run = provideTaskRun(taskId);
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
<TaskRail class="order-first lg:order-none" />
|
||||
<TaskRail class="order-first @3xl:order-none" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -46,13 +46,13 @@ function selectStatus(value: unknown) {
|
||||
:model-value="props.search"
|
||||
aria-label="Search tasks by title or repository"
|
||||
placeholder="Search by title or repo…"
|
||||
class="w-55 max-sm:w-full"
|
||||
class="w-55 @max-xl:w-full"
|
||||
@update:model-value="emit('update:search', String($event))"
|
||||
/>
|
||||
<Select :model-value="selected" @update:model-value="selectStatus">
|
||||
<SelectTrigger
|
||||
aria-label="Filter by status"
|
||||
class="w-45 max-sm:w-full"
|
||||
class="w-45 @max-xl:w-full"
|
||||
>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
|
||||
Reference in new issue
Block a user