Skip to content

Fix cursor visibility issue in code blocks on iOS/iPadOS#317

Open
jparkerweb wants to merge 5 commits into
mainfrom
issue-285
Open

Fix cursor visibility issue in code blocks on iOS/iPadOS#317
jparkerweb wants to merge 5 commits into
mainfrom
issue-285

Conversation

@jparkerweb
Copy link
Copy Markdown
Owner

- Added z-index rules for CodeMirror cursor elements
- Removed isolation:isolate on iOS devices to prevent rendering issues
- Added hardware acceleration for better performance
- Fixes #285: cursor disappearing in code blocks when banner is present

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical rendering issue on iOS/iPadOS where the CodeMirror cursor would become invisible within code blocks, particularly when a banner element was active. The changes involve strategic adjustments to CSS properties, including z-index for proper layering, removal of conflicting isolation properties, and the application of hardware acceleration to ensure the cursor renders correctly and performs smoothly across Apple mobile devices.

Highlights

  • Cursor Visibility: Implemented specific z-index rules for CodeMirror cursor elements to ensure visibility within code blocks when a banner is present.
  • iOS Rendering Fix: Removed the isolation:isolate property on iOS devices to resolve rendering conflicts that caused the cursor to disappear.
  • Performance Improvement: Introduced hardware acceleration techniques for improved rendering performance on iOS/iPadOS, particularly for CodeMirror elements.
  • Bug Fix: Resolved issue 🐛 Cursor is invisible on iPadOS 26 DB3 with only this plugin and dataview #285, which reported the cursor disappearing in code blocks when a banner was active on iOS/iPadOS.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • styles.css
    • Added new CSS rules to explicitly set z-index for CodeMirror cursor and line elements within banner-affected views.
    • Established a proper stacking context for HyperMD code blocks by setting position: relative and z-index.
    • Applied transform: translateZ(0) to the CodeMirror editor for hardware acceleration.
    • Introduced an @supports block specifically for iOS Safari to apply device-specific fixes.
    • Within the iOS-specific block, changed isolation to auto for the banner view to prevent rendering issues.
    • Applied transform: translate3d(0, 0, 0) to CodeMirror content for further hardware acceleration on iOS.
    • Increased the z-index and set position: relative for the CodeMirror cursor layer within the iOS-specific context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to fix a cursor visibility issue on iOS/iPadOS within code blocks when a banner is present. The changes involve adding several CSS rules to manage stacking contexts (z-index), force hardware acceleration for better rendering, and override the isolation property specifically for iOS. While the approach is generally sound and targets the right areas, I've found a couple of opportunities for improvement. One of the new rules could lead to performance and positioning issues due to its broad application. Another rule's comment is inconsistent with its placement, potentially causing confusion. My review includes specific suggestions to refine these rules for better correctness, performance, and maintainability.

Comment thread styles.css Outdated
Comment thread styles.css Outdated
jparkerweb and others added 4 commits March 8, 2026 09:38
…-index:0

- Replace isolation:isolate with z-index:0 to avoid WebKit compositing bug (Bug 94985)
- Add caret-color workaround scoped to .is-ios for Safari caret rendering
- Remove broad z-index/position overrides on .cm-line that broke themes
- Remove unnecessary GPU layer promotion (translateZ) and iOS @supports block
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.

🐛 Cursor is invisible on iPadOS 26 DB3 with only this plugin and dataview

2 participants