Bug fixes and add ci build#2319
Open
XUANJI233 wants to merge 3 commits into
Open
Conversation
added 3 commits
April 29, 2026 01:14
Bug 1 - IgLang constructor loses requested filename: - When language file does not exist on disk, FilePath stays 'English' - FileName returns 'English' instead of the originally requested filename - Config.WriteAsync() then overwrites igconfig.json with 'English' - Fix: store _requestedFileName, FileName returns it regardless of file existence Bug 2 - WebView2 detection never falls back to system runtime: - If WebView2_Runtime/ folder exists (even empty), GetAvailableBrowserVersionString only checks that folder, never the system-installed WebView2 - Fix: catch local failure then retry with null (system-wide lookup) Bug 3 - Settings opens json silently when WebView2 missing: - No user feedback when WebView2 is not found - Fix: show warning dialog before falling back to igconfig.json
- Windows runner with .NET 10 + MSBuild - Node.js 20 setup with npm cache - WebUI frontend build (npm ci + npm run build) - Build artifact upload
1. EnsureWeb2Async: add fallback to system WebView2 when local WebView2_Runtime folder exists but has no valid runtime 2. LoadThemeList: use ConcurrentBag instead of List in Parallel.ForEach 3. Clipboard cut: replace Parallel.ForEach+Remove with LINQ Where
There was a problem hiding this comment.
Pull request overview
This PR targets v10 stability by improving WebView2 runtime detection/initialization, addressing thread-safety issues in a few parallel/clipboard paths, and adding a Windows x64 CI build workflow.
Changes:
- Add user-facing warning when WebView2 is missing before opening settings, and make clipboard “cut multiple files” cleanup safe via LINQ filtering.
- Fix WebView2 fixed-runtime fallback behavior and make theme loading thread-safe in
Parallel.ForEach. - Preserve the originally requested language file name, and introduce a Windows CI workflow to build artifacts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/ImageGlass/FrmMain/FrmMain.IGMethods.cs | Warn when WebView2 isn’t installed before opening config; make clipboard list cleanup safe. |
| Source/Components/ImageGlass.Settings/Config.cs | Replace non-thread-safe List usage with ConcurrentBag in parallel theme loading. |
| Source/Components/ImageGlass.Base/Webview2/Web2.cs | Add fallback to system WebView2 runtime when local fixed runtime is invalid/missing. |
| Source/Components/ImageGlass.Base/Language/IgLang.cs | Track requested language file name so config can round-trip even if file is missing. |
| .github/workflows/build.yml | Add Windows build workflow producing Release x64 artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
168
to
173
|
|
||
| // Always preserve the original requested file name so that | ||
| // FileName returns the correct value when saving config. | ||
| _requestedFileName = fileName; | ||
|
|
||
| if (File.Exists(filePath)) |
| /// Example: <c>Vietnameses.iglang.json</c> | ||
| /// </summary> | ||
| public string FileName => Path.GetFileName(FilePath); | ||
| public string FileName => _requestedFileName ?? Path.GetFileName(FilePath); |
Comment on lines
+359
to
+363
| catch | ||
| { | ||
| // Fall back to the system-installed WebView2 Runtime | ||
| if (WebView2RuntimeFixedVersionDirPath != null) | ||
| { |
Comment on lines
+110
to
+123
| // First try the local fixed-version runtime (WebView2_Runtime folder) | ||
| try | ||
| { | ||
| var version = CoreWebView2Environment.GetAvailableBrowserVersionString(WebView2RuntimeFixedVersionDirPath); | ||
| return new Version(version); | ||
| } | ||
| catch (WebView2RuntimeNotFoundException) { } | ||
|
|
||
| // Fall back to the system-installed WebView2 Runtime | ||
| if (WebView2RuntimeFixedVersionDirPath != null) | ||
| { | ||
| try | ||
| { | ||
| var version = CoreWebView2Environment.GetAvailableBrowserVersionString(); |
Owner
|
Hi @XUANJI233 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🟢 Summary
Bug fixes
CI
🟢 Contributor License Agreement (CLA)
By submitting this pull request, I confirm that: