https://bugs.kde.org/show_bug.cgi?id=520365

            Bug ID: 520365
           Summary: Quick Commands plugin: persist category
                    expand/collapse state across sessions
    Classification: Applications
           Product: konsole
      Version First 26.04.1
       Reported In:
          Platform: CachyOS
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: plugins
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 192429
  --> https://bugs.kde.org/attachment.cgi?id=192429&action=edit
Image of Quick Commands-Groups collapsed before close and expanded again on new
window relaunch

DESCRIPTION
The Quick Commands plugin displays user-defined commands in a QTreeView grouped
by category. On each Konsole launch, all categories are shown fully expanded,
regardless of which categories the user had collapsed in the previous session.
There is currently no way to persist the expand/collapse state of the tree.
For users with many categories or many commands per category, this results in a
long scrolling list at every session start, requiring manual collapse of
unwanted categories on each launch.

STEPS TO REPRODUCE
1. Open Konsole with the Quick Commands plugin enabled and the dock panel
visible.
2. Configure several Quick Commands across multiple categories (e.g., via the
GUI or by editing ~/.local/share/konsole/konsolequickcommandsconfig directly).
3. In the Quick Commands panel, collapse one or more category nodes by clicking
their disclosure arrows.
4. Close Konsole.
5. Open Konsole again.

OBSERVED RESULT
All category nodes are shown expanded, regardless of which were collapsed in
the previous session. The collapse state from step 3 is discarded.

EXPECTED RESULT
The expand/collapse state of each category node is preserved across Konsole
sessions, matching the state the user left when Konsole was last closed.

SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window): CachyOS Linux
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.26.0
Qt Version: 6.11.1

ADDITIONAL INFORMATION
KDE Frameworks already provides KViewStateSaver in KItemModels, designed for
exactly this use case (persisting expand/selection/scroll state of QTreeView
widgets to KConfig). The Quick Commands widget
(src/plugins/QuickCommands/quickcommandswidget.cpp) could use this class to
serialize tree state to konsolerc on dock close and restore it on dock
construction.

A simple alternative would be to call QTreeView::collapse() on each category
index whose name is stored in a "CollapsedCategories" key in konsolerc's
[QuickCommands] group at widget initialization, and connect to the
collapsed()/expanded() signals to update that list.

The Quick Commands plugin offers an alternative invocation path via the
KCommandBar shortcut (Ctrl+Alt+G by default), which is unaffected by this
issue. However, users who prefer the tree-based dock panel for browsing and
editing — particularly those with extensive command libraries organized into
many categories — are forced to manually re-collapse categories on every
Konsole launch.

A related, lower-priority enhancement would be a single "Collapse All" context
menu action on the tree, which currently must be done one category at a time.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to