Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

Buttons that navigate to other pages were implemented with onclick handlers calling window.location.href, preventing users from right-clicking to "Open in new tab".

Changes

Converted to <a> tags:

  • Project management interface buttons (Manage, Leave Project, Edit Metadata, Manage Collaborators)
  • Copy/import project "Manage" buttons across all variants
  • Quick guide "Get Started" button
  • Collaborator profile images
  • Line parser "Create Column" button
  • Import TPEN28 "Open the Project" button

Before:

manageButton.addEventListener('click', () => {
  window.location.href = `/project/manage?projectID=${projectID}`
})

After:

const manageButton = document.createElement('a')
manageButton.href = `/project/manage?projectID=${projectID}`
manageButton.className = 'default-btn'

Not Changed

Programmatic navigation patterns remain unchanged:

  • Auth redirects (login/logout flows)
  • Post-action redirects (after declining/leaving project)
  • URL parameter auto-initialization
  • OpenSeadragon library buttons with conditional logic
Original prompt

This section details on the original issue you should resolve

<issue_title>Buttons and Links that Link</issue_title>
<issue_description>Buttons and links that go to new pages, especially those that do not open in a new tab by default, should be able to be right clicked to see the option to 'open in a new tab'. At present, this is not regularized. Here are some examples, which is not an exhaustive list.

Image Image Image

<agent_instructions>Scan the components and interfaces for buttons and clickable elements that direct to external links or other pages. If they use an onclick or eventHandler to navigate, the user does not get the chance to open it in a new tab. This issue is requesting that they be replaced with equivalent anchor tags to allow the context menu "open in new tab". Please include a summary of changes and button-like elements evaluated but for which no accommodation was made. You can tag @thehabes when you decide not to fix one.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 16, 2025 22:51
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to open buttons and links in new tab Convert navigation buttons to anchor tags for right-click context menu support Dec 16, 2025
Copilot AI requested a review from cubap December 16, 2025 23:01
@cubap cubap marked this pull request as ready for review December 16, 2025 23:02
@cubap cubap requested a review from Copilot December 16, 2025 23:03
@cubap
Copy link
Member

cubap commented Dec 16, 2025

@thehabes This may have hit more buttons than you wanted. Do you want to flag a few as not needed for copilot to back out of? I can decide if you want, but since this was your use case, I don't want to allow something just because it feels fine to me.

Copy link
Contributor

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 PR converts navigation buttons to anchor tags to enable right-click context menu support (e.g., "Open in new tab"). Previously, buttons used onclick handlers with window.location.href assignments, which prevented browser context menu functionality. The conversion maintains the visual appearance while improving user experience through native browser navigation features.

Key Changes:

  • Replaced button elements with semantically equivalent anchor tags across multiple interfaces
  • Updated event listeners to set href attributes instead of calling navigation functions
  • Maintained existing CSS classes to preserve visual styling

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
manage/index.js Updated modify team button to set href instead of using click event listener
manage/collaboration.html Converted "Modify Project Team" button to anchor tag
interfaces/project/quick-guide.html Converted "Get Started" button to anchor tag
interfaces/project/index.html Converted "Leave Project" button to anchor tag with href assignment
interfaces/manage-project/index.js Refactored all navigation buttons to set href on project load instead of click listeners
interfaces/manage-project/index.html Converted all card footer buttons (Leave, Edit Metadata, Manage Collaborators, etc.) to anchor tags
interfaces/import-tpen28/index.js Updated "Open the Project" button to set href instead of click listener
interfaces/import-tpen28/index.html Converted "Open the Project" button to anchor tag
components/user-profile/userStats.js Wrapped collaborator images in anchor tags instead of using onclick
components/import-project/index.js Converted "Manage" button to anchor tag with inline styling override
components/import-image/index.js Converted "Manage" button to anchor tag
components/copy-project-without-annotations/index.js Converted "Manage" button to anchor tag
components/copy-project-with-group-member/index.js Converted "Manage" button to anchor tag
components/copy-project-with-customization/index.js Converted "Manage" button to anchor tag
components/copy-existing-project/index.js Converted "Manage" button to anchor tag
components/annotorious-annotator/line-parser.js Converted "Manage Columns" button to anchor tag with inline styling

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

@github-actions
Copy link
Contributor

@cubap cubap merged commit 5184e23 into main Dec 17, 2025
2 checks passed
@cubap cubap deleted the copilot/add-open-in-new-tab-option branch December 17, 2025 19:29
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.

Buttons and Links that Link

2 participants