Harden Quick Note formatting and persistence - #26
Draft
codebdbd wants to merge 3 commits into
Draft
Conversation
Comment on lines
+41
to
+45
| string code = File.ReadAllText(Path.Combine( | ||
| AppContext.BaseDirectory, | ||
| "..", "..", "..", "..", | ||
| "AiteBar", | ||
| "QuickNoteWindow.xaml.cs")); |
|
|
||
| private static XDocument LoadDocument() | ||
| { | ||
| string path = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "AiteBar", "QuickNoteWindow.xaml"); |
| [Fact] | ||
| public async Task ReadMarkdownAsync_RestoresLatestConflictCopyAfterServiceRestart() | ||
| { | ||
| string older = Path.Combine(_tempDir, "QuickNote.conflict-older.md"); |
| public async Task ReadMarkdownAsync_RestoresLatestConflictCopyAfterServiceRestart() | ||
| { | ||
| string older = Path.Combine(_tempDir, "QuickNote.conflict-older.md"); | ||
| string latest = Path.Combine(_tempDir, "QuickNote.conflict-latest.md"); |
| { | ||
| RunSta(() => | ||
| { | ||
| string tempRoot = Path.Combine(Path.GetTempPath(), "AiteBarTests", Guid.NewGuid().ToString("N")); |
| { | ||
| var settingsService = new AppSettingsService( | ||
| Path.Combine(tempRoot, "buttons.json"), | ||
| Path.Combine(tempRoot, "settings.json")); |
Comment on lines
+216
to
+219
| catch (Exception ex) | ||
| { | ||
| exception = ex; | ||
| } |
Comment on lines
+228
to
+231
| catch (Exception ex) | ||
| { | ||
| Logger.Log(ex); | ||
| } |
| private static async Task WriteAtomicallyAsync(string path, string content) | ||
| { | ||
| string directory = Path.GetDirectoryName(path) ?? Directory.GetCurrentDirectory(); | ||
| string tempPath = Path.Combine(directory, $".{Path.GetFileName(path)}.{Guid.NewGuid():N}.tmp"); |
Comment on lines
+1862
to
+1865
| catch (Exception ex) | ||
| { | ||
| Logger.Log(ex); | ||
| } |
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.
What changed
Why
Quick Note formatting controls could appear empty or fail on repeated choices, clear-formatting flickered and could damage selection/link structure, and several persistence edge cases could lose formatting or mishandle external edits. This hardens the existing lightweight single-note architecture without changing its Markdown storage format.
Validation
dotnet build .\AiteBar.sln -c Release— 0 warnings, 0 errorsdotnet test .\AiteBar.Tests\AiteBar.Tests.csproj -c Release --no-build— 751/751 passed on a clean branch fromorigin/master.\installer\Build-Installer.ps1— succeededB0BEA5C6D060714DC0749899729AE470E94F284B7315E90AACC7A8F304E07242Code signing was skipped because no signing certificate was supplied.
Review follow-up
mailto:, andtel:payload validationfile:,javascript:, shell-metacharacter, and traversal-like payloadsContract cleanup
FontFamilyvalues