Conversation
Agent-Logs-Url: https://github.com/M-Nikox/Slate/sessions/3f93a33c-fc01-4870-a963-7cfb4c706144 Co-authored-by: M-Nikox <101933576+M-Nikox@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M-Nikox/Slate/sessions/3f93a33c-fc01-4870-a963-7cfb4c706144 Co-authored-by: M-Nikox <101933576+M-Nikox@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M-Nikox/Slate/sessions/3f93a33c-fc01-4870-a963-7cfb4c706144 Co-authored-by: M-Nikox <101933576+M-Nikox@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M-Nikox/Slate/sessions/3f93a33c-fc01-4870-a963-7cfb4c706144 Co-authored-by: M-Nikox <101933576+M-Nikox@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M-Nikox/Slate/sessions/ce3eeba7-34d9-4534-a811-86b4e5272ede Co-authored-by: M-Nikox <101933576+M-Nikox@users.noreply.github.com>
…and all real changes Agent-Logs-Url: https://github.com/M-Nikox/Slate/sessions/4057e71f-70cc-4687-b57f-784be298db40 Co-authored-by: M-Nikox <101933576+M-Nikox@users.noreply.github.com>
Harden parser and rename safety for regex branch
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces Template Mode to let users customize renamed output filenames using token-based templates, while also improving parser accuracy/warnings, scanner filtering, and rename/undo safety and reliability.
Changes:
- Add
applyTemplate()+ token set and wire template-based naming through renderer previews (auto + manual) with a newTemplateEditorUI. - Extend filename parser patterns (anime specials, Japanese markers), tighten compact NNN parsing, and surface structured parser warnings in the UI.
- Strengthen file operation safeguards (exclude dotfiles in scanner; block cross-directory moves; improve undo-log patching performance and crash recovery).
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/parser/parser.test.ts | Adds coverage for new parser patterns/warnings and template application behavior. |
| tests/main/scanner.test.ts | Ensures hidden dotfiles are excluded from scan results. |
| tests/main/renamer.test.ts | Adds coverage for cross-directory rename blocking. |
| src/shared/parser/parse-filename.ts | Adds new episode patterns, tightens compact parsing, and emits trailing-marker warnings. |
| src/shared/parser/build-name.ts | Introduces template tokens, applyTemplate(), and makes buildName() a wrapper over the default template. |
| src/renderer/hooks/usePreviews.ts | Applies templates to all preview rows (auto/manual) and maps parser warning codes to UI messages. |
| src/renderer/components/TemplateEditor.tsx | New template editor UI with token chips, reset, and live preview. |
| src/renderer/App.tsx | Adds template state/mode toggle, shows TemplateEditor, and builds rename destination paths more robustly. |
| src/main/file-ops/scanner.ts | Skips dotfiles during scanning. |
| src/main/file-ops/renamer.ts | Blocks cross-directory moves, rejects symlink sources, and optimizes undo-log updates via indexing. |
| package.json | Bumps app version and updates dependency versions. |
| CHANGELOG.md | Documents Template Mode, parser/scanner updates, rename safety, undo changes, and tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
This pull request introduces a major new feature: Template Mode, which allows users to fully customize the output filename format for renamed files via a flexible template editor. In addition, it includes several parser improvements, enhanced rename safety checks, undo/redo performance and reliability improvements, and dependency updates. Below are the most important changes:
New Features: Template Mode
TemplateEditorcomponent to the UI, enabling users to define custom output filename formats using tokens (e.g.,{Show},{SeasonZ},{EpisodeZ}, etc.), with live preview and click-to-insert token chips. The template applies to both auto and manual modes, and a reset button restores the default template ({Show} - S{SeasonZ}E{EpisodeZ}). (CHANGELOG.md[1]src/renderer/App.tsx[2] [3] [4]src/renderer/components/TemplateEditor.tsx[5]src/renderer/hooks/usePreviews.ts[6]src/renderer/App.tsx[1] [2]src/renderer/hooks/usePreviews.ts[3]Parser and Scanner Improvements
CHANGELOG.md[1]src/main/file-ops/scanner.ts[2]CHANGELOG.mdCHANGELOG.mdR7-R52)Rename Safety and Undo/Redo Reliability
validateOperationnow blocks any rename that would move a file outside its original directory, and explicitly rejects symbolic links as sources. (src/main/file-ops/renamer.ts[1] [2]src/main/file-ops/renamer.ts[1] [2] [3] [4] [5]Dependency Updates
package.json[1] [2]Tests
CHANGELOG.mdCHANGELOG.mdR7-R52)These changes provide powerful new customization options for filename formatting, improve parser accuracy, and make the rename and undo/redo features safer and more robust.