Skip to content

feat: add cursor pointer setting#2088

Open
janburzinski wants to merge 2 commits into
mainfrom
emdash/cursor-pointer-setting-5admy
Open

feat: add cursor pointer setting#2088
janburzinski wants to merge 2 commits into
mainfrom
emdash/cursor-pointer-setting-5admy

Conversation

@janburzinski
Copy link
Copy Markdown
Collaborator

very controversial

Screen.Recording.2026-05-18.at.14.42.58.mov

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Greptile Summary

Adds 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 cursorPointer boolean is added to the settings schema and defaults to false, a CursorStyleProvider reads the setting and synchronously toggles the cursor-pointer-enabled CSS class on <html>, and the CSS layer applies cursor: pointer to a broad set of interactive selectors when that class is present.

  • Schema + defaults: cursorPointer: z.boolean() is added to interfaceSettingsSchema with a false default, keeping existing behaviour unchanged for existing users.
  • Provider: CursorStyleProvider wraps the app tree and uses useLayoutEffect to toggle the class without a visible flash; it short-circuits while settings are loading to avoid a spurious class removal.
  • CSS: Targets buttons, native inputs, ARIA role elements, anchors, and labels — though a few roles commonly present in Radix-based UIs (combobox, treeitem) are absent.

Confidence Score: 4/5

Safe 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 useLayoutEffect to avoid flicker. Two minor surface issues exist: a dead typeof document === 'undefined' guard that can never trigger in the Electron renderer, and a handful of ARIA roles (combobox, treeitem) missing from the CSS selector list that would produce an inconsistent cursor experience for users who enable the setting.

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.

Important Files Changed

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
Loading
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

Comment thread src/renderer/lib/providers/cursor-style-provider.tsx Outdated
Comment thread src/renderer/index.css
@mezotv
Copy link
Copy Markdown
Contributor

mezotv commented May 18, 2026

finally!

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