Skip to content

Keep the Select Lines dialog open when no lines match - #680

Open
MawCeron wants to merge 1 commit into
TypesettingTools:masterfrom
MawCeron:fix/dialog-selection-no-results
Open

Keep the Select Lines dialog open when no lines match#680
MawCeron wants to merge 1 commit into
TypesettingTools:masterfrom
MawCeron:fix/dialog-selection-no-results

Conversation

@MawCeron

@MawCeron MawCeron commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • DialogSelection::Process closed the dialog unconditionally on OK, even when the search/action changed nothing (count == 0) — right after showing a message box saying so. That forced the user to reopen the dialog and redo the search from scratch after any typo or unchecked option.
  • Only close the dialog when the selection actually changed; otherwise leave it open so the user can adjust the criteria in place.

(Reopens #679, closed only because the branch's commit needed its authorship fixed — same change, no functional difference.)

Fixes #349

Test plan

  • Read the code path in src/dialog_selection.cpp to confirm count is 0 exactly when the message box reports no lines were set/added/removed, for every Action branch (SET/ADD/SUB/INTERSECT).
  • Manual: built locally (meson/ninja, Linux/GTK3), opened Subtitle > Select Lines..., searched for text that matches nothing, pressed OK — the "Selection was set to no lines" message appears and the dialog now stays open instead of closing.

Pressing OK closed the dialog unconditionally, even when the search
matched nothing (or an add/subtract/intersect changed no lines), right
after a message box told the user so. Only close it when the action
actually changed the selection, so the user can adjust the criteria
without reopening the dialog.

Fixes TypesettingTools#349
@CoffeeFlux

Copy link
Copy Markdown
Member

If you could say more about your workflow on the issue itself that motivated this, that'd be much appreciated. I'm not clear whether this is a change worth making or something else related to this flow needs to be thought through, so more information would be helpful.

@MawCeron

Copy link
Copy Markdown
Author

The main motivation is just improving the day-to-day experience of using "Subtitle > Select Lines...": it's easy to make a typo or leave the wrong field/option selected, get 0 matches back, and have the dialog close itself on you. Having to reopen it from the menu and re-enter everything from scratch (text, field, mode, case sensitivity) every time that happens gets frustrating and annoying pretty fast, especially if you're iterating on a search.

The linked issue (#349) describes this exact case and is what led me to it, but I'd frame it as UX polish rather than a fix for a specific broken behavior.

The change is scoped narrowly: DialogSelection::Process only closes on OK when the action actually changed the selection (count != 0); if the search/action didn't change anything, the dialog now stays open so you can adjust and retry in place. Cancel and Esc still close it immediately as before, and a search that does match still closes on OK exactly like today.

@CoffeeFlux

Copy link
Copy Markdown
Member

Hi @MawCeron please reply to these threads yourself rather than having an agent do it. I'm not very interested in reading an agent's made-up description of a workflow.

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.

Enhancement: Keep the Line Selection Window Open When No Results Are Found

2 participants