Skip to content

Commit ff75ab5

Browse files
committed
Merge main into loop/interface-zoom
Resolve merge conflict in docs/loop/feature-ledger.md: adopt main's canonical ledger and prepend this PR's interface-zoom (#69) row. No code changes.
2 parents 2126f9a + 3a4f438 commit ff75ab5

10 files changed

Lines changed: 227 additions & 12 deletions

File tree

apps/electron/src/renderer/components/app-shell/ChatDisplay.tsx

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,8 @@ export const ChatDisplay = React.forwardRef<ChatDisplayHandle, ChatDisplayProps>
584584
const [visibleTurnCount, setVisibleTurnCount] = React.useState(TURNS_PER_PAGE)
585585
// Sticky-bottom: When true, auto-scroll on content changes. Toggled by user scroll behavior.
586586
const isStickToBottomRef = React.useRef(true)
587+
// Show a floating "jump to latest" button when the user has scrolled far from the bottom.
588+
const [showScrollToBottom, setShowScrollToBottom] = React.useState(false)
587589
// Mirror isFocusedPanel into a ref so the ResizeObserver closure reads the latest value
588590
const isFocusedPanelRef = React.useRef(isFocusedPanel)
589591
isFocusedPanelRef.current = isFocusedPanel
@@ -1175,6 +1177,9 @@ export const ChatDisplay = React.forwardRef<ChatDisplayHandle, ChatDisplayProps>
11751177
const distanceFromBottom = scrollHeight - scrollTop - clientHeight
11761178
// 20px threshold for "at bottom" detection
11771179
isStickToBottomRef.current = distanceFromBottom < 20
1180+
// Reveal the jump-to-latest button once the user is well away from the bottom
1181+
// (200px hysteresis so it doesn't flicker while reading near the end).
1182+
setShowScrollToBottom(distanceFromBottom > 200)
11781183

11791184
// Load more turns when scrolling near top (within 100px)
11801185
if (scrollTop < 100) {
@@ -1205,6 +1210,13 @@ export const ChatDisplay = React.forwardRef<ChatDisplayHandle, ChatDisplayProps>
12051210
return () => viewport.removeEventListener('scroll', handleScroll)
12061211
}, [handleScroll])
12071212

