SUMMARY Sometimes the Previous/Next Entry and/or First/Last Entry actions just stop working after changing the filtering text. This is because they are disabled after selecting the first or last item in the filtered list, but this state isn't updated when the filtered list changes. The reproduction steps might be easier to understand. STEPS TO REPRODUCE 1. Filter, then select the last filtered item. Notice that "Last Entry" and "Next Entry" is grayed out. 2. Change the filter such that the currently selected item is no longer the last filtered item. 3. Notice that "Last Entry" and "Next Entry" are still grayed out. Using their keyboard shortcuts also don't work, because they are actually disabled. Same thing happens for First Entry / Previous Entry if one selects the first filtered item in the first step. OBSERVED RESULT After selecting the last filtered item, then changing the filter such that it is no longer the last item in the new filtered list, the Next Entry and Last Entry actions remain disabled. After selecting the first filtered item, then changing the filter such that it is no longer the first item in the new filtered list, the First Entry and Previous Entry actions remain disabled. EXPECTED RESULT The First/Previous Entry and Last/Next Entry actions are never disabled when there are still items before/after the current entry. SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 6.4.80 KDE Frameworks Version: 6.18.0 Qt Version: 6.9.1 Kernel Version: 6.11.0-29-generic (64-bit) Graphics Platform: Wayland Lokalize Version: 25.11.70 (commit 004bd46166) ADDITIONAL INFORMATION
Git commit a1fd780b719dbd460d6aef07607808423c89e27c by Kisaragi Hiu. Committed on 29/08/2025 at 10:43. Pushed by moonlight into branch 'master'. Fix changing catalog filter/sort leaving some navigation actions disabled When reaching the first entry in the catalog view (translation units list), the Previous Entry and First Entry actions become disabled. And when navigating to another entry, they become enabled again if the selected entry is not the first entry. But this is not the only way the currently selected entry could stop being the first entry. The other ways are: 1. If the filter text is changed, the currently selected entry would most likely stop being the first entry in the list, but the actions are not updated to reflect that. 2. The filter options could also be updated. 3. The sort method and order could also be updated. 4. dynamicSortFilter could be turned on, then when sorting by msgstr and the msgstr is changed the same could also happen. Before this change, these would all cause the Previous Entry and First Entry actions to remain disabled even though there are now entries before the current one. (The same is also true for the Next Entry and Last Entry actions when reaching the last entry.) Additionally, the actions would also not be disabled properly when there are no entries matching the current filter. --- This commit addresses each of the cases: - (1, 2, 4) Filter text and filter option changing, as well as msgstr changing while dynamicSortFilter is on, are all addressed by connecting CatalogTreeFilterModel::rowsInserted and CatalogTreeFilterModel::rowsRemoved to a new signal, CatalogView::entryProxiedPositionChanged. - Then this signal is hooked up in EditorTab to call a new function, EditorTab::updateFirstOrLastDisplayed, to check and signal to the actions whether to be disabled or enabled. (The existing place where this was previously done in EditorTab::gotoEntry is modified to use this function.) - (3) The sort method and order changing are addressed by emitting the above signal on CatalogTreeFilterModel::layoutChanged. - Disabling the actions when there are no entries matching the current filter is done within the new EditorTab::updateFirstOrLastDisplayed. This should address all cases (as far as I know) where Next Entry / Previous Entry (and First/Last Entry) mysteriously stop working after changing filtering/sort options. M +9 -0 src/cataloglistview/cataloglistview.cpp M +2 -0 src/cataloglistview/cataloglistview.h M +19 -2 src/editortab.cpp M +2 -0 src/editortab.h https://invent.kde.org/sdk/lokalize/-/commit/a1fd780b719dbd460d6aef07607808423c89e27c