Repository navigation
Fix subtitle parsing, autosave and settings reset; add tests and CI - #1
Merged
Merged
Conversation
The cue regex ended each cue at the first newline followed by a digit, so a
text line starting with a number ("20 dollars.") was cut off with the rest
of its cue, and timestamps with '.' milliseconds dropped the whole cue.
Cues are now split on blank lines; the index line is optional, cue settings
after the timing are ignored, and the BOM is stripped. Output is identical
on well-formed files. Removes a debug print.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AppSettings shallow-copied DEFAULT_SETTINGS, sharing the nested hotkeys dict, so rebinding a key also rewrote the default and Reset restored the user's own binding. A settings file with only some hotkeys also replaced the whole dict, dropping the defaults for the rest. Removes an unused Qt import so the core modules no longer need Qt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a project open, autosave overwrote the .vat every 15 seconds, so answering No to "Save before exit?" did not discard anything. The autosave file was also never removed, so every launch offered to restore it, and restoring made the hidden file the working project. Autosave now writes .<name>.autosave.vat next to the project (or the subtitles before the first save), recording which project it belongs to. Save and discard remove it; a restore is offered only when it is newer than the project and continues on the original project. Save reports failure, and a failed or cancelled save keeps the window open. Autosave failures show in the status bar instead of a modal dialog every 15 s. Also in the window: - reject commas in character names; commas separate characters in the exported CSV and in CIGA's input, so such a name became two characters - cancelling the save prompt no longer orphans the window when opening another project or starting a new one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- delete extract.py, a one-off migration script that would overwrite
annotator_window.py if run, and the unused ManageCharactersDialog
- stop tracking settings.json and characters.txt, which the app rewrites
as it is used; characters.example.txt documents the format
- bundle the logos in assets/ so the app and build work outside a CIGA
checkout
- README: the clone step is 'cd ciga-annotator' and the launch command is
'python run.py' ('python src/main.py' fails with 'No module named src')
- move pyinstaller to requirements-dev.txt with pytest
- CI runs the tests on Windows and Linux
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Autosave metadata must be validated, and loaded character names must reject commas before export.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR fixes subtitle parsing, autosave/recovery, settings reset, character validation, packaging, and documentation while adding tests and CI.
Changes:
- Improved SRT parsing and atomic autosave recovery.
- Corrected save/cancel flows and settings handling.
- Added validation, integration tests, cross-platform CI, and cleanup.
| File | Summary |
|---|---|
tests/test_project.py |
Project and autosave tests |
tests/test_parsers.py |
SRT parsing tests |
tests/test_characters.py |
Character validation tests |
tests/test_app_settings.py |
Settings persistence tests |
tests/test_annotator_window.py |
UI save and recovery tests |
src/ui/char_dialog.py |
Removed obsolete dialog |
src/ui/annotator_window.py |
Updated save, recovery, and validation behavior |
src/main.py |
Fixed resources and window transitions |
src/core/project.py |
Added atomic project and autosave utilities |
src/core/parsers.py |
Improved SRT parsing |
src/core/characters.py |
Added character-name validation |
src/core/app_settings.py |
Fixed settings isolation and hotkey merging |
settings.json |
Removed tracked user state |
requirements.txt |
Runtime dependencies |
requirements-dev.txt |
Development dependencies |
README.md |
Updated usage instructions |
pytest.ini |
Configured pytest |
extract.py |
Removed stale script |
characters.example.txt |
Documented character format |
build.py |
Updated bundled asset paths |
.gitignore |
Ignored generated state |
.github/workflows/tests.yml |
Added Windows/Linux CI |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copying or moving a project folder carries its hidden autosave along, and that file still names the original project. Restoring it in the copy set the working project to the original's path, so Save could overwrite a different project. An autosave is now trusted only when its recorded owner's autosave location is that very file; otherwise, or if it is malformed, no restore is offered, and opening it directly continues as an unsaved session. Reported by Copilot review on #1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
.for milliseconds dropped the whole cue..vatopen, autosave rewrote it every 15 s, so answering No to "Save before exit?" didn't discard anything..<name>.autosave.vat, which records the project it belongs to. Save and discard delete it. Restore is offered only when the autosave is newer than the project, and continues on the original project.hotkeysdict, so rebinding a key rewrote the default. A settings file with only some hotkeys also lost the defaults for the rest.Cleanup
extract.py, a stale one-off script that would overwriteannotator_window.pyif run, and the unusedManageCharactersDialog.settings.jsonandcharacters.txt, which the app rewrites as you use it.characters.example.txtdocuments the format.assets/, so the app and build work outside a CIGA checkout.cd ciga-annotator, and the launch command ispython run.py(python src/main.pyfails withNo module named 'src').pyinstallermoves torequirements-dev.txt, together withpytest.Tests and CI
Test plan
python -m pytest: 50 passedpython build.pyand launch the exe🤖 Generated with Claude Code