Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
518c309
ui: share the working directory row between chat and projects
allozaur Nov 9, 2026
b54c69b
ui : projects (parked)
allozaur Oct 29, 2026
a1652b7
ui : list projects on a Projects page reached from the sidebar
allozaur Oct 30, 2026
5c98a00
ui : show each project as a row inside sidebar sections
allozaur Oct 30, 2026
2656096
ui : pass project instructions to the system prompt as written
allozaur Oct 30, 2026
8805446
ui : mark pinned projects on the Projects page
allozaur Oct 30, 2026
0a253f6
ui : archive projects, listed in their own tab on the Projects page
allozaur Oct 30, 2026
30506ba
ui : add the project page
allozaur Oct 22, 2026
e95b4d1
ui : open project chats in a project view
allozaur Oct 22, 2026
8cdb397
ui : keep a project's actions, goal and details by its title
allozaur Oct 26, 2026
b1a7955
ui : keep a project's open chats as tabs on its page
allozaur Oct 26, 2026
65fa3c9
ui : always open a project's chats inside the project
allozaur Oct 26, 2026
38f2689
ui : open the project page from its card and sidebar row (spike)
allozaur Oct 30, 2026
4faca97
ui: keep the Projects title clear of the status bar and the menu key …
allozaur Nov 1, 2026
1c61ab0
ui: give a phone page's main action a floating key, starting with New…
allozaur Nov 1, 2026
f7f14ee
ui: line a phone's bottom corner action up with the chat form in the …
allozaur Nov 1, 2026
adfaa0c
ui: keep a phone's bottom corner action as far from the side as from …
allozaur Nov 1, 2026
3c7dac6
ui: portal the floating key and slide it with the page, so it no long…
allozaur Nov 1, 2026
4ee8e73
ui : open a new chat in a tab of its own, never in a chat's tab
allozaur Nov 2, 2026
5edcca5
ui : keep a project's context to files until the picker lists MCP res…
allozaur Nov 2, 2026
2511955
ui: let project tools change only the chat's own project
allozaur Nov 9, 2026
9e1d5ab
ui : fit projects to the sidebar footer
allozaur Nov 10, 2026
64cbc26
ui: line the project submenu up like the other submenus
allozaur Nov 16, 2026
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
14 changes: 13 additions & 1 deletion ui/apps/chat/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
--safe-area-bottom: env(safe-area-inset-bottom, 0px);
/* where the phone's corner controls (menu toggle, context gauge, sidebar logo) sit */
--corner-control-top: calc(1rem + var(--safe-area-top));
/* where the phone's bottom corner actions (a page's floating key) sit: as far in from
the side as up from the bottom, which keeps a 56px key about concentric with an
iPhone's rounded screen corner */
--corner-control-side: 1.75rem;
--corner-control-bottom: calc(var(--corner-control-side) + var(--safe-area-bottom));
/* where a phone page's title starts: a row below the corner controls */
--page-top: calc(var(--corner-control-top) + 3.75rem);
/* expanded desktop sidebar width, overridden once the user drags its edge */
Expand Down Expand Up @@ -75,6 +80,9 @@
/* the installed app's status bar already sets them apart from the screen's edge */
:root {
--corner-control-top: calc(0.25rem + var(--safe-area-top));
/* the home indicator is a short bar in the middle, so the corners beside it are
free: a corner action ignores its inset and keeps the same gap as from the side */
--corner-control-bottom: var(--corner-control-side);
}

html {
Expand Down Expand Up @@ -295,11 +303,15 @@
}

/* While something is dragged, what it passes over takes no hover: only the
sections themselves stay targets, for the drop */
sections themselves, and the projects in them, stay targets, for the drop */
body[data-sidebar-dragging] [data-sidebar-section] * {
pointer-events: none;
}

body[data-sidebar-dragging] [data-sidebar-section] [data-sidebar-section] {
pointer-events: auto;
}

