Repository navigation
Conversation
Entry.parse now returns a Result that distinguishes those three failures. MemoryDict stores each one as a DictReadFailure (line number, raw text, and reason), and DictLoadStatus.loaded carries that array on both the initial load and later edit notifications; failedEntryCount is the array length, which the existing user-dictionary notification still uses. In dictionary settings, a loaded dictionary with failures shows a button that opens a sheet listing the line number, a localized reason, and the selectable raw line, with English and Japanese strings. Fixes mtgto#503
Resolve conflicts with the ReadonlyMemoryDict split. SearchableDict now exposes readFailures, with failedEntryCount derived from it, and ReadonlyMemoryDict records each unread line the same way MemoryDict does.
Adopt FileDict.Status and FileDict.StatusEvent from main and carry the unread lines in Status.loaded. Edit notifications now come from UserDict.postEditEvent, so it passes readFailures too.
|
Merged main again (084089b) to clear the conflict with the FileDict.Status move: the load failures now ride on |
|
@mvanhorn Sorry for the late reply, and thank you for working on #503. Before I review this in detail, could you verify it on a real environment?
If that's difficult on your side, no problem at all — just let me know and I'll implement it myself, using this PR as a reference. |
|
Thanks for taking a look. I ran the unit tests on the PR head (084089b) with the CI command, Running only FileDictTests, MemoryDictTests, ReadonlyMemoryDictTests and EntryTests, all 57 pass. That includes the new FileDictTests.testLoadBadLineSurvivesEdit, which loads a file with an invalid line ( I can't run ./build_restart.sh on a real install or take the Settings screenshots from my setup right now, so the UI side is still unverified on my end. |
Entry.parse now returns a Result that distinguishes those three failures. MemoryDict stores each one as a DictReadFailure (line number, raw text, and reason), and DictLoadStatus.loaded carries that array on both the initial load and later edit notifications; failedEntryCount is the array length, which the existing user-dictionary notification still uses. When a dictionary file contains lines the loader skips, Settings only shows how many lines failed. The log records the line number, so the user still has to open the file to see the text and figure out why that line was skipped.
The Swift test command did not run the new dictionary tests.
Fixes #503