Skip to content

Fix dialogs opening off-screen or on the wrong monitor - #1053

Open
jasonleenaylor wants to merge 2 commits into
mainfrom
claude/webonary-dictconfig-dialog-position
Open

Fix dialogs opening off-screen or on the wrong monitor#1053
jasonleenaylor wants to merge 2 commits into
mainfrom
claude/webonary-dictconfig-dialog-position

Conversation

@jasonleenaylor

@jasonleenaylor jasonleenaylor commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Quick Summary

  • Revive UploadToWebonaryDlg position persistence: its restore/clamp/save code null-checked a PropertyTable auto-property that the constructor never assigned, so it has been dead since it was written. The property is now a constructor-assigned field, and the dialog is shown with the main window as owner.
  • Give DictionaryConfigurationManagerDlg a CenterParent start position and clamp its bounds back onto a screen in OnShown — it previously had no positioning code and could open off-screen, leaving the app looking hung (reported from the field on a multi-monitor setup).
  • Sweep the highest-risk dialogs that had no positioning code at all: CenterParent on ten (dictionary-configuration child dialogs, Webonary log viewer, the Gecko-hosting MGA/diagnostics/import-marker dialogs, semantic-domains chooser, respeller, concordance dialog) and CenterScreen on five that can be shown before any main window exists (the four FdoUi restore dialogs and the update chooser).
  • Pass an explicit owner at the six ShowDialog() call sites that had none, threading an owner parameter through DictionaryConfigurationImportController.DisplayView.

CI-ready checklist

  • Commit messages follow .github/commit-guidelines.md (subject ≤ 72 chars, no trailing punctuation; if body present, blank line then ≤ 80-char lines).
  • No whitespace warnings locally:
    git fetch origin
    git log --check --pretty=format:"---% h% s" origin/<base>..
    git diff --check --cached
  • Builds/tests pass locally (or I've run the CI-style build via Bash script or MSBuild).
  • If this is core-developer AI-assisted work, I followed Docs/workflows/ai-pr-workflow.md and ran pr-preflight or the equivalent branch-readiness review before requesting review.
  • For any Src/** folders touched, corresponding AGENTS.md files are updated or explicitly confirmed still accurate.

Notes for reviewers (optional)

WinForms' default WindowsDefaultLocation leaves placement to the OS cascade, which on multi-monitor setups can land a dialog on the wrong screen or entirely off the visible area. Centering on an owner — or on a screen, for dialogs that can appear before any window exists — takes the OS out of the placement decision. The swept dialogs are behavior-neutral one-liners except DisplayView, whose new owner parameter has exactly one caller (updated in the same commit).

Validation: build.ps1 -SkipNative clean; test.ps1 on xWorksTests filtered to UploadToWebonary + DictionaryConfiguration, 380/380 passed after rebasing onto current main.

🤖 Generated with Claude Code


This change is Reviewable

jasonleenaylor and others added 2 commits August 10, 2026 13:50
Assign the property table passed to UploadToWebonaryDlg to a field so
its existing position restore, off-screen clamp, and save actually run,
and pass the main window as owner when showing the dialog. Give
DictionaryConfigurationManagerDlg a CenterParent start position and
clamp its bounds back onto a screen in OnShown.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Set CenterParent on ten dialogs that had no positioning code, and
CenterScreen on the four FdoUi restore dialogs and the update chooser,
which can be shown before any main window exists. Pass an explicit
owner at the six ShowDialog call sites that had none, threading an
owner parameter through DictionaryConfigurationImportController's
DisplayView.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.43%. Comparing base (1ada9f6) to head (36daa0d).

Files with missing lines Patch % Lines
Src/xWorks/UploadToWebonaryDlg.cs 0.00% 8 Missing and 2 partials ⚠️
Src/xWorks/DictionaryConfigurationManagerDlg.cs 0.00% 7 Missing and 1 partial ⚠️
.../DetailControls/SemanticDomainReferenceLauncher.cs 0.00% 1 Missing ⚠️
.../Controls/DetailControls/SemanticDomainsChooser.cs 0.00% 1 Missing ⚠️
Src/Common/FwUtils/FwUpdateChooserDlg.cs 0.00% 1 Missing ⚠️
...ialogs/CantRestoreLinkedFilesToOriginalLocation.cs 0.00% 1 Missing ⚠️
Src/FdoUi/Dialogs/ConflictingSaveDlg.cs 0.00% 1 Missing ⚠️
Src/FdoUi/Dialogs/FilesToRestoreAreOlder.cs 0.00% 1 Missing ⚠️
...doUi/Dialogs/RestoreLinkedFilesToProjectsFolder.cs 0.00% 1 Missing ⚠️
Src/LexText/LexTextControls/InsertEntryDlg.cs 0.00% 0 Missing and 1 partial ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1053      +/-   ##
==========================================
- Coverage   36.44%   36.43%   -0.01%     
==========================================
  Files        1354     1354              
  Lines      295692   295716      +24     
  Branches    40228    40229       +1     
==========================================
- Hits       107752   107749       -3     
- Misses     158660   158686      +26     
- Partials    29280    29281       +1     
Files with missing lines Coverage Δ
.../DetailControls/SemanticDomainReferenceLauncher.cs 9.67% <0.00%> (ø)
.../Controls/DetailControls/SemanticDomainsChooser.cs 0.00% <0.00%> (ø)
Src/Common/FwUtils/FwUpdateChooserDlg.cs 0.00% <0.00%> (ø)
...ialogs/CantRestoreLinkedFilesToOriginalLocation.cs 0.00% <0.00%> (ø)
Src/FdoUi/Dialogs/ConflictingSaveDlg.cs 0.00% <0.00%> (ø)
Src/FdoUi/Dialogs/FilesToRestoreAreOlder.cs 0.00% <0.00%> (ø)
...doUi/Dialogs/RestoreLinkedFilesToProjectsFolder.cs 0.00% <0.00%> (ø)
Src/LexText/LexTextControls/InsertEntryDlg.cs 0.00% <0.00%> (ø)
...c/LexText/LexTextControls/LexImportWizardMarker.cs 0.00% <0.00%> (ø)
Src/LexText/Morphology/ConcordanceDlg.cs 0.00% <0.00%> (ø)
... and 14 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   7m 50s ⏱️ -19s
5 761 tests ±0  5 680 ✅ ±0  81 💤 ±0  0 ❌ ±0 
5 770 runs  ±0  5 689 ✅ ±0  81 💤 ±0  0 ❌ ±0 

Results for commit 36daa0d. ± Comparison against base commit 1ada9f6.

♻️ This comment has been updated with latest results.

@jasonleenaylor
jasonleenaylor force-pushed the claude/webonary-dictconfig-dialog-position branch from 2dcc497 to 36daa0d Compare August 10, 2026 21:49
@jasonleenaylor
jasonleenaylor marked this pull request as ready for review August 10, 2026 22:01
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.

2 participants