Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 7, 2025

Description

This PR fixes an issue where the @ mention context menu (dropdown) was being obscured by other UI elements when editing information.

Problem

When users type '@' to mention files or context, the dropdown menu that appears could be hidden behind other UI elements due to insufficient z-index values.

Solution

  • Increased z-index from 1000 to 10001 in both ChatTextArea.tsx and ContextMenu.tsx
  • This ensures the context menu appears above other UI elements that may have z-index values up to 10000

Changes

  • Updated z-index in ChatTextArea.tsx (line 957)
  • Updated z-index in ContextMenu.tsx (line 271)

Testing

  • All existing tests pass (999 passed, 1 skipped)
  • Linting and type checks pass
  • Manual testing confirms the context menu now appears above other UI elements

Related Issue

Fixes #7759

Future Considerations

The codebase has inconsistent z-index usage across components. A future refactor could establish a consistent z-index scale to prevent similar issues.

Screenshots

The issue reporter provided a screenshot showing the problem in issue #7759. This fix ensures the dropdown menu is no longer obscured.

Checklist

  • Code follows project style guidelines
  • Tests pass
  • Linting passes
  • Type checks pass
  • Related issue is referenced

Important

Increase z-index in ChatTextArea.tsx and ContextMenu.tsx to ensure context menu is not obscured by other UI elements.

  • Behavior:
    • Increased z-index from 1000 to 10001 in ChatTextArea.tsx and ContextMenu.tsx to ensure context menu appears above other UI elements.
  • Testing:
    • All existing tests pass (999 passed, 1 skipped).
    • Linting and type checks pass.
    • Manual testing confirms the context menu now appears above other UI elements.

This description was created by Ellipsis for ffc63fb. You can customize this summary. It will automatically update as commits are pushed.

- Changed z-index from 1000 to 10001 in ChatTextArea.tsx
- Changed z-index from 1000 to 10001 in ContextMenu.tsx
- This ensures the @ mention dropdown appears above other UI elements
- Fixes #7759
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 7, 2025 15:55
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. UI/UX UI/UX related or focused labels Sep 7, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.

"left-0",
"right-0",
"z-[1000]",
"z-[10001]",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I notice we're using Tailwind class here, but in ContextMenu.tsx we're using inline style . Should we consider using a consistent approach across both files? Tailwind classes would be preferable for maintainability.

borderRadius: "3px",
boxShadow: "0 4px 10px rgba(0, 0, 0, 0.25)",
zIndex: 1000,
zIndex: 10001,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The jump from z-index 1000 to 10001 seems quite large. Looking at the codebase, modals use , so this context menu at 10001 is 10x higher. Could we consider establishing a more structured z-index scale? For example:

  • Dropdowns: 1000-1999
  • Modals: 2000-2999
  • Tooltips/Context menus: 3000-3999

This would make the hierarchy clearer and prevent future conflicts.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 7, 2025
@daniel-lxs
Copy link
Member

daniel-lxs commented Sep 9, 2025

Closing this since bumping the z-index doesn’t solve the real problem. The ContextMenu is stuck inside nested stacking contexts (ChatRow → Virtuoso), so no z-index value will ever escape.

The fix is to render it through a portal, same as ModeSelector, ApiConfigSelector, and SlashCommandsPopover. That way it always sits on top regardless of where ChatTextArea is.

@daniel-lxs daniel-lxs closed this Sep 9, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 9, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 9, 2025
@daniel-lxs daniel-lxs deleted the fix/context-menu-z-index-issue-7759 branch September 9, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XS This PR changes 0-9 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

The editing information element is obscured (isEditMode = true)

4 participants