Skip to content

fix(webview): fix resize drag failure and remove unused sidebar handle - #5

Closed
eoli wants to merge 2 commits into
HengQuWorld:mainfrom
eoli:main
Closed

eoli wants to merge 2 commits into
HengQuWorld:mainfrom
eoli:main

Conversation

@eoli

@eoli eoli commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Fix a bug where the sidebar resize drag could become unresponsive or fail to work.
Harden the resize drag with rAF throttling, window-level listeners, and cleanup on mouseleave/blur via body.is-resizing.
Skip tooltip repositioning while a resize drag is in progress to prevent interaction conflicts.
Remove the unused #sidebar-resize-handle CSS, DOM node, drag script, and related test assertions.
Sync package-lock.json to version 0.6.0.

- 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
@eoli eoli changed the title fix(webview): remove unused sidebar resize handle fix(webview): fix resize drag failure and remove unused sidebar handle Sep 16, 2026
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.
@gaord

gaord commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for the fix! The input resize hardening (rAF throttling, window-level listeners, blur/mouseleave cleanup) and moving the config entry to the native view-title gear are both great improvements — verified locally: 914/914 tests pass and it compiles cleanly.

However, one part needs to be revised: please don't remove the sidebar resize handle.

The sidebar drag-to-resize is a working, actively used feature — users like it and rely on it to widen the threads panel. Removing it locks the panel to a fixed 220px, which is a UX regression rather than a cleanup. It's not "unused"; it just shares the same stuck-drag bug class as the input handle (listeners bound to document, no cleanup on mouseleave/blur).

Requested change: restore #sidebar-resize-handle (DOM node, CSS, drag script, and the corresponding test assertions), and instead of deleting it, apply the same hardening you used for the input resize handle:

  • bind mousemove/mouseup to window
  • add mouseleave/blur cleanup so the drag can't get stuck
  • rAF-throttle the width writes
  • keep the codewhale:sidebarWidth localStorage persistence

That way both resize handles get the real fix and the feature is preserved. The rest of the PR (config gear migration, lockfile sync, tooltip skip during resize) can stay as is — happy to merge once the sidebar handle is back.

@eoli

eoli commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the fix! The input resize hardening (rAF throttling, window-level listeners, blur/mouseleave cleanup) and moving the config entry to the native view-title gear are both great improvements — verified locally: 914/914 tests pass and it compiles cleanly.

However, one part needs to be revised: please don't remove the sidebar resize handle.

The sidebar drag-to-resize is a working, actively used feature — users like it and rely on it to widen the threads panel. Removing it locks the panel to a fixed 220px, which is a UX regression rather than a cleanup. It's not "unused"; it just shares the same stuck-drag bug class as the input handle (listeners bound to document, no cleanup on mouseleave/blur).

Requested change: restore #sidebar-resize-handle (DOM node, CSS, drag script, and the corresponding test assertions), and instead of deleting it, apply the same hardening you used for the input resize handle:

  • bind mousemove/mouseup to window
  • add mouseleave/blur cleanup so the drag can't get stuck
  • rAF-throttle the width writes
  • keep the codewhale:sidebarWidth localStorage persistence

That way both resize handles get the real fix and the feature is preserved. The rest of the PR (config gear migration, lockfile sync, tooltip skip during resize) can stay as is — happy to merge once the sidebar handle is back.

Thanks for the clarification. One important point here is that the sidebar resizing is already provided natively by VS Code. In the updated version, the sidebar width can be adjusted using VS Code's built-in behavior, so we don't need to implement our own #sidebar-resize-handle.

The current custom resize implementation actually interferes with VS Code's native dragging behavior, which is why I removed it. Keeping the custom handle would introduce competing drag handling rather than fixing the underlying issue.

So my intention was to rely on VS Code's native sidebar resizing instead of maintaining a separate custom resize implementation.

@eoli

eoli commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author
Kapture 2026-09-16 at 17 30 51

@eoli

eoli commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

I’ve consolidated all the changes into a single PR here:

[PR #8 — Improve the CodeWhale VS Code sidebar and input experience](https://github.com/HengQuWorld/CodeWhale-VSCode/pull/8?utm_source=chatgpt.com)

The PR now contains the complete set of changes, including the input box redesign and resize hardening, the native VS Code sidebar title-bar config entry, and removal of the custom sidebar resize handle that interfered with VS Code’s native resizing behavior.

I’ve also updated the tests accordingly. Please take a look when you have a chance.

@gaord

gaord commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Thanks — continuing the sidebar-handle discussion on #8.

@eoli eoli closed this Sep 16, 2026
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