Repository navigation
fix(control-ui): make chat divider accessible - #74293
Conversation
Greptile SummaryThis PR upgrades Confidence Score: 4/5Safe to merge — all findings are P2 style/quality suggestions with no functional regressions. Only P2 findings: the test helper uses MouseEvent instead of PointerEvent (reducing coverage of touch/stylus-specific behavior), static ARIA attributes are re-set on every render, and setPointerCapture is absent. None of these block correctness of the feature in its primary use cases. ui/src/ui/components/resizable-divider.test.ts — the pointer dispatch helper should use PointerEvent to actually test the new pointer-event path. Prompt To Fix All With AIThis is a comment left during a code review.
Path: ui/src/ui/components/resizable-divider.test.ts
Line: 57-63
Comment:
**Test uses `MouseEvent` instead of `PointerEvent`**
`dispatchPointer` creates `new MouseEvent(type, ...)` for events named `"pointerdown"`, `"pointermove"`, and `"pointerup"`. The component switched from mouse to pointer events specifically to support touch and stylus, but the test never exercises actual `PointerEvent` instances. `PointerEvent`-specific fields like `pointerId`, `pointerType`, and `isPrimary` are never set, so the interaction with `setPointerCapture` (if added) and multi-touch guards won't be covered. Use `new PointerEvent(type, { bubbles: true, cancelable: true, clientX, button: 0, pointerId: 1 })` instead.
```suggestion
function dispatchPointer(target: EventTarget, type: string, clientX: number) {
target.dispatchEvent(
new PointerEvent(type, {
bubbles: true,
cancelable: true,
clientX,
button: 0,
pointerId: 1,
}),
);
}
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: ui/src/ui/components/resizable-divider.ts
Line: 81-96
Comment:
**Missing `setPointerCapture` for reliable drag tracking**
Without capturing the pointer, fast drags can leave the element's hit-area before `document` listeners fire, causing `pointermove` events to be silently dropped on some browsers when the pointer moves faster than the event loop. `setPointerCapture` routes all subsequent pointer events to this element regardless of position, which is the canonical solution — especially important for touch/stylus (the primary motivation for moving from mouse to pointer events).
```suggestion
private handlePointerDown = (e: PointerEvent) => {
if (e.button !== 0) {
return;
}
this.isDragging = true;
this.startX = e.clientX;
this.startRatio = this.splitRatio;
this.classList.add("dragging");
this.focus();
this.setPointerCapture(e.pointerId);
document.addEventListener("pointermove", this.handlePointerMove);
document.addEventListener("pointerup", this.handlePointerUp);
document.addEventListener("pointercancel", this.handlePointerUp);
e.preventDefault();
};
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: ui/src/ui/components/resizable-divider.ts
Line: 67-79
Comment:
**Static ARIA attributes set on every render**
`role`, `tabindex`, and `aria-orientation` are invariant — they never change after the element is constructed. Setting them in `updated()` re-applies them on every property change (e.g., every `splitRatio` update during drag). Only the value attributes (`aria-valuemin`, `aria-valuemax`, `aria-valuenow`, `aria-label`) need reactive updates. The static ones can be moved to `connectedCallback` to avoid the repeated DOM writes on hot paths.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(control-ui): make chat divider acces..." | Re-trigger Greptile |
|
Codex review: needs maintainer review before merge. What this changes: The PR updates the Control UI resizable divider with ARIA separator semantics, focusability, keyboard resize controls, pointer-event dragging, a localized chat label, component tests, a changelog entry, and an optional Knip unused-file allowlist path in the deadcode checker. Maintainer follow-up before merge: Keep this PR open for maintainer review. If accepted, land this branch or an equivalent divider-level accessibility fix that preserves the existing split-ratio resize contract, uses the existing localized Best possible solution: Keep this PR open for maintainer review. If accepted, land this branch or an equivalent divider-level accessibility fix that preserves the existing split-ratio resize contract, uses the existing localized What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4f540c703ff6. |
48ff245 to
3428ede
Compare
|
Follow-up after review cleanup:
|
f0afafb to
146ecd2
Compare
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
75f529f to
8ac3936
Compare
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
resizable-divideronly listened formousedown/ document mouse events and rendered no accessible host semantics.Regression Test Plan (if applicable)
ui/src/ui/components/resizable-divider.test.tsresizecontract.User-visible / Behavior Changes
The chat sidebar divider can now be focused, resized with keyboard controls, announced as a vertical separator, and dragged via pointer events.
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
Expected
Actual
Evidence
Added
ui/src/ui/components/resizable-divider.test.tsto cover the accessibility contract.Human Verification (required)
pnpm test ui/src/ui/components/resizable-divider.test.tspnpm exec oxfmt --check --threads=1 ui/src/ui/components/resizable-divider.ts ui/src/ui/components/resizable-divider.test.ts ui/src/ui/views/chat.tsgit diff --check -- CHANGELOG.md ui/src/ui/components/resizable-divider.ts ui/src/ui/components/resizable-divider.test.ts ui/src/ui/views/chat.tspnpm tsgo:test:uipnpm tsgo:coreOPENCLAW_TESTBOX=1 pnpm check:changedin Blacksmith Testboxtbx_01kqcespxywjcc0z7rx6k3242qReview Conversations
No review conversations existed at PR creation time; I will inspect live thread state after creation.
Compatibility / Migration
Risks and Mitigations