Skip to content

Apply Formatting Only to Selected Query and Support Undo #1656

@gkjoyes

Description

@gkjoyes

Problem

When a page contains multiple queries, selecting a single query and applying Format (either from the top toolbar or the right-click context menu) formats all queries on the page instead of only the selected query.

Additionally, after formatting is applied, using Ctrl+Z (Windows/Linux) or Cmd+Z (macOS) does not revert the formatting changes.

Impact

  • Users may unintentionally modify all queries on a page when they only intended to format one.
  • Lack of Undo support makes it difficult to recover from unintended formatting changes.
  • Can lead to loss of manual formatting and reduced productivity.

Proposed solution

  • Scope the Format action to the currently selected query by default.
  • Add an option to format all queries if desired.
  • Ensure formatting operations are added to the Undo/Redo stack so they can be reverted using standard keyboard shortcuts.

Alternatives considered

No response

Related database type

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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