.sidebar-drag-overlay {
position: fixed;
z-index: 1000;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<script lang="ts">
import { Button } from '@ggml-org/llama-ui/ui/button';
import { Portal } from 'bits-ui';
import type { Component } from 'svelte';

interface Props {
class?: string;
icon: Component;
/** What it does, read out in place of a visible label. */
label: string;
onclick?: () => void;
}

let { class: className = '', icon: Icon, label, onclick }: Props = $props();
</script>

<!-- a phone's main action of a page: a round key in the bottom-right corner, within reach of
the thumb (see --corner-control-bottom and --corner-control-side). It lives on the body,
pinned to the screen: inside the page, the page's slide aside for the sidebar would make
the page its box and move it. It slides with the page instead, by the same offset and
ease (see --sidebar-reveal-x in the root layout), and takes no taps while the page is aside -->
<Portal>
<Button
aria-label={label}
class="fixed right-(--corner-control-side) bottom-(--corner-control-bottom) z-20 size-14 translate-x-(--sidebar-reveal-x) rounded-full shadow-lg transition-[translate] duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] md:hidden [:root[data-sidebar-reveal-dragging]_&]:transition-none [:root[data-sidebar-revealed]_&]:pointer-events-none {className}"
{onclick}
>
<Icon class="size-6" />
</Button>
</Portal>
3 changes: 3 additions & 0 deletions ui/apps/chat/src/lib/components/app/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ export { default as ActionIconCopyToClipboard } from './ActionIconCopyToClipboar

/** A round matte glass key: a phone's corner keys and the key back to a chat's bottom. */
export { default as GlassKey } from './GlassKey.svelte';

/** A page's main action on a phone: a round key pinned to the bottom-right corner. */
export { default as FloatingActionButton } from './FloatingActionButton.svelte';
44 changes: 42 additions & 2 deletions ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
ChatFormCurrentWorkingDirectory,
ChatFormInput,
ChatFormInputFileInputInvisible,
ChatFormPickers
ChatFormPickers,
ChatFormProjectChip
} from '#lib/components/app/index.ts';
import {
CHAT_FORM_SINGLE_ROW_MAX_TEXT_PX,
Expand All @@ -35,6 +36,7 @@
conversationsStore,
deviceStore,
modelsStore,
projectsStore,
serverStore,
settingsStore,
toolsStore,
Expand Down Expand Up @@ -139,6 +141,14 @@
conversationsStore.activeConversation?.cwd ?? conversationsStore.preferences.pendingCwd
);

// the project the chat is in, or the one picked for the chat about to start
let project = $derived.by(() => {
const active = conversationsStore.activeConversation;
const projectId = active ? active.projectId : conversationsStore.preferences.pendingProjectId;

return projectId ? projectsStore.get(projectId) : undefined;
});

let showWorkingDirectory = $derived(conversationsStore.preferences.hasEnabledCwdTools());
// On a desktop the chip under the form shows a directory once one is set, and the + menu
// sets one until then. A phone has no chip: a chat shows it in its header (see
Expand Down Expand Up @@ -806,7 +816,37 @@
></div>
{/if}

