Skip to content

Show close button in place of file icon on hover for narrow code-pane tabs #10592

@wzc520pyfm

Description

@wzc520pyfm

Summary

When many files are open in the code pane, individual editor tabs become too narrow to interact with. Hovering a tab should reveal a close button (×) in place of the file icon, similar to Chrome's tab behavior, so users can still close a specific file even when the tab bar is crowded.

Problem

Opening many files in the code pane causes each editor tab to shrink. Currently the tab layout always shows the file-type icon and only reveals the close button when there is enough horizontal space. Once tabs become narrow, it becomes difficult or impossible to close a specific file from the tab because the close affordance is not visible or easily clickable.

Expected behavior

When hovering over a narrow code-pane tab, the file icon should be temporarily replaced by a close (×) button so the user can close that file without needing keyboard shortcuts or first activating the tab.

I believe that there should be different display methods for tabs occupying varying degrees of overall space:

  1. When there is sufficient space, a single file tab has ample room to display "X" normally. (Current behavior)
Image
  1. When the space becomes narrower and the tab space for a single file shrinks, the "X" should only be displayed for the currently opened file. For other file tabs, the "X" should not be displayed on hover. (About Don't show the X (close) button when hovering over the tab  #3870)
Image
  1. As the space continues to narrow, the "X" should be removed from the currently open text tab, and only displayed when hovering over it.(like chrome)
Image Image

Actual behavior

The file icon remains visible on hover, and the close button is either hidden or clipped when tabs are narrow, making it hard to close individual files from the tab bar.

Reproduction steps or desired workflow

  1. Open the code pane in Warp (e.g., via Command-P or clicking a file in the project explorer).
  2. Open several files so the tab bar contains 6–10+ tabs.
  3. Resize the pane or window so the tabs become narrow.
  4. Hover over an inactive tab and try to close it.
  5. Observe that the file icon is still shown and the close button is not easily accessible.

Desired workflow:

  • On hover over any code-pane tab, the file-type icon is replaced by a close button.
  • Clicking the close button closes that specific file tab.
  • This mirrors the behavior in Chrome and Safari browser tabs.

Artifacts

None attached.

Warp version

Unknown.

Operating system

macOS.

Possible source references

  • app/src/code/view.rs (render_tab_internal): tab rendering logic that shows the file icon and conditionally shows the close button based on hover and active state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:editor-notebooksEditors, notebooks, markdown rendering, LSP, and code display.area:window-tabs-panesWindow, tab, pane, and workspace layout management.bugSomething isn't working.repro:highThe report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions