Skip to content

Trace Generation Dialog: Retain trace input focus on enter - #1342

Merged
JonatanAntoni merged 2 commits into
mainfrom
trace-enter-focus
Nov 2, 2026
Merged

JonatanAntoni merged 2 commits into
mainfrom
trace-enter-focus

Conversation

@JonatanAntoni

@JonatanAntoni JonatanAntoni commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Fixes

Changes

  • Intercept Enter key press to commit pending edit but stop propagation to keep focus/cursor in place for further editing

Screenshots

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A skipped edit after an on-disk reload can leave the input displaying an uncommitted value that subsequent Enter or blur events cannot retry.

1 open issue
What changed in this PR

This PR addresses the Enter-key editing behavior in #1292, keeping focus and the caret in Trace Generation text fields while the host processes edits.

Changes:

  • Commit on Enter without blurring, while leaving composition events untouched.
  • Track text-edit completion across host updates to preserve active drafts and selection.
  • Add renderer and provider tests for focus retention, overlapping edits, and completion handling.
File Description
src/​webviews/​trace-configuration/​src/​trace-configuration.ts Preserves active text edits and focus across host renders.
src/​webviews/​trace-configuration/​src/​trace-configuration.test.ts Tests Enter behavior, draft retention, and focus boundaries.
src/​views/​trace-configuration/​trace-configuration-webview-provider.ts Sends completion IDs after handling text edits.
src/​views/​trace-configuration/​trace-configuration-webview-provider.test.ts Tests completion timing, failures, and disposal.
src/​views/​trace-configuration/​trace-configuration-protocol.ts Adds optional edit and completion IDs to messages.

Review effort: Balanced

@qltysh

qltysh Bot commented Nov 2, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
...ws/trace-configuration/trace-configuration-webview-provider.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@arneschmid arneschmid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@JonatanAntoni
JonatanAntoni merged commit 8c49500 into main Nov 2, 2026
16 checks passed
@JonatanAntoni
JonatanAntoni deleted the trace-enter-focus branch November 2, 2026 15:20
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.

4 participants