Repository navigation
feat: show webfetch responses and use active model for commit messages - #54656
Closed
divyanshusingh2903 wants to merge 95 commits into
Closed
divyanshusingh2903 wants to merge 95 commits into
divyanshusingh2903 wants to merge 95 commits into
Conversation
Copied source from anomalyco/opencode (branch dev, commit 95daf90), excluding git history. Removed the standalone TUI client package (packages/tui) per project decision to focus on the desktop app as the primary client. Renamed root package to "forge", updated README, and added NOTICE.md crediting OpenCode under its MIT license. LLM provider connection code is untouched — copied as-is, no rebrand of the provider/model layer in this commit. Co-Authored-By: Claude Sonnet 5 <[email protected]>
packages/opencode's CLI layer imports @opencode-ai/tui directly for its tui subcommand (src/cli/tui/*, src/cli/cmd/run/*) — deleting the package without also removing those import sites breaks bun install and the build. Restoring it rather than doing that surgery unreviewed; proper TUI removal is deferred to its own change. Also drops packages/cli (bin "lildax"), an unrelated internal daemon tool that was the only other thing depending on the removed tui package. Co-Authored-By: Claude Sonnet 5 <[email protected]>
First step of the desktop redesign toward a Claude-Code-like feel: replaced the saturated blue accent (#034cff family) used for selection/focus/interactive states in packages/ui/src/styles/theme.css with a warmer terracotta (#c96442 family), light and dark mode both. Structural change only — same token names, same usage sites, just different hex/rgba values, so nothing downstream needed to change. Not yet visually verified end-to-end: packages/app run standalone (outside Electron) has no server connection bootstrap, since that normally comes from the desktop shell's IPC layer, so session/composer/dock views that would show this color in use couldn't be exercised in this sandbox. Confirmed only that the app shell (sidebar, empty state) still renders correctly and the dev server hot-reloads without error. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The previous commit (5e024da) edited packages/ui/src/styles/theme.css, which turned out to be dead weight at runtime for the active theme: the app injects a <style> tag at startup (packages/ui/src/theme/loader.ts) built from packages/ui/src/theme/themes/oc-2.json via a palette resolver (theme/resolve.ts, theme/v2/resolve.ts). That injected stylesheet is unlayered CSS, so it wins the cascade over the @layer-wrapped theme.css regardless of what's in it — confirmed via devtools (data-theme="oc-2" on <html>, inline-injected <style id="opencode-theme">). Changed the actual source: palette.interactive (light+dark, the base accent color) and overrides.surface-interactive-weak in oc-2.json, plus the v2Overrides accent keys (previously pointing at var(--v2-blue-*), remapped to the equivalent var(--v2-orange-*) steps since no terracotta scale exists in the v2 palette yet). theme.css from the previous commit is left as-is — it's a legitimate fallback (pre-hydration flash, non-oc-2 themes) and is now consistent with this value rather than dead/wrong. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Scoped restyle only (per user decision: keep the icon-rail + panel architecture as-is rather than restructuring to a flat list, since it's load-bearing for drag-reorder, git-worktree awareness, and per-workspace collapsible session lists in sidebar-workspace.tsx). - Rail width 64px -> 56px, tighter gaps/padding (sidebar-shell.tsx) - Project tiles 40px -> 36px, softer radius (rounded-lg -> rounded-xl) - Selected-project indicator: thick 2px neutral border -> thin border using the terracotta accent color, instead of an unrelated neutral strong border (sidebar-project.tsx) - Workspace/session row padding tightened (py-1.5 -> py-1), softer radius (rounded-md -> rounded-lg), both the normal and rename-mode variants (sidebar-workspace.tsx) Class-only changes, no logic touched. Verified with a clean `bun run build` in packages/app before committing. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Two issues from the last screenshot: 1. The "Home" toggle button (titlebar.tsx) was using icon name "grid-plus" (a 2x2 grid glyph) with no actual house icon existing in the v2 icon set to swap in. Added one (packages/ui/src/v2/ components/icon.tsx) and pointed titlebar.tsx at it. 2. The home page's project list (home-projects-view.tsx <aside>) had no background/border at all -- same bg as the session list next to it, so it read as one flat page rather than sidebar + content. Gave it a subtly darker background (bg-v2-background-bg-deep, one layer deeper than the card's own bg-base), a right border, and extended it flush to the card's left edge (negative margin matching the card's own padding) at the lg breakpoint. Note: the shading only covers the aside's existing box (below the sticky search header), not the full card height edge-to-edge like Claude Code's actual sidebar -- doing that would mean restructuring the header/search area layout, which is a bigger change than this pass. Flagged for the user rather than attempted blind. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Root cause of the sidebar edits not showing up in earlier screenshots: sidebar-shell.tsx (edited two commits ago) is wired into pages/layout.tsx, imported as LegacyLayout -- not the active code path. The real active persistent shell is pages/layout-new.tsx, which previously had no sidebar at all: just a Titlebar and a <main> slot. The project list only existed inside pages/home.tsx's own page-local grid layout, which is why it disappeared outside the home route. Changes: - layout-new.tsx now mounts createHomeController/createHomeProjectsController once and renders HomeProjects (the existing project-switcher component, already has DnD reorder, per-server grouping, add/edit/close) as a persistent left column next to <main>, so it's present on every route (home, session view, draft/new-session) instead of only on `/`. - home-projects-view.tsx's <aside> classes simplified: removed the mt-14/pt-[52px]/sticky/negative-margin offsets that were tuned for sitting inside home.tsx's own card+search-header layout, replaced with a plain full-height flush column (w-260px, bg-v2-background-bg-deep, border-r) appropriate for its new persistent context. - home.tsx: removed its now-duplicate HomeProjects column (kept a lightweight controller instance only for the mobile Settings/Help utility nav, which still needs it). - icon.tsx: rebuilt the "home" icon glyph using the same stroke pattern as other working icons (previous version rendered blank for a reason I could not fully root-cause without live devtools access -- flagging this honestly rather than claiming certainty). Scope note: sessions grouped by project (collapsible) with a pinned current session, and collapsing the Home route into the new-session composer view, are NOT done here -- both touch draft-tab creation and session-query grouping logic I haven't fully traced, and this was already a large enough change to verify in one pass (clean build + typecheck, not yet visually confirmed). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Three fixes from the latest screenshot: 1. Sidebar panel corners rounded (top-right/bottom-right, where it meets main content) instead of a hard-edged divider. 2. Confirmed the home icon fix from the last commit actually works -- verified live in the sandbox preview rather than guessing again. The single-path version was the broken one; the two-path rebuild renders correctly. 3. The real feature: each project row in the persistent sidebar now has a collapse chevron. Expanding it (default-expanded for the selected project) fetches that project's session list directly via global.ensureServerCtx(server).sync.child(directory) + the existing sortedRootSessions helper -- same underlying data source the legacy sidebar used, just wired for the new per-server-aware routing. Clicking a session opens it via a new openSession() in layout-new.tsx that mirrors home-sessions-controller.tsx's open() but takes the session's own server explicitly, rather than assuming whatever server the home controller currently has "focused" -- that assumption would have been wrong here since the sidebar shows projects across potentially multiple servers at once. The currently open session is highlighted via useLayout().route(), matching against server+sessionId. Verified: clean typecheck and build. NOT visually verified with real session data -- the standalone sandbox preview can't connect to a server without Electron's IPC bootstrap (hit this same wall twice already this session), so this needs your check in the real app. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Shows the top 5 most-recently-updated sessions across all projects (and all servers, since a user could have more than one connected), above the "Projects" header in the persistent sidebar. Deliberately did NOT reuse createHomeSessionsController's aggregate session-index query for this, even though it already computes almost exactly this. That controller also registers global commands and markdown-preload/dialog effects via useCommand()/useDialog() -- home.tsx already instantiates one of those for the `/` route, and mounting a second, permanently-live instance in layout-new.tsx risked duplicate command palette entries while on that route. Instead this reuses the same low-risk primitives already proven for the per-project collapsible lists (sortedRootSessions + global.ensureServerCtx(...).sync.child), just merged across every project and sorted by compareSessionTime. Tradeoff: this issues one query per project (bootstraps each project's session store) rather than the single aggregate query the home page uses, so it's less network-efficient for someone with many projects. Acceptable for a small project count; flagging the tradeoff rather than hiding it. Added one new i18n string (home.recentSessions) to en.ts only -- other locale files will fall back to English for it until backfilled. Verified: clean typecheck and build. Not visually verified with real session data (same sandbox limitation as the last two commits). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Root cause of "no shade change on hover" (and likely other silently broken v2 colors app-wide, not just in the sidebar): v2/styles/colors.css and v2/styles/theme.css define hundreds of --v2-* custom properties, but nothing ever registered them as Tailwind @theme colors the way script/tailwind.ts does for the v1 token set. Every bg-v2-*/text-v2-*/ hover:bg-v2-* utility class was a silent no-op -- verified directly by checking the generated stylesheets in a browser, not guessing. Added script/tailwind-v2.ts (mirrors script/tailwind.ts's pattern) that scans colors.css + theme.css for `--v2-<name>:` declarations and emits `--color-v2-<name>: var(--v2-<name>)` mappings into a generated tailwind-colors.css, now imported by v2/styles/tailwind.css. Deliberately does NOT include the v1 generator's `--color-*: initial` reset -- both token sets load into the same cascade, and resetting here would wipe out the v1 registrations too. Verified post-fix: `.hover\:bg-v2-background-bg-layer-01:hover { ... }` now exists as a real rule in the built stylesheet (previously absent). Added a generate:tailwind-v2 script to packages/ui/package.json mirroring the existing generate:tailwind, for when the token files change. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ning Per feedback: the auto-computed recency strip wasn't what was wanted -- replaced with actual pin/unpin, persisted across app restarts and windows (Persist.global, same mechanism used elsewhere in the app -- see packages/app/src/utils/persist.ts -- rather than hand-rolling raw localStorage, which would've missed the desktop-native storage backend Electron uses). New: packages/app/src/pages/home/pinned-sessions.ts -- a small createPinnedSessions() store (isPinned/toggle/remove/entries), keyed by "server\0sessionID" pairs so pinning is correct per-server, not just per-session-id. Every session row (both in the pinned strip and each project's collapsible list) now shares one HomeSessionRow component with a hover-reveal three-dot menu: Pin/Unpin (toggles the above), and Delete (confirmation dialog matching the existing pattern from message-timeline.tsx's DialogDeleteSession, calling ctx.sdk.api.session.remove -- the real delete endpoint, not the "archive" soft-delete home-sessions-controller.tsx uses elsewhere). Structured as one shared row component specifically so a later "Fork" action (mentioned as a near-term addition) is one more MenuV2.Item, not a second place to duplicate this wiring. Added 3 i18n keys to en.ts only (common.pin, common.unpin, home.pinnedSessions replacing the just-added home.recentSessions) -- other locales fall back to English until backfilled. Verified: clean typecheck and build, no console errors on load in the sandbox preview. Hover-shade fix (previous commit) confirmed structurally (class present on the row, matching CSS rule exists) but not visually -- this automation layer's synthetic hover doesn't reliably trigger a real :hover match; that needs your eyes in the actual app. Pin/delete/menu interactions themselves are UNVERIFIED beyond typecheck -- same sandbox limitation as every session-data-dependent change this session (no server connection without Electron's IPC bootstrap). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Confirmed bug: the collapse chevron I added on each project row
(collapsible session list) used a plain local createStore with no
persistence, so it reset on every reload. Compare to the pre-existing
server-collapse toggle in home-projects-controller.tsx, which already
uses persisted(Persist.global("home.servers"), ...) -- that one
survives reloads correctly. Missed applying the same pattern when I
added the per-project version.
Fixed by switching to the identical persisted()/Persist.global()
mechanism, keyed "home.sidebar.sessionsExpanded" so it doesn't collide
with the existing "home.servers" key. Toggle semantics unchanged: an
explicit user toggle always overrides the "auto-expand the selected
project" default, now it just survives a restart.
Verified: clean typecheck and build. Not re-tested end-to-end in the
running app (same sandbox limitation as before) -- confidence here
comes from this being a verbatim pattern match to the already-working
server-collapse persistence in the same file's sibling controller, not
from a fresh test.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
…l output Per feedback: verbose output (thinking traces, commands, outputs) should be visible by default, still collapsible. 1. Three settings defaults flipped false -> true in context/settings.tsx: showReasoningSummaries, shellToolPartsExpanded, editToolPartsExpanded. These already existed and were already wired into partDefaultOpen() (packages/session-ui/src/components/part-default-open.ts) -- just defaulted closed. 2. Real bug found beyond the settings: grouped "Explored N reads, M searches" tool summaries (ContextToolGroup) don't go through partDefaultOpen at all -- message-timeline.tsx's own `open` memo did `toolOpen[key] === true`, so an untouched (undefined) group always read as collapsed regardless of any setting, with no way to default it open. Changed to `!== false`: unset now means open, an explicit user collapse still sticks. 3. Separately, found that expanding a shell/bash tool result showed only raw output with no visible command -- the command text only rendered in the *collapsed* preview (ShellSubmessage, gated on `!open()`). Added a persistent command header inside the expanded block (message-part.tsx, new data-slot="bash-command") so "$ <command>" stays visible above its output once expanded, plus gave the block an actual shaded background (was `background: transparent`) so it reads as a distinct block rather than blending into the message. Verified: clean typecheck (app + session-ui) and build. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Unifies two previously-separate concepts into one selector, matching how Claude Code's own mode picker works: "Plan" is an agent switch (the native "plan" agent already exists server-side and was already reachable via the composer's agent selector -- no new plumbing needed for that part). Manual/Accept Edits/Auto are permission-behavior variants, layered onto the EXISTING client-side auto-respond mechanism in context/permission.tsx (autoRespondsPermission, already wired to the live "permission.asked" event stream) rather than reimplementing approval flow -- that mechanism already existed and already worked for a plain on/off "auto-accept"; this extends it to three states. Changes: - permission-auto-respond.ts: added isEditPermission() (matches the edit/write/patch/apply_patch set already used by session-ui's part-default-open.ts, for consistency). - permission.tsx: added a second store field editsAccept, mirroring autoAccept's existing session-lineage-aware override mechanism (reuses the same generic autoRespondsPermission/sessionAutoAccept helpers -- no new logic needed there since they already operate generically on any Record<string, boolean>). shouldAutoRespond and shouldAutoRespondResolved now check autoAccept first (full auto), then editsAccept only when the request is edit-shaped. Added matching enable/disable/toggle functions, plus directory-wide variants for both stores (needed because composing a session's first message has no sessionID yet -- confirmed this is a common path, not an edge case, before building the directory fallback). Also exposed enableAutoAcceptDirectory/disableAutoAcceptDirectory, which existed internally but were never exposed outside a toggle. - prompt-input-v2.tsx: new `view.mode` control combining agent-is-plan + the two accept stores into one 4-state selector, deterministically setting state on select (not toggling) so switching modes is always unambiguous regardless of prior state. - session-ui's prompt-input/interaction.ts + index.tsx: added `mode` to PromptInputV2ViewConfig and render it via the existing PromptInputV2ConfiguredSelect, identical pattern to the agent/model/ variant selectors already there -- no new dropdown component built. - 5 new i18n keys in packages/ui/src/i18n/en.ts (session-ui has its own separate i18n dictionary from packages/app's). This touches permission-approval logic, which is safety-sensitive by nature -- verified clean typecheck (app + session-ui) and build, and a no-crash smoke test in the sandbox preview, but the actual approval behavior (does selecting Auto really auto-approve a bash command, does Accept Edits really leave bash alone, does switching away from Plan correctly restore the prior agent) is UNVERIFIED beyond code review. This needs real testing in the running app before trusting it, specifically: create a session, try each of the 4 modes, and confirm a risky action is actually gated/auto-approved as expected for each. Co-Authored-By: Claude Sonnet 5 <[email protected]>
missing mode dropdown, indistinct command blocks Root-caused each rather than guessing -- inspected the actual persisted settings file on disk and the real running app's control-visibility logic. 1. Collapsibles still collapsed by default: the app had already persisted shellToolPartsExpanded/editToolPartsExpanded/ showReasoningSummaries as `false` to ~/.config/ai.opencode.desktop.dev/default.dat (settings.v3 key) during earlier testing, BEFORE the default was changed to true two commits ago. Stored values win over code defaults in this app's merge logic, so the default change alone never took effect for this already-initialized install. Fixed with a one-time forced migration (settings.tsx) that flips these three fields true exactly once, guarded by a `verboseDefaultsMigratedV1` marker so it doesn't permanently clobber a real future user choice to turn them back off -- migrate() runs on every load, not just once, so an unconditional force would have been a permanent lock, not a fix. 2. No mode dropdown visible at all: it was there in code but gated on `props.controls.agents.visible`, which -- per local.tsx -- is false unless the user has a custom agent or has explicitly enabled "show custom agents"; false by default for a normal session (like the one in the screenshot). Removed that gate; the mode control is now always shown. Separately discovered this visibility flag doesn't just hide UI -- local.tsx's agent.current() forces "build" whenever agentsVisible() is false, ignoring whatever was actually selected. So selecting "Plan" through the mode dropdown would have silently failed to apply even with the gate removed. Fixed by calling settings.general.setShowCustomAgents(true) when Plan is selected, which is what actually makes local.agent.current() honor the selection. 3. Shell command/output blocks not visually distinct from prose: the background from two commits ago (--v2-background-bg-deep) turned out to be #fafafa against a #ffffff page -- a 1% brightness difference, invisible in practice. Checked the actual hex values in oc-2.json rather than assuming the token name implied enough contrast. Switched to bg-layer-02 (#f2f2f2) for the block and bg-layer-03 (#eeeeee) for the command header specifically, plus a 1px border-strong (20% alpha) instead of 0.5px border-base (10% alpha) -- gives the header a visible "titlebar" distinct from the output body, matching the reference screenshot's intent. Verified: clean typecheck (app + session-ui) and build. Same sandbox limitation as always for actually seeing this render -- please check the real app again, specifically: reload once (for the settings migration to run), confirm tool groups start open, confirm the mode dropdown appears next to the model selector, confirm shell blocks now have a visible boundary. Co-Authored-By: Claude Sonnet 5 <[email protected]>
1. Reasoning content had font-style: normal explicitly set on
[data-component="reasoning-part"] [data-component="markdown"] --
deliberately overriding italics. Flipped to italic (including strong/b
children, which had their own color override without an accompanying
style override).
2. Shell command/output blocks: the previous pass (gray backgrounds,
layer-02/03) was still correctly "gray" by design-system convention,
just not enough contrast for what was actually being asked for. Found
why a quick fix isn't as simple as reusing the shared Markdown/Shiki
pipeline for real syntax highlighting: markdown.css already has a
deliberate rule --
[data-component="markdown-code"][data-code-kind="shell"] code span {
color: var(--markdown-shell-code-token-color) !important;
}
-- that flattens ALL shell/bash/sh/zsh/fish/console/terminal code
blocks to one muted color everywhere else in the app (likely to avoid
noisy rainbow-highlighted one-liners in prose). Fighting that
!important rule just for this one component would mean either an
!important arms race or bypassing the shared worker-based highlighter's
key/disposal management by hand -- more integration risk than a
cosmetic request warrants.
Went with a different, decisive fix instead: theme-invariant dark
terminal styling (raw palette tokens --v2-grey-1100/1000/900, not the
light/dark-aware semantic ones), matching the common convention of
shell output reading as a terminal regardless of the app's own
light/dark mode. Command-line prompt ("$") now uses the accent orange
for a touch of color without going back into shell-syntax-highlighting
territory. Copy button icon color explicitly set (was inheriting an
ambient color tuned for light backgrounds, would have been invisible
against the new dark block).
Verified: clean typecheck (session-ui) and build. Visual result not
confirmed in the real app -- please reload and check contrast/legibility
of both changes, particularly the copy button's hover state against the
dark background.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
… actual style User feedback with a real reference: a screenshot of an actual Claude Code session showed its shell tool rendering is a light, clean bordered card (rounded corners, subtle tint header) -- not a dark terminal fill. The dark-terminal treatment from the previous commit was a reasonable guess at "not monotone gray" but turned out to just be the wrong direction once there was a concrete reference to check against. Swapped back to light tokens: background var(--v2-background-bg-base) with a visible border-strong (was the missing ingredient in the original gray-on-gray attempt -- a crisp border reads as a distinct card even without a strong background-color difference from the page). Command header uses layer-01 for a subtle tint, "$" prompt uses orange-800 (darker/more saturated than the orange-500 used for the dark version, since orange-500 wouldn't have enough contrast on light background). Output text and copy button icon reverted to their normal light-theme colors, since they'd been tuned for the dark version. Verified: clean typecheck (session-ui) and build. Co-Authored-By: Claude Sonnet 5 <[email protected]>
--font-family-mono (used broadly for code/diffs/terminal-style text, including the shell tool blocks and file diff viewer) was resolving to a plain system-monospace stack. Found the actual JetBrains Mono font was already loaded via @font-face in index.css, and a terminalFontFamily() helper already existed with the right stack -- just never wired to any CSS variable, so it did nothing. Rather than wire that separate unused path, changed the base fallback stack that --font-family-mono itself resolves from (monoFallback in settings.tsx) to lead with JetBrains Mono, matching terminalFallback's pattern. A user's own custom mono font choice (store.appearance.mono) still takes priority via the existing stack() merge logic -- this only changes what applies when nothing's been explicitly chosen. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The Write (create file) tool rendered content via mode="text" on the
shared file component -- plain syntax-highlighted display, no line-level
color at all. The Edit tool right next to it uses mode="diff" with a
before/after pair and correctly shows red/green per-line changes. For a
brand-new file the natural equivalent is a diff against empty content:
before="" / after=<the new file>, which makes every line render as an
addition (green), matching the standard git convention for a new file
and answering "there was no green when creating a new file".
Dropped the now-unused checksum()-based cacheKey along with the old
file={...} prop shape (mode="diff" takes before/after directly, no
separate cacheKey needed) and removed the now-dead checksum import.
Verified: clean typecheck (session-ui) and build.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Matches Claude Code's convention: 1 denies, 2 allows always, 3 allows once -- also shown as visible keycap badges on the buttons themselves (the existing Keybind component, same one used for other shortcut hints across the app). Guarded against firing while the user is typing: these are plain digit keys, unlike the Escape-only handler in packages/ui/src/context/ dialog.tsx (which doesn't need an input guard since Escape is safe to fire from anywhere) -- someone composing a message that happens to contain "1" while a permission request is independently pending must not have that keystroke silently deny the request instead of landing in their draft. Checks event.target against input/textarea/select/ contenteditable and bails on any modifier key held. Verified: clean typecheck and build. Not tested against a live permission request in the running app -- please confirm the guard actually holds (type "123" into the composer while a request is showing, confirm none of the three fire) alongside the happy path. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The "3" badge on the black "Allow once" button used the default light- opaque keybind styling (background: var(--surface-base)), reading as a stray light patch rather than part of the button. Scoped an override for [data-variant="primary"] buttons: translucent white background and text instead of the opaque light default, so it sits on top of whatever the button's own background is rather than fighting it. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…docked panel open
Per feedback: clicking the sidebar-right icon in the session header
used to directly toggle the full docked SessionSidePanel (git changes/
review). Now it opens a compact popover instead -- a scoped file list
(name + insertion/deletion counts, capped at 8 with an overflow count)
plus an "Open full review" button that actually opens the docked panel,
per the follow-up ask to keep a path to the detailed view.
Reused the existing status-popover.tsx pattern already established in
this same file (Popover from @opencode-ai/ui/popover, triggerAs/
triggerProps wrapping IconButtonV2) rather than introducing a new
popover mechanism -- ServerStatusPopover/DirectoryStatusPopover right
above this code already do exactly this "click icon in header, get a
popover with a footer action" shape.
Threaded the diff list itself in cleanly: session.tsx already computed
a single reviewDiffs() accessor shared with the full review tab and
the docked panel (both consume it via existing props), so this is
passed as a new optional `diffs` prop on <SessionHeader> rather than
duplicating any data-fetching -- the popover, the tab, and the panel
all read the same underlying list.
Added onReviewOpen (calls reviewPanel.open("other") explicitly) instead
of reusing onReviewToggle, since the popover's footer button must always
open the full panel, not flip it closed if it happened to already be
open behind the popover.
Verified: clean typecheck and build. Not visually verified in the
running app (this session's usual sandbox limitation) -- please check
popover positioning/sizing and that "Open full review" actually opens
the docked panel with the right file focused.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
… Code
Good news going in: almost everything needed already existed --
SessionContextUsage already tracked tokens/limit/usage% (session-
context-metrics.ts) and a full per-category breakdown estimator already
existed (session-context-breakdown.ts, used by the docked
session-context-tab.tsx). The gap was purely in how the trigger behaved:
click opened a docked panel tab directly, and the hover tooltip didn't
surface the context window size at all.
Changes:
- Tooltip (hover): now shows "{total} / {limit}" tokens as the primary
row, matching what was asked for -- tokens used, context window size,
and percentage together -- rather than total tokens alone with the
window size omitted entirely.
- Click: now opens a Popover (compact breakdown: same segmented bar +
category legend as the full tab, using the same
estimateSessionContextBreakdown()) instead of jumping straight to the
docked tab. A button inside the popover opens the full detailed view
(the pre-existing openContext()/session-context-tab.tsx), per the
explicit follow-up ask to keep that path reachable from the popup.
- The popover's systemPrompt() detection is deliberately simplified vs
the full tab's version (which stops at the most recent revert
boundary) -- unnecessary precision for a quick preview, so this just
takes the latest system prompt in the transcript.
- "indicator" variant (used read-only in the timeline header and side
panel) is untouched -- still a plain hover-only display, no click
behavior added there, since it never had one and this wasn't asked to
change.
Verified: clean typecheck and build. Not visually verified live --
specifically want a check on whether combining TooltipV2 (hover) and
Popover (click) on the same trigger element behaves cleanly, since
grep across the codebase turned up no existing precedent for combining
both interaction patterns on one trigger in this app.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
New minimalist anvil mark + pixel-block "FORGE" wordmark replacing the OpenCode logo assets, matching the existing block-icon visual grammar. Applied to the app icon, favicon, splash screen, and window/tab title. Renamed app-identity strings (window title, About/settings panel, update toasts, WSL onboarding, help intro) from OpenCode to Forge across the English strings and the shared app.name.desktop key in every locale. Left OpenCode's own product/technical names untouched where they refer to real upstream things Forge still depends on -- OpenCode Zen/Go, the opencode.json config format, the embedded OpenCode server sidecar, and the WSL install of the actual opencode CLI. Added a "Built on OpenCode" credit link in the settings panel footer, opening the upstream repo, since Forge is a frontend/workflow layer on top of OpenCode rather than an independent implementation. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Swap the literal anvil icon for a simpler abstract mark: three flat bars, single tone, gaps only between rows (not between blocks within a row). Applied to Mark/Splash in logo.tsx and regenerated both favicon SVGs to match. Co-Authored-By: Claude Sonnet 5 <[email protected]>
WordmarkV2 (the large faded background wordmark on the new-session screen) still spelled out OPENCODE in block letters -- missed in the earlier rebrand pass since it's a separate asset from logo.tsx's wordmark. Rebuilt it as FORGE using the same block-grid letterforms, opacity/mask/gradient fade treatment, and viewBox. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The bash tool card rendered its command line as plain unstyled text -- never tokenized at all -- which is why it looked like "just normal text" next to Claude Code's colored terminal. Added BashCommandLine, which runs the command through the existing markdown-worker Shiki pipeline (same one used for chat code blocks) and renders the resulting per-token spans. Separately, ```bash fenced code blocks in chat WERE tokenized by Shiki but an app-wide `!important` rule in markdown.css forced every span back to one flat color. Removed it so shell markdown blocks show their real syntax colors too. Also fixed the "OpenCode" Shiki theme's underlying --syntax-* tokens (oc-2.json), which were mapping keyword/function/attribute/number scopes to color roles that read as near-identical to plain text. Rebalanced them to mirror Claude Code desktop's own theme mapping (reverse-engineered from its shipped bundle): keyword/tag -> orange, function/attribute -> blue, type -> purple, string -> green, number/constant -> pink, regex -> yellow -- variable and punctuation intentionally stay plain/muted, matching Claude Code's own restrained treatment of those scopes. Co-Authored-By: Claude Sonnet 5 <[email protected]>
New SessionHeaderQuickActions component bundles the server-status popover, a new terminal toggle, and the review/sidepanel popover into one self-contained cluster (previously this logic only existed inlined in the titlebar's SessionHeaderV2Actions, tied to state computed there). Rendered next to SessionContextUsage in the session content header, in addition to the existing titlebar icons. Added a "terminal" icon to the v2 icon set (didn't exist there before, reused from the v1 icon component). The terminal toggle reuses the existing view().terminal state, which is already workspace/directory scoped, so opening it here creates/focuses a terminal in the session's own repo path with no extra wiring needed. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The titlebar's status/review icons were redundant now that the same cluster lives next to the context-usage circle, so removed them (along with the now-dead SessionHeaderV2Actions renderer). The review/sidepanel icon previously only opened a preview popover -- clicking it again while the panel was already open just reopened the same popover, so there was no way to close the panel from the icon. Replaced it with a direct toggle (opens/closes view().reviewPanel) and a hover tooltip showing "Toggle Review" plus the git +/- diff stats, instead of the click-triggered file-list popover. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The chat message card for the write tool always diffed against an empty "before" content, so overwriting an existing file rendered identically to creating a brand new one (all green) -- while the review panel correctly showed it as modified (red+green), since that reads the real git diff. The write tool's execute() already computed whether the file existed and its prior content (contentOld) for the permission-request diff, but only returned `exists` in its final metadata, not the content itself. Added `contentOld` to that returned metadata, and use it as the real "before" on the frontend when `exists` is true, so the inline card now matches what the review panel shows. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bun 1.4.x hangs these tests on Windows (ripgrep) and macOS (subprocess exit notifications). See #18
Windows runners need more than 20 minutes for the opencode suite, and stream test output so stalled packages are visible; also skip a PTY exit test on macOS that intermittently hangs under Bun 1.4.2.
Bun 1.4.x on macOS can lose the child's exit notification, causing cleanup to hang.
Retry bun install on Windows to dodge a patch-cache race (oven-sh/bun#28147), skip ACP/shell tests that hang under Bun 1.4.2 on Windows, and fix drive-letter handling in path comparisons for Windows temp dirs on a different drive.
forge release
- Regenerate PNG/SVG logo, wordmark, and favicon assets - Simplify SVG markup for logo and brand files - Update desktop app icons for beta, dev, and prod variants - Refresh identity marks and email template logo - Update splash, logo, and UI references in opencode CLI
fix(desktop): unblock macOS release builds and refresh Forge branding
Add Forge logo and plan-review screenshot, and rewrite the README with a header banner, download instructions, and updated agent/edit-mode documentation.
- Add web search results parser and rendered result list - Add tool response text helper with unit tests - Style web search and tool response blocks in message-part.css - Remove unused basic-tool code superseded by message-part rendering - Extend timeline playground story with web search examples - Add i18n strings for web search labels
…m message-part - Move tool response rendering into new tool-response component - Add clipboard helper module for shared copy behavior - Extend basic-tool with additional shared tool UI pieces - Slim message-part by removing roughly 140 lines of inline logic - Update AGENTS.md guidance
- Adjust timeline row building logic in rows.ts - Add tests covering current timeline row behavior - Simplify session turn component structure and styling - Extend basic tool and message part components for new row handling - Update timeline playground story to exercise the changes
- Add three new translation keys to every UI locale file - Keep locale files in sync with the base English strings - Update session timeline tool-state e2e regression spec - Align e2e expectations with the new tool-state labels
feat(session-ui): render web search results in message parts
…eline - Add tool response component with copyable text output - Parse web search results into structured, readable entries - Add clipboard helper and message-part styles for tool output - Update timeline rows and basic-tool to support new rendering - Add i18n strings across all locales - Cover new parsers with tests and playground stories
fix(session-ui): refine timeline row rendering and session turn layout
- Add link-preview service and instance HTTP API endpoint - Render reference cards and hover popups for markdown links - Add reference status and view helpers with tests - Regenerate JS SDK with new link preview types - Add i18n strings for reference preview UI - Wire reference handling into session page and message parts
- Add reference card translation keys to English locale - Add translations for reference card to 60 locale files - Remove reference strings from shared i18n context - Update reference card component to use new i18n keys
Add link preview reference cards and popups
- Support optional model and variant selection in VCS commit-message generation - Update generated SDK types and HTTP API handling - Preserve tool attachments and improve webfetch response rendering - Add timeline playground coverage for webfetch output variants
divyanshusingh2903
requested review from
Brendonovich and
Hona
as code owners
October 12, 2026 00:42
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
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.
Issue for this PR
Closes #25
Type of change
What does this PR do?
Two changes. They're unrelated; I can split them if you'd prefer.
1. Webfetch responses can be expanded (#25)
The
webfetchrenderer passedhideDetailsand had no children, so you could never see what a fetch returned. It now renders the sameToolResponsecard that websearch and MCP calls use, opens by default, and keeps the clickable URL in the header. The body is hidden when the output is empty or whitespace, or when the result has an image attachment. Image fetches only return "Image fetched successfully", so a body would add nothing. To support that check,ToolPartDisplaynow passesstate.attachmentsthrough to tool renderers on completed parts. Added webfetch stories (long markdown, raw HTML, image, empty, text) to the timeline playground.2. Commit message generation uses the active model
"Generate commit message" in the review panel used the model stored on the session, not the one currently selected in the prompt box. If you switched models mid-session, it still used the old one, or failed when the session had no model saved.
/vcs/commit-messagenow accepts an optionalmodel(providerID,modelID,variant) and falls back to the session model when it's omitted. The review panel sends the prompt's current model. SDK regenerated.The prompt also now allows an optional body of up to 5
-bullets for changes that one line can't cover. It tells the model not to add attribution or Co-authored-by trailers.conventionalCommit()keeps only the bullet lines right after the subject and drops everything else.How did you verify your code works?
bun typecheckinpackages/opencode,packages/app,packages/session-ui/vcs/commit-messagescenario in the httpapi exerciser: the session has a stale model, the request passestest-model, and it succeeds.Screenshots / recordings
Checklist