Skip to content

💡 Add option to disable auto-focus/reveal of Imports & Exports views on active editor change #1788

Description

@slowcode42

Suggest an idea for Knip

Summary

When the Imports and Exports views are moved out of the Explorer into a separate view container (e.g. the Panel or the Secondary Side Bar), they automatically grab focus every time the active editor changes (i.e. whenever I open or switch files). This makes the dragged-out layout frustrating to use, because focus keeps jumping away from the editor to the Knip views.

Context

The Imports/Exports views are genuinely more useful when they have more space, so dragging them out of the Explorer into their own dedicated view area is a natural workflow. However, the current auto-reveal-with-focus behavior fights against this layout.

Current behavior

  • Drag the Imports / Exports views out of the Explorer into a separate view container.
  • Open or switch to any file.
  • The Imports/Exports view automatically steals focus from the editor.
  • The only related setting available is to enable/disable the Imports and Exports views entirely — there is no way to keep them visible while stopping the auto-focus.

Expected behavior

The views should update their content to follow the active editor without stealing focus. Ideally there would be a setting such as:

  • knip.views.revealOnActiveEditorChange (or similar) — when disabled, the views still refresh for the active file but do not take focus, and
  • if a reveal is still desired, use a non-focusing reveal (reveal(..., { focus: false, select: false })) by default.

Why this matters

Decoupling the auto-focus from the content refresh would make the views usable in a standalone, larger layout — which is where they're most valuable — instead of forcing them to live inside the Explorer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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