Skip to content

Await ShowDialog in Format_Click (fix CS4014)#241

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/format-dialog-await
Apr 20, 2026
Merged

Await ShowDialog in Format_Click (fix CS4014)#241
erikdarlingdata merged 1 commit intodevfrom
fix/format-dialog-await

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Awaits dialog.ShowDialog(GetParentWindow()) in Format_Click so the status update and method return wait for the user to dismiss the parse-error dialog
  • Eliminates the new CS4014 warning introduced by Feature/query editor sql formater #238

Test plan

  • dotnet build -c Debug — 0 warnings, 0 errors
  • App launches and runs

🤖 Generated with Claude Code

The format error dialog was launched fire-and-forget, causing status
text to update and the method to return before the user dismissed it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

Review

What it does: Adds await to dialog.ShowDialog(GetParentWindow()) in Format_Click (src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs:2059) to clear the CS4014 warning introduced by #238.

Good:

  • Base branch is dev
  • Minimal, correctly scoped fix. The enclosing method is already async void, so await is the right call.
  • Behavior is now more correct: SetStatus("Format failed: …") and the finally { FormatButton.IsEnabled = true; } now run after the user dismisses the modal, not while it's still open. That's the intended UX — the button shouldn't re-enable behind a live error dialog.
  • No Avalonia gotchas, no brush/contrast changes, no PlanAnalyzer rule changes, no MVVM creep.

Notes:

  • FormatOptions_Click at the bottom of the same file (line ~2089) uses the same fire-and-forget dialog.ShowDialog(GetParentWindow()) pattern, but in a non-async void handler with nothing after it, so no CS4014 and no behavior bug. Out of scope here; just flagging for awareness if the same treatment is ever desired for consistency.
  • No test added, but the change is a pure UI interaction ordering fix in PlanViewer.App (not PlanViewer.Core), and tests/PlanViewer.Core.Tests/ wouldn't be the right home for it. Acceptable.

No blockers from my end.


Generated by Claude Code

@erikdarlingdata erikdarlingdata merged commit f03f565 into dev Apr 20, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/format-dialog-await branch April 20, 2026 15:42
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.

1 participant