Repository navigation
feat: the Pine app's page is drawn with Tailwind and stock shadcn components on Base UI, with no hand-written stylesheet - #21
Merged
Conversation
… and its dark look follows a class on the page Tailwind v4 through its Vite plugin, and shadcn initialised on Base UI with lucide icons (components.json, src/index.css, src/lib/utils.ts). shadcn's tokens point at pine's own colours, so the light palette and the poimandres dark one stay where they were, and the font stays the system's. pine's --accent and --muted are renamed --brand and --text-muted, since shadcn uses those names for other things. Dark is now the `.dark` class on the root element, which src/theme.ts keeps in step with prefers-color-scheme, which Electron's native theme (the Appearance setting) drives. The stylesheet's dark media blocks became `.dark` rules, and Storybook's theme toolbar sets the class instead of rewriting media rules. A desktop test checks that Dark, Light and System put the page in the right appearance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…adcn's, with keyboard and focus of their own, and its icons are lucide's The hand-made Button, Switch, Field, Segmented and Icon are gone: shadcn's Button, Switch, Field, Input, Textarea, Tabs and Select take their place, as the CLI added them, and lucide draws every icon (the logo stays). The settings' native selects are Select, chosen with the keyboard alone; the segmented controls are tab lists the arrow keys move along. pine keeps two small compositions in ui.tsx: a labelled field and a choice. Their CSS and stories are removed; the desktop tests aim at data-slot and roles and carry over PR 18's checks for these pieces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… coloured on the page with its language and a copy button, and pine's own rules for links, pictures and cleaning The old renderer (marked, DOMPurify, highlight.js) is gone. Three of Streamdown's defaults are replaced, because they are not safe for the page: a sanitize rule set of pine's own (data: pictures kept, style/class/id and active tags removed), the link (no href, opened in the owner's browser, address beside it) and the picture (a web address is a line to click, fetched by the daemon; no download button). The desktop markdown test fails without each of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… agent asks can be answered right in the conversation Messages, thinking, tool calls, the turn's work, steps, the agent's requests and questions, the welcome's suggestion, the code panel's file tree and tool output use the stock AI Elements components (Message, Reasoning, Tool, Task, Confirmation, Suggestion, File Tree, Terminal). Answers stay on pine's own Streamdown renderer inside Message. An approval is allowed or denied from its line, and a question answered by one of its suggestions; the dialog still opens as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, and ask before removing anything in an alert dialog Every dialog (settings, pickers, the palette, approvals, questions, the picture viewer) is shadcn's Dialog on Base UI; lists to pick from are shadcn's Command. What cannot be taken back (remove, sign out, stop, leave unsaved) is asked in an AlertDialog instead of a button clicked twice or the system's confirm(). The old Dialog and Confirm pieces and their CSS are gone; stories in light and dark. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the arrow keys, and their lists and the file tree are walked with the keyboard The side bar and the code panel sit in shadcn's Resizable: drag an edge, or focus it with Tab and use the arrow keys. Their widths are kept under the same keys as before, and only what the owner set is kept. The hand-rolled drag code and its CSS are gone. An agent's group in the side bar folds with shadcn's Collapsible (Enter or Space), and its conversations are one Tab stop the arrows move in. The code panel's file tree, its file search and its changes are a tree and lists on ui-sdk (shadcn has no such primitive, and AI Elements' file tree has no arrow keys): arrows open, close and move, typing finds a name, Enter opens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The code panel keeps the ui-sdk tree (arrow keys, typing, one tab stop) over the AI Elements file tree, which has none of these; its now unused file-tree.tsx is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s hidden right after The width is worked out from the layout the edge reports, not measured after the next frame, which could come after the side bar was gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t it shows, and its confirmations are found by their trigger cmdk's active line is chosen again once the list is drawn, both steps rendered at once, so that a key pressed right after the list appears always lands on a line. The desktop tests find a confirmation's button by its alert-dialog trigger. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e / commands and @ files are a combobox The message box is the stock Prompt Input; its buttons (attach, model, reasoning, mode, folder, voice, send or stop) are Prompt Input buttons. The suggestions for `/` and `@` are the stock shadcn Combobox, with the textarea as its input: arrows move the highlight, announced on the field; Enter or a click picks, Tab picks too; Escape closes the list and keeps the text. A command typed out whole is run by Enter. Voice input, attachments, drop, paste and the earlier inputs on the arrows behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m of the window Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as Sonner has them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a conversation does not draw them again Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ghted line even while a notice comes or goes cmdk hands a line chosen by the pointer to onValueChange, which React renders at the pointer's lower priority. useActiveLine let the value go and re-picked the first line that way in a frame, so while the page was busy (a Sonner notice animating) no line was chosen for a few frames, and an Enter typed then chose nothing. The re-picked value is now committed at once with flushSync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…drawn with Tailwind utilities on stock shadcn components, at one density set on the root styles.css is gone. pine's colours, shadcn's tokens, a 15px root font-size and a few base rules (scrollbars, selection, find highlights, the window's drag regions) live in index.css; everything else is utilities on Tailwind's default scale. LabeledField and Choice move to src/components/. The settings box class is renamed set-group. The desktop reference and AGENTS.md describe the stack, the stock-only rule, the shadcn CLI, and Streamdown's three overrides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ponents are again exactly what the shadcn CLI installs shadcn's skill is installed with `npx skills add shadcn/ui` into desktop/.agents/skills, locked in desktop/skills-lock.json and linked for Claude Code from desktop/.claude/skills. Nine stock components had drifted from their registry item by a "use client" line (the CLI keeps it when a component comes in as another item's dependency); each was added again on its own with the CLI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tself, with no forced redraw, and a screen reader still hears which line is chosen The lists are cmdk's own again (no controlled value): cmdk chooses the first line, the arrows and the pointer move it, and Enter takes what it has drawn chosen. What stays of pine's is useNamedLine: cmdk 1.1.1 does not name the line it chooses itself in aria-activedescendant, so that line is chosen once more as the pointer would, in cmdk's store. flushSync is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n shadcn's ScrollArea, with no native scroll bar, and fade where they are cut Every scrolling region of the window, the panel beside a conversation, the event log and the dialogs goes through one composition, src/components/scroll-fade-area.tsx: stock ScrollArea with shadcn's scroll-fade utility on its viewport. Nested scrollers are gone (the browser view, the question's choices); CodeMirror keeps its own scroller, and the pickers keep cmdk's list with the fade on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Kbd, Empty, Avatar, Item, Spinner, Alert, InputGroup and Tooltip where they were drawn by hand - Keys are stock Kbd; icon buttons are named and hinted by one text through a stock Tooltip (src/components/hint.tsx); the tab's close is a button the keyboard reaches. - Empty views are stock Empty (ui.tsx keeps a one-line composition); a view being read shows stock Spinner, and the green dot stays for an agent at work. The first screen is an Empty. - Agents' letters are stock Avatars; the agent view's lines are stock Items (buttons when they open something) and its facts outline Badges; running programs are Items. - Badge colour overrides are gone (stock variants); the file changed on disk is an Alert; the event filter and the file search are InputGroups; tool calls in Output are a list the keyboard can walk. - Pickers keep stock dialog padding. Tests select hinted buttons by aria-label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…utput scroll in shadcn's ScrollArea, with no native scroll bar, and fade where they are cut Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leGroup, Badge, Alert, Spinner, Empty and Tooltip: every setting's name labels its control, lists can be reached with the keyboard, and option sets are toggle groups instead of tabs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and the event tabs keep shadcn's own spacing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…follows an answer while you are at the end, holds still when you scrolled up, and its button brings you back; your messages are bubbles on your side, with their files as attachments The hand-made stick-to-bottom code (scroll listener, layout effects, a ResizeObserver per row, the "Latest" button) is gone: stock MessageScrollerProvider (autoScroll, opening at the end), MessageScrollerItem per row (the owner's message anchors its turn) and MessageScrollerButton. Turns are core Message, with Bubble for the owner's and Attachment for the files it brought. Added with the shadcn CLI: message-scroller (and @shadcn/react), message, bubble, attachment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…needed, with no wrapper that only renames them, and shows work with a spinner Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in the side bar and the tabs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nce it has opened Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n App.stories.tsx and ui.stories.tsx instead of src/ui/ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…x.css, dialogs scroll at one token, and keyboard lists and single-choice toggles share one wiring Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d again, and the code editor's text size no longer depends on utilities used elsewhere The stock code-block line variants only tint a line (added is the neutral muted tint), so pine's diff colours are laid over them at the call site. The editor's theme reads three Tailwind theme variables from script; an @theme static block keeps them emitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…emoved and hunk lines Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ories have no docs page index.css keeps the app's body overflow-hidden (each pane scrolls itself), and Storybook draws a docs page into that same body, so no docs page could be scrolled. preview-head.html lets the body scroll while the docs root has content; a story's canvas keeps the app's rule. The App stories are dialogs that would all open at once on one docs page: `!autodocs` drops it. Metas no longer repeat the title Storybook infers from the file path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th their stories beside them ApprovalDialog, QuestionDialog, PickDialog, Palette and Lightbox move out of App.tsx unchanged, each with its stories (ApprovalDialog.stories.tsx and so on) in place of App.stories.tsx. The two helpers they share move to the modules that fit: useNamedLine to lists.tsx, useOpener to ui.tsx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mpty view are components with their stories, the hooks files of their own Logo and EmptyView move unchanged to components/logo.tsx and components/empty-view.tsx, with their stories beside them (Components/Logo, Components/EmptyView) in place of ui.stories.tsx; useLoad goes to use-load.ts and useOpener to use-opener.ts. ui.tsx is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… of its own, without the shared Lightbox and its pine:zoom event Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…without state of its own Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn stock Dialog, and a sign-in left unfinished is cancelled when the dialog closes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… by its trigger, closed by Base UI once the source is added Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n finalFocus, and set the field that takes focus with initialFocus instead of autoFocus and use-opener Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… conversation is narrow The toolbar under the message box kept the reasoning and mode buttons and the outside-content badge at their full width (stock buttons and badges do not shrink), so in a narrow conversation the row grew wider than the box and the send button stood half outside it. Their words now give way to their icons below a width of the bar, the badge's words are cut first, and a Narrow story shows the box at 20rem. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hrough its modes, instead of a dark twin per story Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en, instead of stepping on each other A tab could shrink to 4rem, less than its avatar, gaps and close button take, so what did not shrink spilled over the next tab. Its least width now leaves room for a few letters of the name; past that the row scrolls, and the tab brought to the front is scrolled into view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g closes before the sign-in has started Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rger and close Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings next's desktop work into the shadcn migration: the conversation's browser opening running programs' addresses, worktree conversations, branching from a message and the gray focus ring. styles.css stays deleted; next's new rules are ported to stock shadcn components and Tailwind utilities (Empty/EmptyContent for the empty browser's lists, MessageFooter for the branch button, a ghost Button for the worktree chip, padding steps for a branch's row, --ring set to the gray --faint). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wser find the stock markup of the Pine app The branch button is found by its label under the owner's message, the worktree and folder chips by data attributes, dialogs and toasts by their stock slots, the empty browser's lists by data-offer, and a branch's row by standing further in than the one it was made from. The conversation story shows an owner's message that can be branched from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sages; branching from one is in its right-click menu The row that held the branch button stayed under every message of the owner's even while the button was hidden. It is gone, and "Branch from here" stays in the menu of a right click on the message. The desktop test branches through that menu, and the live browser test finds the stock dialog and button markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… browser's tab strip shows no empty scrollbar lightningcss (Tailwind's optimize pass and Vite's default CSS minifier) folded animation-timeline into the animation shorthand, which Chromium drops: shadcn's scroll-fade never faded in a build, only under vite dev. The page's CSS is now minified by esbuild, in the app and in Storybook. The browser's tab strip makes room for the line under the tab in front, as the panel's tabs do, so its ScrollArea no longer overflows vertically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es, not by leftover class names Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…find its parts by stock attributes, roles and data-slot The bare class names left from the deleted stylesheet were hooks for the tests only. Each is gone: a test now selects by what stock already gives (data-slot of shadcn's parts, roles, accessible names, data-variant), and where nothing tells one of pine's own elements apart it carries a data-slot of its own (composer, code-panel, conversation-head, tab, tab-name, agent-label, service-status, settings-page, markdown) or a data attribute for a state (data-active, data-live, data-tone, data-setting) instead of a state class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bar's scroll bar shows only while it scrolls The memory block in the Agent view was as wide as the panel plus its side margins, so the view's scroll area could be pushed left. It now takes the width left beside its margins. The side bar's scroll bar fades out at rest and shows while the list scrolls or under the pointer, as the conversation's does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t scrolls or under the pointer One rule on the stock scroll area's bar replaces the side bar's own classes, so the lists, panels, dialogs and settings all fade their bar the same way; the fade at a cut edge already says there is more. The Agent view's test from the cherry-picked fix finds its parts by data-slot, and checks the bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #16 (Storybook and Chromatic). Replaces #18: its dialog tests are carried over here, on shadcn's Dialog and AlertDialog.
What changes for the owner
The Pine app's page moves from a hand-written stylesheet (styles.css, 2,860 lines, deleted) to Tailwind v4 and stock shadcn components on Base UI:
@streamdown/codeonly (no Mermaid, no KaTeX). Its defaults are not safe here, so three are replaced: the cleaning rules, links (address beside them, opened in the owner's browser) and pictures (a web picture is a line to click). The markdown test fails without each..darkclass that follows the system. The page's density is one root font-size.desktop/.agents/skills.No change to the daemon, the control API, the page's content policy or Electron's main process.
Rules this sets (AGENTS.md)
src/components/ui) is never edited. Add and update them with the shadcn CLI andcomponents.json. A variant or composition lives elsewhere undersrc/components/, and only for what stock cannot do.src/index.css.@radix-uiimport and no direct dependency.cmdk, used by stock Command, still pulls Radix packages.Checks
npm run check, desktopnpm run check,npm run build-storybook: pass.npm run desktop:test: 41 pass, 0 fail, 2 live tests skipped. One browser-panel test failed once and passed on rerun.npm test: 404 pass, 3 fail. Two of them (parallel sub-agents, presence) also fail on the base, and the third (sources fresh-conversation) is a flake.Left for later
Suggestions from the pre-merge review that were not taken:
text-xs/text-baseoverrides remain, and the body setstext-smon top of the root size.max-h-[60vh].Log,LinebesideLabeledField).🤖 Generated with Claude Code