feat: add cursor pointer setting#2088
Conversation
Greptile SummaryAdds a user-facing toggle in Interface Settings that controls whether clickable elements (buttons, links, ARIA-role widgets, form inputs) display a pointer cursor on hover. The feature is implemented end-to-end: a new
Confidence Score: 4/5Safe to merge; the change is purely cosmetic and opt-in, with no impact on existing behaviour. The implementation is clean and the provider correctly uses src/renderer/index.css — the selector list may need a few additional ARIA roles for full coverage; src/renderer/lib/providers/cursor-style-provider.tsx — contains dead defensive code.
|
| Filename | Overview |
|---|---|
| src/renderer/lib/providers/cursor-style-provider.tsx | New provider that toggles a CSS class on document.documentElement based on the setting; correct use of useLayoutEffect to avoid flash, but contains a dead typeof document === 'undefined' guard. |
| src/renderer/index.css | Adds comprehensive cursor-pointer CSS rules; covers buttons, ARIA roles, links, and form inputs, but is missing a few roles (combobox, treeitem, gridcell) commonly found in Radix-based UIs. |
| src/main/core/settings/schema.ts | Adds cursorPointer: z.boolean() to interfaceSettingsSchema; straightforward and correct. |
| src/main/core/settings/settings-registry.ts | Adds cursorPointer: false default; matches schema addition correctly. |
| src/renderer/App.tsx | Wraps ThemeProvider children with CursorStyleProvider; placement is appropriate and non-intrusive. |
| src/renderer/features/settings/components/CursorPointerSettingsCard.tsx | New settings UI card; correctly reads and updates cursorPointer via useAppSettingsKey. |
| src/renderer/features/settings/components/SettingsPage.tsx | Inserts the new CursorPointerSettingsCard into the interface settings section; no issues. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App mounts] --> B[CursorStyleProvider reads interface settings]
B --> C{isLoading?}
C -- Yes --> D[Do nothing, wait]
C -- No --> E{cursorPointer enabled?}
E -- Yes --> F[Add cursor-pointer-enabled to html element]
E -- No --> G[Remove cursor-pointer-enabled from html element]
F --> H[CSS applies pointer cursor to buttons, links, ARIA roles]
G --> I[Default cursor behaviour restored]
J[User toggles setting in SettingsPage] --> K[useAppSettingsKey updates setting]
K --> B
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
src/renderer/lib/providers/cursor-style-provider.tsx:11
**Dead guard in Electron renderer**
`typeof document === 'undefined'` is always `false` in an Electron renderer process — `document` is always defined there. The guard silently skips the class toggle if someone somehow reaches this code path in an environment without a DOM, but that situation cannot arise in this app's runtime. The dead branch adds noise without providing actual protection; if defensive guards are desired for unit tests, a mock DOM (jsdom) is the conventional approach.
### Issue 2 of 2
src/renderer/index.css:581-602
**Missing interactive ARIA roles in cursor selector list**
`[role='combobox']` (used on custom select triggers), `[role='treeitem']` (used in sidebar file trees), and `[role='gridcell']` are not covered. Any component using those roles will keep the default cursor even when the setting is enabled, producing an inconsistent experience. If these roles exist in the app (which is common with Radix-based UI kits), users will notice the gap immediately after enabling the setting.
Reviews (1): Last reviewed commit: "Add cursor pointer setting" | Re-trigger Greptile
|
finally! |
very controversial
Screen.Recording.2026-05-18.at.14.42.58.mov