1213+
// Jump back to the latest message and resume sticky-bottom auto-scroll.
1214+
const scrollToBottom = React.useCallback(() => {
1215+
isStickToBottomRef.current = true
1216+
setShowScrollToBottom(false)
1217+
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' })
1218+
}, [])
1219+
12081220
// Auto-scroll using ResizeObserver for streaming content
12091221
// Initial scroll is handled by ScrollOnMount (useLayoutEffect, before paint)
12101222
React.useEffect(() => {
@@ -1218,6 +1230,7 @@ export const ChatDisplay = React.forwardRef<ChatDisplayHandle, ChatDisplayProps>
12181230
if (isSessionSwitch) {
12191231
isStickToBottomRef.current = true
12201232
setVisibleTurnCount(TURNS_PER_PAGE)
1233+
setShowScrollToBottom(false)
12211234
}
12221235

12231236
// Debounced scroll for streaming - waits for layout to settle
@@ -1698,7 +1711,7 @@ export const ChatDisplay = React.forwardRef<ChatDisplayHandle, ChatDisplayProps>
16981711
WebkitMaskImage: 'linear-gradient(to bottom, transparent 0%, black 32px, black calc(100% - 32px), transparent 100%)'
16991712
}}
17001713
>
1701-
<ScrollArea className="h-full min-w-0" viewportRef={scrollViewportRef}>
1714+
<ScrollArea className="h-full min-w-0" viewportRef={scrollViewportRef} data-testid="chat-transcript">
17021715
<div className={cn(
17031716
CHAT_LAYOUT.maxWidth,
17041717
"mx-auto min-w-0",
@@ -2073,6 +2086,32 @@ export const ChatDisplay = React.forwardRef<ChatDisplayHandle, ChatDisplayProps>
20732086
</div>
20742087
</ScrollArea>
20752088
</div>
2089+
2090+
{/* Jump-to-latest: floating button shown when scrolled up from the bottom */}
2091+
<AnimatePresence>
2092+
{showScrollToBottom && (
2093+
<motion.button
2094+
type="button"
2095+
onClick={scrollToBottom}
2096+
aria-label={t('chat.scrollToBottom')}
2097+
title={t('chat.scrollToBottom')}
2098+
data-testid="scroll-to-bottom"
2099+
initial={{ opacity: 0, y: 8 }}
2100+
animate={{ opacity: 1, y: 0 }}
2101+
exit={{ opacity: 0, y: 8 }}
2102+
transition={{ duration: 0.12, ease: 'easeOut' }}
2103+
className={cn(
2104+
"absolute bottom-4 left-1/2 -translate-x-1/2 z-10",
2105+
"flex items-center justify-center h-9 w-9 rounded-full",
2106+
"bg-background/90 backdrop-blur border border-border shadow-md",
2107+
"text-muted-foreground hover:text-foreground hover:bg-accent",
2108+
"transition-colors"
2109+
)}
2110+
>
2111+
<ChevronDown className="h-5 w-5" />
2112+
</motion.button>
2113+
)}
2114+
</AnimatePresence>
20762115
</div>
20772116

20782117
{/* === INPUT CONTAINER: FreeForm or Structured Input === */}

docs/loop/feature-ledger.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ log, not the system of record.
1212

1313
| status | meaning |
1414
| --- | --- |
15+
| reduce-motion | "Reduce motion" accessibility setting in Appearance | Claude desktop / macOS / Windows reduce-motion + `prefers-reduced-motion` | frontend-only | pr-open | [#50](https://github.com/modelstudioai/openwork/issues/50) | [#51](https://github.com/modelstudioai/openwork/pull/51) | loop/reduce-motion | 2026-07-03 | Renderer-only pref (localStorage) applied app-wide via `<MotionConfig reducedMotion>` + `data-reduce-motion` on `<html>` + global CSS guard. Off ⇒ `reducedMotion="user"` (still honors OS). New `ReduceMotionProvider` in `main.tsx`; toggle in Appearance→Interface; 2 new i18n keys ×7 locales. typecheck/`bun test` zero-delta vs main (56-failure set byte-identical); renderer build ✅; i18n parity ✅. CDP assertion included; **could not run locally** (egress 403s Electron binary download). |
1516
| `proposed` | Identified as a gap, not started. |
1617
| `in-progress` | Issue filed, branch open, implementation underway. |
1718
| `pr-open` | PR submitted, awaiting human review/merge. |
@@ -33,17 +34,8 @@ log, not the system of record.
3334
| slug | title | source | feasibility | status | issue | pr | branch | updated | notes |
3435
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
3536
| interface-zoom | Interface zoom (⌘+/⌘-/⌘0) to scale the whole app | Claude Desktop / VS Code / Codex desktop View→Zoom In/Out/Actual Size | frontend-only | pr-open | [#68](https://github.com/modelstudioai/openwork/issues/68) | [#69](https://github.com/modelstudioai/openwork/pull/69) | loop/interface-zoom | 2026-07-08 | New `ZoomProvider` (mirrors `ReduceMotionProvider`) scales whole renderer via `document.documentElement.style.zoom`, discrete 50–200% steps, persisted in localStorage (`craft-zoom-level`). 3 View actions `view.zoomIn/Out/Reset` (`mod+=`/`mod+-`/`mod+0`) → auto in Command Palette + Shortcuts ref, wired via `ZoomHotkeys` bridge. Stepper in Appearance→Interface. 5 i18n keys ×7 locales. typecheck/`bun test` zero-delta vs main (56-failure set byte-identical); renderer build ✅; lint 0 errors; i18n parity ✅ (1549 keys). CDP assertion included; **could not run locally** (org egress 403 on Electron binary download — same block as #51). Distinct from chat-text-size (#64)/conversation-width (#62): scales entire UI, not just chat text. |
36-
| increase-contrast | "Increase contrast" accessibility setting in Appearance | Claude / macOS / Windows increase-contrast | frontend-only | pr-open | [#66](https://github.com/modelstudioai/openwork/issues/66) | [#67](https://github.com/modelstudioai/openwork/pull/67) || 2026-07-08 | Opened by a prior run (not this ledger's author); reconciled from GitHub. Awaiting review. |
37-
| chat-text-size | "Chat text size" (Small/Default/Large) in Appearance | Claude / ChatGPT desktop message text size | frontend-only | pr-open | [#64](https://github.com/modelstudioai/openwork/issues/64) | [#65](https://github.com/modelstudioai/openwork/pull/65) || 2026-07-08 | Prior run; reconciled from GitHub. Awaiting review. |
38-
| conversation-width | "Conversation width" (Comfortable/Wide/Full) in Appearance | Claude / ChatGPT desktop content width | frontend-only | pr-open | [#62](https://github.com/modelstudioai/openwork/issues/62) | [#63](https://github.com/modelstudioai/openwork/pull/63) || 2026-07-08 | Prior run; reconciled from GitHub. Awaiting review. |
39-
| composer-word-count | Live word / character count indicator in the composer | Codex / ChatGPT desktop composer counter | frontend-only | pr-open | [#60](https://github.com/modelstudioai/openwork/issues/60) | [#61](https://github.com/modelstudioai/openwork/pull/61) || 2026-07-08 | Prior run; reconciled from GitHub. Awaiting review. |
40-
| shortcuts-search | Search box on Settings → Keyboard Shortcuts page | Claude / VS Code shortcuts search | frontend-only | pr-open | [#58](https://github.com/modelstudioai/openwork/issues/58) | [#59](https://github.com/modelstudioai/openwork/pull/59) || 2026-07-08 | Prior run; reconciled from GitHub. Awaiting review. |
41-
| palette-recent | Surface recently-used commands in Command Palette (⌘K) | VS Code / Linear recent commands | frontend-only | pr-open | [#56](https://github.com/modelstudioai/openwork/issues/56) | [#57](https://github.com/modelstudioai/openwork/pull/57) || 2026-07-08 | Prior run; reconciled from GitHub. Awaiting review. |
42-
| thinking-menu-shortcut | Keyboard shortcut (⌘⇧E) to open composer thinking menu | Claude Code Desktop ⌘⇧E | frontend-only | pr-open | [#54](https://github.com/modelstudioai/openwork/issues/54) | [#55](https://github.com/modelstudioai/openwork/pull/55) | loop/thinking-menu-shortcut | 2026-07-08 | Prior run; reconciled from GitHub. Awaiting review. |
43-
| recall-prompts | Recall previously-sent prompts with Up/Down in composer | Claude Code / ChatGPT / shell history recall | frontend-only | pr-open | [#52](https://github.com/modelstudioai/openwork/issues/52) | [#53](https://github.com/modelstudioai/openwork/pull/53) || 2026-07-08 | Prior run; reconciled from GitHub. Awaiting review. |
44-
| reduce-motion | "Reduce motion" accessibility setting in Appearance | Claude desktop / macOS / Windows reduce-motion + `prefers-reduced-motion` | frontend-only | merged | [#50](https://github.com/modelstudioai/openwork/issues/50) | [#51](https://github.com/modelstudioai/openwork/pull/51) | loop/reduce-motion | 2026-07-08 | **Merged** into `main` (2026-07-06). Renderer-only pref (localStorage) applied app-wide via `<MotionConfig reducedMotion>` + `data-reduce-motion` on `<html>` + global CSS guard. Off ⇒ `reducedMotion="user"` (still honors OS). New `ReduceMotionProvider` in `main.tsx`; toggle in Appearance→Interface; 2 new i18n keys ×7 locales. |
37+
| scroll-to-bottom | "Jump to latest" (scroll-to-bottom) button in the chat transcript | Claude Code Desktop / ChatGPT / Codex desktop jump-to-latest affordance | frontend-only | pr-open | [#46](https://github.com/modelstudioai/openwork/issues/46) | [#47](https://github.com/modelstudioai/openwork/pull/47) | loop/scroll-to-bottom | 2026-07-02 | Reuses existing `ChatDisplay` scroll state (`distanceFromBottom`, `isStickToBottomRef`, `messagesEndRef`); floating `AnimatePresence` button shown when >200px from bottom. One new i18n key `chat.scrollToBottom` across all 6 locales. Added a reusable `seed(profileDirs)` hook to the e2e harness (`app.ts`/`runner.ts`) so assertions can pre-seed an on-disk session (backend-independent) — the scroll assertion seeds a 40-message session, opens it, scrolls up, asserts the button appears, clicks it, asserts return-to-bottom + hide. typecheck/`bun test` zero-delta vs main (11 pre-existing tsc errors, 56 pre-existing test fails, identical sets); renderer build ✅. **CDP could not run locally**: the Electron binary download is 403'd by the sandbox egress policy (github release host), so the app can't launch here — assertion transpiles and is included for CI/reviewer. |
38+
| thinking-level-picker | Thinking-level (reasoning effort) picker in the chat composer | Claude Code Desktop effort menu (⌘⇧E) + OpenWork's own model picker | frontend-only | merged | [#44](https://github.com/modelstudioai/openwork/issues/44) | [#45](https://github.com/modelstudioai/openwork/pull/45) | loop/thinking-level-picker | 2026-07-02 | Merged into `main`. `thinkingLevel`/`onThinkingLevelChange` already plumbed to `FreeFormInput`; only the UI trigger was missing. Reuses `thinking.*` + `settings.ai.thinking` i18n keys (zero new keys). typecheck/`bun test` zero-delta vs main. |
4539
| composer-expand | Expand / collapse (maximize) toggle for the chat composer | Claude/ChatGPT/Codex desktop composer maximize | frontend-only | pr-open | [#48](https://github.com/modelstudioai/openwork/issues/48) | [#49](https://github.com/modelstudioai/openwork/pull/49) | loop/composer-expand | 2026-07-03 | Opened by a prior run. Adds `isComposerExpanded` toggle in `FreeFormInput`; 2 new i18n keys. Awaiting review. |
46-
| scroll-to-bottom | "Jump to latest" (scroll-to-bottom) button in the chat transcript | Claude Code / ChatGPT / Codex desktop | frontend-only | pr-open | [#46](https://github.com/modelstudioai/openwork/issues/46) | [#47](https://github.com/modelstudioai/openwork/pull/47) | loop/scroll-to-bottom | 2026-07-02 | Opened by a prior run. Floating jump button in `ChatDisplay` + `seed()` harness hook. Awaiting review. |
47-
| thinking-level-picker | Thinking-level (reasoning effort) picker in the chat composer | Claude Code Desktop effort menu (⌘⇧E) + OpenWork's own model picker | frontend-only | merged | [#44](https://github.com/modelstudioai/openwork/issues/44) | [#45](https://github.com/modelstudioai/openwork/pull/45) | loop/thinking-level-picker | 2026-07-03 | **Merged** into `main` (2026-07-02). `thinkingLevel`/`onThinkingLevelChange` already plumbed to `FreeFormInput`; only the UI trigger was missing. Reuses `thinking.*` + `settings.ai.thinking` i18n keys (zero new keys). |
4840
| command-palette | Global command palette (⌘K/Ctrl+K) to search & run any action | Claude Code Desktop ⌘K / VS Code & Codex ⌘⇧P / Linear ⌘K | frontend-only | merged | [#41](https://github.com/modelstudioai/openwork/issues/41) | [#42](https://github.com/modelstudioai/openwork/pull/42) | loop/command-palette | 2026-07-02 | Merged into `main`. Reuses action registry `execute()` + cmdk primitives; zero new i18n keys. CDP e2e 2/2 pass. typecheck/test +0 vs main. |
4941
| settings-search | Searchable/filterable settings navigation | Claude Code Desktop / VS Code / Codex desktop settings search | frontend-only | merged | [#39](https://github.com/modelstudioai/openwork/issues/39) | [#40](https://github.com/modelstudioai/openwork/pull/40) | loop/settings-search | 2026-07-01 | Merged into `main`. Filters `SettingsNavigator` by title+description; reuses `common.search`/`common.noResultsFound` (no new locale keys). Also hardened `e2e/app.ts` teardown (per-launch profile dir + setsid process-group kill) so multiple CDP assertions run under headless xvfb. |

0 commit comments

Comments
 (0)