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
2 changes: 2 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"@codeworksh/contract": "workspace:*",
"@codeworksh/widget": "workspace:*",
"@effect/atom-react": "4.0.5",
"@hugeicons/core-free-icons": "^4.4.0",
"@hugeicons/react": "^1.1.10",
"@legendapp/list": "3.3.5",
"@pierre/trees": "1.0.0-beta.6",
"@tanstack/react-router": "^1.161.0",
Expand Down
67 changes: 38 additions & 29 deletions apps/web/src/landing/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useAtom, useAtomValue } from "@effect/atom-react";
import { PlusSignIcon, Search01Icon, Settings02Icon, SquarePenIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { Link, useNavigate, useParams } from "@tanstack/react-router";
import { AsyncResult } from "effect/reactivity";
import { Plus, Search, Settings, SquarePen } from "lucide-react";
import { type MouseEvent, useState } from "react";

import {
Expand Down Expand Up @@ -71,34 +72,34 @@ export function SessionsSidebar() {

return (
<Sidebar collapsible="offcanvas" className="shell-sidebar select-none">
<SidebarHeader className="gap-0 p-0">
<div className="px-2 pt-2 pb-2">
{/* The icon centers on the input alone, not on the padding below it. */}
<div className="relative">
<Search className="pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-ink-muted" />
<SidebarInput
type="search"
placeholder="Search"
aria-label="Search sessions"
value={query}
onChange={(event) => setQuery(event.target.value)}
className="h-7 rounded-md border-transparent bg-transparent pl-8 text-ui shadow-none focus-visible:bg-selection-subtle"
/>
</div>
<button
type="button"
onClick={startNew}
className="mt-1 flex h-7 w-full items-center gap-2 rounded-md px-2.5 text-left text-ui text-ink outline-none hover:bg-selection-subtle focus-visible:ring-2 focus-visible:ring-ring press"
>
<SquarePen className="size-3.5 text-ink-muted" aria-hidden />
New session
</button>
<SidebarHeader className="gap-1 px-2 pt-2 pb-2">
<div className="relative">
<HugeiconsIcon
icon={Search01Icon}
size={16}
className="pointer-events-none absolute top-1/2 left-2 -translate-y-1/2 text-ink-muted opacity-70"
aria-hidden
/>
<SidebarInput
type="search"
placeholder="Search"
aria-label="Search sessions"
value={query}
onChange={(event) => setQuery(event.target.value)}
className="h-8 rounded-md border-edge bg-transparent pr-2 pl-8 text-ui shadow-sm placeholder:text-ink-muted focus-visible:border-edge-focus focus-visible:bg-selection-subtle focus-visible:ring-0"
/>
</div>
<button
type="button"
onClick={startNew}
className="flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-ui font-medium text-ink-muted outline-none hover:bg-selection-subtle hover:text-ink focus-visible:ring-2 focus-visible:ring-ring press"
>
<HugeiconsIcon icon={SquarePenIcon} size={16} className="shrink-0 opacity-70" aria-hidden />
New session
</button>
</SidebarHeader>
<SidebarContent className="gap-0 px-2 pb-2">
<h2 className="flex h-7 shrink-0 items-center px-2.5 text-2xs font-medium text-ink-muted">
Recent sessions
</h2>
<h2 className="flex h-7 shrink-0 items-center px-2 text-ui font-medium text-ink-muted">Sessions</h2>
{problem !== undefined ? (
<OpenProviderSettings
problem={problem}
Expand All @@ -116,7 +117,15 @@ export function SessionsSidebar() {
<span>No projects yet</span>
{addProject !== undefined && (
<EmptyAction
icon={<Plus className="-mx-0.5 size-3" strokeWidth={2} aria-hidden />}
icon={
<HugeiconsIcon
icon={PlusSignIcon}
size={12}
strokeWidth={2}
className="-mx-0.5 size-3"
aria-hidden
/>
}
onClick={addProject}
>
Add project
Expand Down Expand Up @@ -155,9 +164,9 @@ export function SessionsSidebar() {
<SidebarFooter className="p-2">
<Link
to="/settings/workspaces"
className="flex h-7 items-center gap-2 rounded-md px-2.5 text-ui text-ink-muted outline-none hover:bg-selection-subtle hover:text-ink focus-visible:ring-2 focus-visible:ring-ring press"
className="flex h-8 items-center gap-2 rounded-md px-2 text-ui font-medium text-ink-muted outline-none hover:bg-selection-subtle hover:text-ink focus-visible:ring-2 focus-visible:ring-ring press"
>
<Settings className="size-3.5" aria-hidden />
<HugeiconsIcon icon={Settings02Icon} size={16} className="shrink-0 opacity-70" aria-hidden />
Settings
</Link>
</SidebarFooter>
Expand Down
8 changes: 5 additions & 3 deletions apps/web/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ function Root() {
widthStorageKey="codework.sidebar.width"
>
<NavigationControls />
<div className="mx-2 mb-2 flex min-h-0 flex-1 overflow-hidden rounded-xl border border-edge bg-frame">
<div className="flex min-h-0 flex-1">
{inSettings ? <SettingsSidebar /> : <SessionsSidebar />}
<div className="flex min-w-0 flex-1 flex-col overflow-hidden">
<Outlet />
<div className="mr-2 mb-2 ml-2 flex min-h-0 flex-1 overflow-hidden rounded-xl border border-edge bg-frame md:ml-0">
<div className="flex min-w-0 flex-1 flex-col overflow-hidden">
<Outlet />
</div>
</div>
</div>
<Palette />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/shell/titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function NavigationControls() {
<header className="flex h-titlebar w-full shrink-0 items-center bg-desktop pr-2 select-none [-webkit-app-region:drag]">
<div
className={`flex shrink-0 items-center gap-1 px-2 ${insetTitleBar ? "min-w-44 pl-20" : "min-w-28"}`}
style={{ width: withSidebar ? "calc(8px + var(--sidebar-width))" : undefined }}
style={{ width: withSidebar ? "var(--sidebar-width)" : undefined }}
>
<button
type="button"
Expand Down
5 changes: 2 additions & 3 deletions apps/web/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,16 @@

/* The sidebar sits inside the app frame beneath the title bar. */
.app-shell [data-slot="sidebar"] > .shell-sidebar {
left: 8px;
left: 0;
top: var(--cw-titlebar-height);
height: calc(100svh - var(--cw-titlebar-height) - 8px);
border: 0;
border-right: 1px solid var(--cw-edge);
border-radius: 12px 0 0 12px;
background: var(--cw-sidebar);
backdrop-filter: blur(24px);
}
.app-shell [data-collapsible="offcanvas"] > .shell-sidebar {
left: calc(8px - var(--sidebar-width));
left: calc(0px - var(--sidebar-width));
visibility: hidden;
}
.app-shell .shell-sidebar [data-slot="sidebar-inner"] {
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading