Skip to content

Fix several SE5 RC issues from OmrSi's report (#10766)#11557

Merged
niksedk merged 7 commits into
mainfrom
fix/se5-rc-omrsi-fixes
Jun 12, 2026
Merged

Fix several SE5 RC issues from OmrSi's report (#10766)#11557
niksedk merged 7 commits into
mainfrom
fix/se5-rc-omrsi-fixes

Conversation

@niksedk

@niksedk niksedk commented Jun 12, 2026

Copy link
Copy Markdown
Member

Addresses several items from OmrSi's RC test report in discussion #10766. Each is a focused commit.

Fixes

  • Numpad + - * / shortcut keys — the capture path prefixed every numpad key with NumPad, so the four arithmetic operators became NumPadAdd/NumPadMultiply/etc. and stopped matching the bare Avalonia Key names used by the shortcut dropdown, SE4 import, and the default bindings (the Shift+Add/Shift+Subtract waveform-zoom defaults were silently broken too). Stop prefixing those four; migrate any tokens stored during RC builds back to the bare names. Digits, Decimal and Enter keep the prefix. (report (Suggestion) CPS and separation in subtitle list #2)
  • Go to bookmark seeks the video — "go to next/previous bookmark" only moved the grid selection; SE4 also moved the video. (report Tags remain in image export #3)
  • Reopen seeks the video to the last line — opening from the Reopen menu restored the last line but left the video at 0:00; now mirrors the startup file-restore path. (report Ability to choose specific audio channel/track for Wave generation. #11)
  • "Toggle dialog dashes" works from the text boxes — was registered as SubtitleGrid (grid-focus only). Moved to SubtitleGridAndTextBox and routed that category for the original/translation box too (previously only the normal box was routed), so it works from whichever text box has focus, like SE4. (report multiselect subtitles in wave #5)
  • Windows dark-mode title bar — SE never set the Win32 immersive dark-mode flag, so the OS title bar stayed light. Added a DwmSetWindowAttribute helper (attribute 20, falling back to 19 for older Windows 10) applied via the universal per-window hook, so every window gets it on open and on theme switches. No-op off Windows. (report Move/add "Delete" menu to the Window UI in Custom Format window #9)
  • Hidden setting to disable automatic waveform generationWaveform.WaveformAutoGenerate (Settings.json only, no UI yet, default true). When false, opening a video no longer kicks off ffmpeg extraction; cached peaks still load. (report Alignment tags lose "{\" in JSON formats #10)
  • Keep video position when entering fullscreen — fullscreen opens a fresh player and seeks back to the saved position, but the seek was applied immediately after the player reported ready and didn't reliably stick — leaving fullscreen at 0:00, most visibly when paused on an empty stretch of the timeline. Settle briefly and re-apply, the same pattern as the file-restore/Reopen paths. (Tier 1: fixes the "resets to beginning"; the brief 0:00 flash from re-opening a second player is a separate, larger change.) (report Ebu Stl - Italics #1)

Testing

  • dotnet build src/ui/UI.csproj — clean (0 warnings / 0 errors).
  • Not runtime-verified — I don't have a Windows box, so the numpad-key, dialog-dashes, video-seek, fullscreen, and especially the dark-title-bar P/Invoke paths should be checked on a real Windows 10 install. Notes per item:
    • Dark title bar: on some Win10 builds the caption may not repaint until the window is re-activated; confirm live dark↔light switching updates open windows.
    • Numpad: capture a numpad key (combobox should now show it), import an SE4 file with numpad shortcuts, and verify Shift+numpad +/- zooms the waveform.
    • Fullscreen: the Task.Delay(200) settle value is empirical and may need tuning.

Remaining items from the report not addressed here: #4 (find scroll/highlight), #6/#7 (Find layout / grid separator), #8 (unfocused-selection color), #12 (missing SE4 shortcuts).

🤖 Generated with Claude Code

niksedk and others added 6 commits June 12, 2026 08:15
The shortcut capture path prefixed every numpad key with "NumPad", turning the
four arithmetic operators into "NumPadAdd"/"NumPadMultiply"/etc. Those keys are
NumLock-independent and have no main-keyboard Key equivalent, so the prefix only
broke matching against the bare Avalonia Key names used by the shortcut-picker
dropdown, SE 4 import, and the default bindings (Shift+Add/Shift+Subtract
waveform zoom were silently broken).

Stop prefixing the four operators so a numpad * reports as "Multiply" again, and
migrate any "NumPad{Add,Subtract,Multiply,Divide}" tokens stored during RC builds
back to the bare names on load. Digits, Decimal and Enter keep the prefix (NumLock
states / numpad-vs-main Enter).

Reported by OmrSi (#10766).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Go to next/previous bookmark" only moved the grid selection; SE 4 also moved the
video to the line. Add a SeekVideoToSubtitleStart helper (no-op when no video is
loaded) and call it from both bookmark navigation commands.

Reported by OmrSi (#10766).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Opening a file from the Reopen menu restored the last-selected line but left the
video at 0:00. Mirror the startup file-restore path: wait for the players to be
ready, then seek the video to the restored line and re-center the waveform.

Reported by OmrSi (#10766).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The shortcut was registered as SubtitleGrid, so it only fired when the grid was
focused. Move it to SubtitleGridAndTextBox and route that category for the
original/translation text box too (previously only the normal box was routed), so
it works from whichever text box has focus, like SE 4. The command already syncs
both Text and OriginalText.

Reported by OmrSi (#10766).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The OS-drawn title bar stayed light in dark mode because SE never set the Win32
immersive dark-mode flag. Add a WindowsDarkMode.Apply DwmSetWindowAttribute helper
(attribute 20, falling back to 19 for older Windows 10) and call it from
ApplyScaleToWindow, the universal per-window hook — so every window gets it on open
and on theme switches (ApplyLayoutScaleToAllWindows re-runs it). No-op off Windows.

Reported by OmrSi (#10766).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add Waveform.WaveformAutoGenerate (Settings.json only, no UI yet, default true).
When set to false, opening a video no longer kicks off ffmpeg waveform/spectrogram
extraction; cached peaks still load so existing waveforms keep showing, and new ones
are generated on demand.

Requested by OmrSi (#10766).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@niksedk Are you already looking into the not addressed items?

I was gonna look into some of these but would like to avoid ending up both of us fixing the same issue. I was gonna start looking at the scrolling issue (has been high on my list), I can look at the Find dialog and grid separator, and the unfocused-selection color has also been high on my list.

Let me know if I should continue or you're already on top of these.

@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Regarding 6353c0e:

This can be quite slow when moving quickly between bookmarks and the video is a large one on rotational hard drive.

I suggest that we gate it behind a toggle, similar to Go to line number. It would be consistent that way, and I'd argue that in this case the option is even more important. You can't jump to line numbers in quick succession but you can do it with bookmarks.

Screenshot 2026-06-12 at 11 03 40 AM

@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Grid focus tweak is here: #11561

@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Find/Replace layout tweak is here: #11565

@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Unfocused selection items for Listboxes: #11566

With this, data grids and list boxes are aligned, and at this point no other component requires such a tweak.

@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Grid separation and some related visual tweaks: #11568

@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@niksedk FWIW, I gave another try to the scrolling issue, to no avail. And then there's the unbearable oscillation I'm getting on scroll, too (on macOS at least.)

The root cause is Virtualization. Avalonia's DataGrid only renders rows currently visible in the viewport. Off-screen rows have no DataGridRow element in the visual tree. To scroll to a row that isn't rendered yet, the DataGrid needs to know its Y offset in the content, which requires knowing the cumulative height of all rows above it. With variable heights, those unmeasured rows have unknown heights, so Avalonia can't calculate the correct offset.

The two reliable solutions:

  • Fixed row height - This works like a charm. Avalonia can pre-calculate every row's Y position exactly, so ScrollIntoView works correctly and centering math is straightforward (index × rowHeight). Scrolling issue, oscillation, all gone. This is what I've always been using in my ow private build: I can't live with the oscillation and unreliable scroll, and have not had any success yet to solve it reliably, variable row height is just not supported in these virtualized data grids.
  • Disable virtualization - all rows are realized at once, so their actual heights are always known and TranslatePoint / BringIntoView work reliably. The trade-off is memory and initial render time for large subtitle files. I have not explored this avenue yet since I've been quite happy with fixed row height and there were many other things to look at in SE5.

Fullscreen opens a fresh player and seeks back to the saved position, but the seek
was applied immediately after the player reported ready, so it didn't reliably
stick — leaving fullscreen at 0:00, most visibly when paused on an empty stretch of
the timeline (where nothing else re-seeks afterwards). Settle briefly and re-apply
the position, the same pattern used by the startup file-restore and Reopen paths.

Reported by OmrSi (#10766).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niksedk

niksedk commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

@mjuhasz: I am away from home atm, so I will be somewhat slow at replying.
The scrolling seems mostly okay on Windows, so let's keep it for now. We can investigate other controls and/or hope for the table view control.
Disabling virtualization for less than 1000 rows or so could also be worth a shot.

@niksedk niksedk merged commit 256a93f into main Jun 12, 2026
1 of 3 checks passed
@niksedk niksedk deleted the fix/se5-rc-omrsi-fixes branch June 12, 2026 17:39
@niksedk

niksedk commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

@mjuhasz: We somewhere lost the multi-line grid, can you revert that?
(Ups, had the one-line-setting enabled)

@OmrSi

OmrSi commented Jun 12, 2026

Copy link
Copy Markdown
Member

@niksedk @mjuhasz Thank you for all the fixes!

The only thing remaining is number 4, which is basically two parts:

  1. Using Find next, the line isn't always in focus, I might have to scroll down a bit to see it. This only happens when Show subtitle text as single line in grid is disabled.

  2. The text I'm trying to find isn't always highlighted in the textbox, the cursor is just set to the end of it.

@mjuhasz

mjuhasz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@OmrSi

  1. The first issue, when a selected line is not scrolled into the viewport automatically, is not straightforward to fix.

It can happen when the subtitle grid rows have different height, and we programmatically (e.g. via search) select a row. As you noticed, when the option "Show subtitle text as single line in grid" is disabled, we have variable row heights and then this issue occurs.

This affects all grids with variable heights where we select a row and try to scroll it into view, such as the Find common errors or the OCR windows.

If the grid contains rows of equal height, depending on the direction of search, the first or last visible row will be selected (I may tweak this later - there is something to be said for centering the selection like in typewriter mode to see some context: previous and next rows). Just to prove my point that variable row height is the culprit, here's how the main window works with equal row heights:

Untitled.mov

There are several ways to go about this, but it will require thorough assessment of those options: memory usage, maintenance burden (does the fix survive upgrades, will it be consistent across all grids etc.), usability etc.

Both the author and myself are on the same opinion that this scrolling glitch should be eliminated but we'll need some more time to come up with a viable solution.

  1. I can't replicate your second issue. If you take a video of how you reproduce it, and attach your Settings file (I can help you where to find it - it's easier than telling me all the relevant settings you have), I will look into it. At the very least, besides the video, I will need to know if you have color tags enabled under Settings. If you have the footage just open a Github issue and ping me (@mjuhasz) and I'll take a look. You can open a Github issue by clicking the New Issue button here: https://github.com/SubtitleEdit/subtitleedit/issues

@OmrSi

OmrSi commented Jun 12, 2026

Copy link
Copy Markdown
Member

@mjuhasz Got it. The second issue happens only when this is disabled:
image

Also, two more things to add:

  1. Is it normal that the scrollbar isn't clickable? Like, you can't click on the bar itself, you have to hold the slider and take it up and down, and you can't click the arrows at the top and bottom either, nothing happens.

  2. If you open SE without any file already being open, you get an asterisk in the title, even though nothing was actually changed, and it goes away if you click New.

image

@mjuhasz

mjuhasz commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@OmrSi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants