Skip to content

fix: scroll to correct module when navigating from Quick Access Panel#20306

Merged
TurboGit merged 1 commit intodarktable-org:masterfrom
vtyrtov:fix/quick-access-goto-module
Feb 22, 2026
Merged

fix: scroll to correct module when navigating from Quick Access Panel#20306
TurboGit merged 1 commit intodarktable-org:masterfrom
vtyrtov:fix/quick-access-goto-module

Conversation

@vtyrtov
Copy link
Copy Markdown
Contributor

@vtyrtov vtyrtov commented Feb 9, 2026

When clicking 'go to full version' in the Quick Access Panel, the view would sometimes scroll to a wrong module (though the correct tab was always selected). This happened because dtgtk_expander_set_expanded() was a no-op when the target module was already expanded, leaving stale _last_expanded and _start_pos values from a previous expansion. The _expander_resize callback would then either skip scrolling or scroll to the wrong widget.

Add an 'else if(expanded)' branch that updates scroll tracking even when the expander state hasn't changed. Setting _start_pos.height to 0 ensures _expander_resize detects a size change and triggers scrolling.

Fixes: #19692

@TurboGit
Copy link
Copy Markdown
Member

TurboGit commented Feb 9, 2026

Do you have a reproducer? Seems like it needs some special procedure as not reproducing in all cases.

As we are at it, while testing I found another issue worth fixing at the same time.

  • In Darkroom's preferences allow to expand multiple modules
  • In Darkroom tone group expands multiple modules including exposure.
  • Go to quick access panel, find exposure and click on go to full version button.

See that it moves to tone tab but all modules (except exposure) are collapsed. Seems like this violate the preference. Can you have a look at this? TIA.

@TurboGit TurboGit added this to the 5.6 milestone Feb 9, 2026
@TurboGit TurboGit added bugfix pull request fixing a bug scope: UI user interface and interactions labels Feb 9, 2026
@vtyrtov
Copy link
Copy Markdown
Contributor Author

vtyrtov commented Feb 10, 2026

Yes, reproduces here.
My workflow: Quick Access → presets → then full modules as needed.
This annoyed me since late last year; finally fixing it.
Found it while preparing the PR.

Will check the second issue too.

When clicking 'go to full version...' in the Quick Access Panel (QAP),
the view sometimes scrolled to the wrong module (e.g. the previously
focused one instead of the target).

Root causes and fixes:

1. dtgtk_expander_set_expanded() was a no-op when the expander was
   already in the expanded state. Added an 'else if(expanded)' branch
   that updates _last_expanded and _start_pos, and calls
   gtk_widget_queue_resize() to ensure _expander_resize fires.

2. _expander_resize() checked height_changed before _last_expanded,
   so modules with stale GTK_STATE_FLAG_SELECTED (from previous images)
   could steal the scroll target.  Restructured to check _last_expanded
   first: when set, only that specific widget can trigger scroll, and
   we wait until it has a positive allocated height before proceeding.

3. _basics_goto_module() always passed collapse_others=TRUE, ignoring
   the 'darkroom/ui/single_module' user preference.  Now reads the
   preference and only collapses others when single_module is enabled.

Fixes: darktable-org#19692
@vtyrtov vtyrtov force-pushed the fix/quick-access-goto-module branch from 42bcb1a to 286c3b5 Compare February 16, 2026 07:02
@vtyrtov
Copy link
Copy Markdown
Contributor Author

vtyrtov commented Feb 16, 2026

I've updated the PR to address both issues.

Reproducer for the scroll-to-wrong-module bug:

  1. Open an image in darkroom, work with a module (e.g. exposure) — this gives it focus and GTK_STATE_FLAG_SELECTED.
  2. Switch to another image.
  3. In the Quick Access Panel, click "go to full version..." for a different module (e.g. filmic rgb or color balance rgb).
  4. Observe that the view scrolls to the previously focused module (exposure) instead of the target.

The root cause is twofold:

  • dtgtk_expander_set_expanded() was a no-op when the target module was already expanded, leaving stale scroll tracking data (_last_expanded, _start_pos).
  • _expander_resize() checked height_changed before _last_expanded, so modules with stale GTK_STATE_FLAG_SELECTED (left over from previous images) could steal the scroll target.

Preference violation fix:

Good catch — _basics_goto_module() was hardcoding collapse_others=TRUE, ignoring the darkroom/ui/single_module preference. Fixed to read the preference and only collapse others when single-module mode is enabled.

Testing note:

I've tested the scenarios above and they are resolved, but the interaction between async tab switching (g_main_context_invoke), GTK state flags, and scroll targeting is fairly complex. There may be additional edge cases I haven't covered — any extra testing would be appreciated, especially around:

  • Switching between images with different active modules, then using QAP
  • Using QAP right after darktable startup (before any module has been focused)
  • Modules that appear in multiple group tabs

If you find a scenario that still misbehaves, please let me know and I'll investigate.

Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with different scenario, working on my side now. Thanks!

@TurboGit TurboGit merged commit c30ddea into darktable-org:master Feb 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unreliable "go to full version..." buttons

2 participants