Skip to content

Conversation

@stescobedo92
Copy link

Add CSS to disable text selection for line numbers

Fixes #4856

Description

This pull request improves the user experience when copying code from the file viewer and diff views. Currently, selecting text often includes the line numbers, which interferes with copying code snippets.
I have added user-select: none (and its vendor-prefixed variants) to the CSS classes responsible for rendering line numbers (.l, .hl, del.d, etc.). This ensures that line numbers are skipped during text selection while ensuring links and other interactions remain functional.

Changes

  • Modified [opengrok-web/src/main/webapp/default/style-1.0.4.css] to apply selection disabling styles to line number classes.

Verification

  • Validated that the modified CSS classes (.l, .hl, del.d) are correctly used for line numbers in [diff.jsp] and other views.
  • Verified that user-select is the standard approach for this behavior and does not affect the ability to click on line number links (if applicable).

Copilot AI review requested due to automatic review settings January 21, 2026 04:23
@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jan 21, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances the user experience when copying code from OpenGrok's file viewer by preventing line numbers from being included in text selections. The change applies the user-select: none CSS property (with vendor prefixes for broader browser compatibility) to the CSS classes responsible for rendering line numbers across different views.

Changes:

  • Added user-select: none CSS property to line number elements in the stylesheet

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add user-select CSS for line numbers in file viewer

1 participant