{#if showWorkingDirectory}
{#if project}
<!-- the chat's context: its project and, once one is set, its working directory -->
<div
class={[
'mt-1.5 flex min-w-0 items-center gap-1 self-start',
// the expanded phone sheet reaches the screen's bottom
isExpanded && 'max-md:hidden'
]}
>
<ChatFormProjectChip {disabled} {project} />

{#if showWorkingDirectoryChip}
<span aria-hidden="true" class="text-xs text-muted-foreground">·</span>
{/if}

{#if showWorkingDirectory}
<ChatFormCurrentWorkingDirectory
bind:query={pickers.workingDirectoryQuery}
class="!mt-0"
customAnchor={activePickerAnchor}
directory={cwd}
{disabled}
isOpen={pickers.isWorkingDirectoryPickerOpen}
onChange={handleWorkingDirectoryChange}
onClose={pickers.handleWorkingDirectoryClose}
onOpen={pickers.handleWorkingDirectoryOpen}
showChip={showWorkingDirectoryChip}
/>
{/if}
</div>
{:else if showWorkingDirectory}
<!-- opened from the chip, the + menu, a phone chat's header or `/cwd` -->
<ChatFormCurrentWorkingDirectory
bind:query={pickers.workingDirectoryQuery}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
ATTACHMENT_FILE_ITEMS,
ATTACHMENT_MENU_TEXT,
ATTACHMENT_MODALITY_TEXT,
ICON_CLASS_DEFAULT
ICON_CLASS_DEFAULT,
PROJECT_ICON
} from '#lib/constants/index.ts';
import { getChatFormActionsContext } from '#lib/contexts/index.ts';
import { AttachmentAction, AttachmentItemEnabledWhen } from '#lib/enums/attachment.enums.ts';
import { useAttachmentMenu } from '#lib/hooks/use-attachment-menu.svelte.ts';
import { useToolsPanel } from '#lib/hooks/use-tools-panel.svelte.ts';
import { conversationsStore, projectsStore, uiStore } from '#lib/stores/index.ts';
import type { ToolGroup } from '#lib/types/index.ts';
import type { Snippet } from 'svelte';

Expand Down Expand Up @@ -126,6 +128,27 @@
</span>
</button>

<button
class={itemClass}
onclick={() => {
drawerOpen = false;
uiStore.openProjectPicker({
currentProjectId:
conversationsStore.activeConversation?.projectId ??
conversationsStore.preferences.pendingProjectId,
onSelect: (projectId) =>
void conversationsStore.assignActiveConversationProject(
projectsStore.get(projectId) ?? null
)
});
}}
type="button"
>
<PROJECT_ICON class="{ICON_CLASS_DEFAULT} shrink-0" />

<span>{ATTACHMENT_MENU_TEXT.ADD_TO_PROJECT}</span>
</button>

<button
class={itemClass}
onclick={() => attachmentMenu.callbacks[AttachmentAction.SYSTEM_PROMPT_CLICK]()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as Tooltip from '@ggml-org/llama-ui/ui/tooltip';
import { cn } from '@ggml-org/llama-ui/utils';
import { File, Folder, Image, MessageSquare, Mic, Plus, Video } from '@lucide/svelte';
import { ChatFormActionAddToolsSubmenu } from '#lib/components/app/index.ts';
import { ChatFormActionAddToolsSubmenu, ProjectSubmenu } from '#lib/components/app/index.ts';
import {
ATTACHMENT_FILE_ITEMS,
ATTACHMENT_MENU_TEXT,
Expand All @@ -15,6 +15,7 @@
import { getChatFormActionsContext } from '#lib/contexts/index.ts';
import { AttachmentAction, AttachmentItemEnabledWhen } from '#lib/enums/index.ts';
import { useAttachmentMenu } from '#lib/hooks/use-attachment-menu.svelte.ts';
import { conversationsStore, projectsStore } from '#lib/stores/index.ts';

interface Props {
class?: string;
Expand Down Expand Up @@ -131,6 +132,17 @@
</span>
</DropdownMenu.Item>

<ProjectSubmenu
currentProjectId={conversationsStore.activeConversation?.projectId ??
conversationsStore.preferences.pendingProjectId}
label={ATTACHMENT_MENU_TEXT.ADD_TO_PROJECT}
onClose={() => (dropdownOpen = false)}
onSelect={(projectId) =>
void conversationsStore.assignActiveConversationProject(
projectsStore.get(projectId) ?? null
)}
/>

<DropdownMenu.Item
class="flex cursor-pointer items-center gap-2"
onclick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
* Floating file/folder mention picker. The chat input is the search
* surface: `query` (typed after `@`) drives a `file_glob_search` tool
* call scoped to `scopePath`. The parent owns the "dismissed token,
* don't re-open until it changes" snapshot.
* don't re-open until it changes" snapshot. A host without an `@` token,
* like a project's context, shows the list's own search field and binds
* `query` instead.
*/
interface Props {
class?: string;
isOpen: boolean;
query: string;
/** Renders the list's own search field, for hosts without an `@` token. */
showSearchInput?: boolean;
customAnchor?: HTMLElement | null;
scopePath?: string | null;
onClose: () => void;
Expand All @@ -43,8 +47,9 @@
onClose,
onOpened,
onSelect,
query,
scopePath = null
query = $bindable(''),
scopePath = null,
showSearchInput = false
}: Props = $props();

const nav = usePickerNavigation({
Expand Down Expand Up @@ -226,14 +231,16 @@
sideOffset={12}
>
<ChatFormPickerList
bind:searchQuery={query}
{emptyMessage}
isLoading={search.isSearching}
itemKey={(entry) => entry.type + ':' + entry.path}
items={displayedItems}
onSearchClose={onClose}
scrollTrigger={nav.scrollTrigger}
searchQuery={query ?? ''}
searchPlaceholder="Search files"
selectedIndex={nav.hoveredIndex}
showSearchInput={false}
{showSearchInput}
>
{#snippet item(entry, index, isSelected)}
<ChatFormPickerListItem
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<script lang="ts">
import * as Tooltip from '@ggml-org/llama-ui/ui/tooltip';
import { X } from '@lucide/svelte';
import { ActionIcon } from '#lib/components/app/actions/index.ts';
import { conversationsStore, projectsStore, uiStore } from '#lib/stores/index.ts';
import type { Project } from '#lib/types/index.ts';

interface Props {
disabled?: boolean;
project: Project;
}

let { disabled = false, project }: Props = $props();

function pickProject() {
uiStore.openProjectPicker({
currentProjectId: project.id,
onSelect: (projectId) =>
void conversationsStore.assignActiveConversationProject(
projectsStore.get(projectId) ?? null
)
});
}
</script>

<!-- the chat's project, beside its working directory: a project and a folder
are different things, so each has its own chip. The remove
button sits beside the chip, not inside it: buttons do not nest -->
<div class="group flex min-w-0 items-center rounded-md px-2 py-1 text-xs backdrop-blur-2xl">
<Tooltip.Root>
<Tooltip.Trigger>
{#snippet child({ props })}
<button
{...props}
class="flex min-w-0 cursor-pointer items-center gap-1 text-foreground"
{disabled}
onclick={pickProject}
type="button"
>
<span class="max-w-48 truncate">{project.name}</span>
</button>
{/snippet}
</Tooltip.Trigger>

<Tooltip.Content>
<p>Change project</p>
</Tooltip.Content>
</Tooltip.Root>

<div
class="w-0 overflow-hidden opacity-0 transition-[width,opacity] duration-200 ease-out group-focus-within:ml-1 group-focus-within:w-auto group-focus-within:opacity-100 group-hover:ml-1 group-hover:w-auto group-hover:opacity-100"
>
<ActionIcon
ariaLabel="Remove from project"
class="!h-4 !w-4 shrink-0 text-muted-foreground hover:text-foreground"
{disabled}
icon={X}
iconSize="h-3 w-3"
onclick={() => void conversationsStore.assignActiveConversationProject(null)}
tooltip="Remove from project"
/>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,17 @@
--assistant-min-height-offset: calc(
var(--last-user-message-height, 19rem) + var(--chat-form-height, 6rem) +
var(--chat-form-bottom-position, 0.5rem) + var(--chat-form-padding-top, 6rem) +
var(--assistant-margin-top, 3rem) + var(--chat-tabs-offset, 0px)
var(--assistant-margin-top, 3rem) + var(--chat-tabs-offset, 0px) +
var(--chat-header-height, 0px)
);
min-height: calc(100dvh - var(--assistant-min-height-offset));

@media (width > 768px) {
--assistant-min-height-offset: calc(
var(--last-user-message-height, 18rem) + var(--chat-form-height, 6rem) +
var(--chat-form-bottom-position, 1rem) + var(--chat-form-padding-top, 6rem) +
var(--assistant-margin-top, 3rem) + var(--chat-tabs-offset, 0px)
var(--assistant-margin-top, 3rem) + var(--chat-tabs-offset, 0px) +
var(--chat-header-height, 0px)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { Folder, FolderX } from '@lucide/svelte';
import ChatMessageCwdChangeRow from './ChatMessageCwdChangeRow.svelte';
import { FolderX } from '@lucide/svelte';
import type { DatabaseMessage } from '#lib/types/index.ts';
import { parseCwdMessage } from '#lib/utils/index.ts';

Expand All @@ -16,19 +17,13 @@
</script>

{#if info}
<div class="text-muted-foreground flex items-center gap-2 py-1.5 {className}">
{#if info.path === null}
{#if info.path === null}
<div class="text-muted-foreground flex items-center gap-2 py-1.5 {className}">
<FolderX class="text-muted-foreground/60 size-icon-sm shrink-0" />

<span class="text-foreground/80 text-sm font-medium">Working directory cleared</span>
{:else}
<Folder class="text-muted-foreground/60 h-3.5 w-3.5 shrink-0" />

<span class="text-foreground/80 text-sm font-medium">Set working directory to&nbsp;</span>

<span class="font-mono text-foreground/90 text-sm break-all" title={info.path}>
{info.display}
</span>
{/if}
</div>
</div>
{:else}
<ChatMessageCwdChangeRow class={className} display={info.display} path={info.path} />
{/if}
{/if}
Loading
Loading