Skip to content

Restore the sidebar-resize-handle - #9

Merged
gaord merged 4 commits into
HengQuWorld:mainfrom
eoli:restore-sidebar
Sep 17, 2026
Merged

gaord merged 4 commits into
HengQuWorld:mainfrom
eoli:restore-sidebar

Conversation

@eoli

@eoli eoli commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

I've added the sidebar-resize-handle back.

I also fixed a related bug: previously, the handle would still show up at the far left even when the session panel wasn't open, which got in the way when users tried to resize the chat area.

image

- Delete #sidebar-resize-handle CSS, DOM node, drag script, and the
  related test assertions
- Harden the input resize drag: rAF throttling, window listeners, and
  cleanup on mouseleave/blur via body.is-resizing
- Skip tooltip repositioning while a resize drag is in progress
- Sync package-lock.json to version 0.6.0
The config panel was reachable through a gear button rendered inside the
chat webview. Move it into the editor chrome instead: the sidebar view
title bar now shows a small gear icon, and the webview no longer renders
any settings button.

- Contribute `brotherwhale.openConfig` with `"icon": "$(gear)"` and expose
  it through `menus["view/title"]` in the `navigation` group, scoped to
  `view == brotherwhale.chat`, so the action sits at the top of the
  CodeWhale sidebar panel
- Register the command in `extension.ts` to open `ConfigPanel`, keeping
  the command id in sync with the manifest
- Drop the redundant `brotherwhale.settings` tree view, its
  `SettingsViewProvider`, and the now-unused `views.settings.name` and
  `openConfigPanel` keys, so the gear becomes the single entry point
- Remove the `#btn-config` button from the webview along with its CSS
  block and its click handler
- Add `package-contributions.test.ts` to guard the gear contribution
  (command icon, menu placement, single view) and to keep `#btn-config`
  from creeping back into the webview sources

The `/config` slash command keeps opening the same panel.
The composer was a plain row of attach button, textarea, and Send/Stop
text buttons. Redesign it as a bordered input box whose bottom edge is a
toolbar: the attachment button starts from the left, a compact icon-only
send/stop button is pinned to the far right, and the textarea fills the
box above the toolbar.

- Wrap the textarea and an #input-toolbar in a bordered #input-box with
  a :focus-within highlight; the toolbar hosts #btn-attach on the left
  and #btn-send-stop on the right via margin-left: auto
- Replace the Send/Stop text labels with inline SVG icons (paper plane /
  square) since the webview does not load the codicon font; titles and
  aria-labels switch with the streaming state
- Keep the composer height under explicit user control: the textarea has
  a hard-coded 52px floor (about two rows above the 34px toolbar) and
  the resize handle drags the textarea itself between 52 and 340px,
  persisted as codewhale:inputHeight; overflowing text scrolls inside
  the box with the scrollbar hidden instead of resizing the composer
- Remove the previous auto-grow logic and its height resets on send and
  history recall, which made the frame jump while typing
- Size #input-box with flex: 1 0 auto so the frame always encloses the
  textarea plus the toolbar; the earlier flex: 1 + min-height: 0
  collapsed the border to zero and let text and the toolbar spill
  outside it
- Fix the stop state that never turned red in practice: the .streaming
  rule was outranked by the generic button background selector
- Extend the webview tests, including runtime tests that execute the
  input script against a real DOM to cover height behavior, send/stop
  icon toggling, and toolbar placement
- Restore #sidebar-resize-handle DOM node, CSS, and drag script so the
  threads panel can be resized inside the webview again
- Harden the sidebar drag like the input handle: window-level listeners,
  mouseleave/blur cleanup, rAF-throttled width writes, is-resizing guard
- Persist the sidebar width across sessions via codewhale:sidebarWidth
- Hide the handle while #threads-panel is collapsed so a closed sidebar
  never shows a dead grip
- Fix input handle cleanup so it removes the window listeners it registers
- Restore and extend test coverage: handle selectors, hardened drag
  pattern, script count, and collapsed-panel hiding
@eoli eoli changed the title Restore sidebar Restore the sidebar-resize-handle Sep 16, 2026
@gaord

gaord commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Verified — this looks great. Confirmed locally on a merge with current main:

  • The restored handle uses the exact hardened pattern (window-level listeners, mouseleave/blur cleanup, rAF-throttled width writes, is-resizing class), and codewhale:sidebarWidth persistence is intact.
  • The panel-closed visibility fix via #threads-panel.open + #sidebar-resize-handle is a nice catch — that grip blocking the chat area with the panel collapsed was indeed a bug.
  • Merged cleanly into current main (no conflicts), 936/936 tests pass, webpack build succeeds.

Thanks for the quick turnaround and for sticking with it through the back-and-forth. Merging now.

@gaord
gaord merged commit c0ee1f1 into HengQuWorld:main Sep 17, 2026
gaord added a commit that referenced this pull request Sep 17, 2026
TUI no longer emits coherence.state / cycle.advanced events or exposes
coherence_state on thread records, so remove the now-dead chain end to
end:

- types: drop coherence_state from ThreadRecord
- session-state: drop cycleCount / coherenceState / coherenceLabel
- chat-provider: drop cycle.advanced and coherence.state event cases
- webview: drop coherence banner and cycle count rendering, CSS, and
  reset paths (Work panel empty state now keyed on checklist + strategy)
- i18n: drop coherence* / cycles keys across en / zh-CN / tr
- tests: remove fabricated state-machine tests, keep regression
  coverage for sidebar clearing and workState payload structure

Merged upstream PR #9 (sidebar resize handle, input toolbar, settings
gear) before landing; verified together.

Verified: webpack compile, tsc --noEmit, 924/924 vitest tests pass.
@eoli
eoli deleted the restore-sidebar branch September 17, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants