Add SE 4 "Move cue one frame (keep gap if close)" shortcuts (#11245)#11247
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Ports four Subtitle Edit 4 “move cue one frame (keep gap if close)” shortcuts into SE 5 by adding new commands and wiring them into the shortcuts UI, localization labels, and the SE4 Settings.xml shortcut importer.
Changes:
- Added four new
[RelayCommand]commands inMainViewModeland extended the existing one-frame move helpers withkeepGap*IfClosebehavior. - Registered the new commands in the shortcuts list/translation map and added English label strings.
- Mapped SE4 shortcut IDs to the new SE5 commands in the SE4 shortcuts importer.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/ui/Logic/ShortcutsMain.cs | Adds command translation entries and registers the 4 new shortcuts in the available shortcuts list. |
| src/ui/Logic/Config/Language/Options/LanguageSettingsShortcuts.cs | Adds 4 new shortcut label properties and default English strings. |
| src/ui/Features/Options/Shortcuts/Se4ShortcutsImporter.cs | Maps SE4 “KeepGap” shortcut IDs to the new SE5 commands for import compatibility. |
| src/ui/Features/Main/MainViewModel.cs | Implements the 4 new commands, adds keepGap flags to move helpers, and also changes undocked-window Topmost behavior. |
Comment on lines
+5256
to
+5260
| // Float above main while main (or this window) is active, but drop behind when | ||
| // SE loses focus to another app. Mirrors the Find/Replace helper from #11243. | ||
| // The two undocked windows are still independent in Alt+Tab — KeepTopmost… is | ||
| // just a Z-order knob, not an ownership change. | ||
| WindowService.KeepTopmostWhileOwnerActive(window, Window!); |
Comment on lines
+8646
to
+8649
| if (keepGapPrevIfClose && prev != null | ||
| && prev.EndTime.TotalMilliseconds <= s.StartTime.TotalMilliseconds | ||
| && prev.EndTime.TotalMilliseconds + gapMs >= s.StartTime.TotalMilliseconds) | ||
| { |
Comment on lines
+8697
to
+8700
| if (keepGapNextIfClose && next != null | ||
| && s.EndTime.TotalMilliseconds <= next.StartTime.TotalMilliseconds | ||
| && s.EndTime.TotalMilliseconds + gapMs >= next.StartTime.TotalMilliseconds) | ||
| { |
Ports the four SE 4 shortcuts from issue #11245: - MainAdjustMoveStartOneFrameBackKeepGapPrev - MainAdjustMoveStartOneFrameForwardKeepGapPrev - MainAdjustMoveEndOneFrameBackKeepGapNext - MainAdjustMoveEndOneFrameForwardKeepGapNext Behavior matches SE 4's MoveStartCurrent / MoveEndCurrent (Forms/Main.cs ~20984 / ~21097): when the gap to the previous (or next) subtitle is already tighter than MinimumBetweenLines, drag the neighbor's edge by the same delta so the existing small gap is preserved instead of collapsing or being clamped at the standard gap. Min-duration guard on the neighbor aborts the move rather than producing a sub-minimum line. The existing plain "Move start/end one frame" variants are unchanged. Wires through: - 4 new RelayCommand methods in MainViewModel - Shared MoveStart/EndByFrames helpers gain a keepGap flag - Language strings (LanguageSettingsShortcuts) - Shortcut dictionary + AddShortcut registrations (ShortcutsMain) - SE 4 importer mappings (Se4ShortcutsImporter) so users importing an SE 4 settings.xml get the new bindings Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28d7e14 to
ee6d34f
Compare
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
Ports the four SE 4 shortcuts requested in #11245:
MainAdjustMoveStartOneFrameBackKeepGapPrevMainAdjustMoveStartOneFrameForwardKeepGapPrevMainAdjustMoveEndOneFrameBackKeepGapNextMainAdjustMoveEndOneFrameForwardKeepGapNextBehavior (matches SE 4
Forms/Main.csMoveStartCurrent~20984 /MoveEndCurrent~21097): when the gap to the previous (or next) subtitle is ≤MinimumBetweenLines(i.e. inclusive of equality — same condition SE 4 uses), dragging the cue also drags the neighbor's edge by the same delta, preserving the existing gap. Min-duration guard on the neighbor aborts the move rather than producing a sub-minimum line. Outside the "close" window the behavior is identical to the existing plain "Move start/end one frame" variants.The existing plain shortcuts are unchanged.
Touchpoints
MainViewModel.cs(~8590) — 4 new[RelayCommand]methods;MoveStartByFrames/MoveEndByFramesgain akeepGapflag.LanguageSettingsShortcuts.cs— 4 new label strings.ShortcutsMain.cs— labels dictionary +AddShortcutregistrations.Se4ShortcutsImporter.cs—MainAdjustMove*KeepGap*→ SE 5 command mappings so importing an SE 4Settings.xmlcarries the keybindings across.Test plan
Alt+Shift+Left/Rightstyle).MinimumBetweenLines:MoveStartOneFrameBackKeepGapPrev→ both this start AND prev end move back by one frame; gap unchanged.MoveStartOneFrameForwardKeepGapPrev→ both shift forward by one frame; gap unchanged.MoveEndOneFrameForwardKeepGapNext/MoveEndOneFrameBackKeepGapNext— symmetric checks on the end side.MinimumBetweenLines: KeepGap variant behaves like the plain variant (no neighbor drag).MinimumBetweenLines: KeepGap engages (matches SE 4's<=/>=boundary).Settings.xmlthat has the fourMainAdjustMove*KeepGap*bindings → they map onto the new SE 5 commands.Refs #11245.
🤖 Generated with Claude Code