Skip to content

Replace BDropdown family with custom GDropdown components - #21961

Open
dannon wants to merge 11 commits into
galaxyproject:devfrom
dannon:feature/g-dropdown
Open

Replace BDropdown family with custom GDropdown components#21961
dannon wants to merge 11 commits into
galaxyproject:devfrom
dannon:feature/g-dropdown

Conversation

@dannon

@dannon dannon commented Mar 1, 2026

Copy link
Copy Markdown
Member

Part of the bootstrap-vue scoped-slot replacement effort tracked in #21956.

BDropdown uses scoped slots and crashes under @vue/compat. Replaces the full BDropdown family with 7 custom components: GDropdown, GDropdownItem, GDropdownItemButton, GDropdownDivider, GDropdownText, GDropdownGroup, and GDropdownForm. Uses Bootstrap 4 CSS classes for menu positioning and native DOM listeners for click-outside/escape-to-close behavior. Provides a g-dropdown-hide injection so child items can close the parent menu on click.

Migrates 27 files. BNavItemDropdown in MastheadDropdown is kept as-is since it requires nav-specific markup, but the child items use GDropdownItem with the hide injection bridged through.

@itisAliRH itisAliRH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good overall, thank you @dannon!

I noticed a couple of issues:

  • Items that are links don’t show a pointer cursor (like in HistoryOptions)
  • When clicking on link items, the dropdown stays open. It only closes for non-link items.
  • Target's Tooltip remains visible after opening the dropdown and ends up blocking other content (This might be a more general tooltip issue rather than something introduced in this PR).
21961.-.1.mov

@dannon
dannon force-pushed the feature/g-dropdown branch 2 times, most recently from 0d2ef9f to a066dcc Compare March 31, 2026 02:14
@mvdbeek
mvdbeek requested a review from itisAliRH March 31, 2026 14:50
@mvdbeek

mvdbeek commented Apr 7, 2026

Copy link
Copy Markdown
Member

Needs a rebase too

@mvdbeek
mvdbeek marked this pull request as draft April 7, 2026 12:28
@mvdbeek mvdbeek moved this from Needs Review to In Progress in Galaxy Dev - weeklies Apr 7, 2026
@mvdbeek mvdbeek modified the milestones: 26.1, 26.2 May 19, 2026
@dannon
dannon force-pushed the feature/g-dropdown branch from a066dcc to 0dc41b6 Compare May 25, 2026 20:15
@dannon
dannon force-pushed the feature/g-dropdown branch from 0dc41b6 to 7c992a7 Compare June 1, 2026 21:16
@dannon
dannon force-pushed the feature/g-dropdown branch 2 times, most recently from 097547c to 45c58ec Compare July 31, 2026 03:07
@dannon
dannon force-pushed the feature/g-dropdown branch from 45c58ec to ef2045a Compare August 15, 2026 01:07
@dannon
dannon marked this pull request as ready for review August 19, 2026 19:01
dannon added 6 commits August 26, 2026 13:29
Created 7 new components (GDropdown, GDropdownItem, GDropdownDivider,
GDropdownText, GDropdownGroup, GDropdownForm, GDropdownItemButton) that
use Bootstrap 4 CSS classes directly with native DOM click-outside
handling and provide/inject for menu auto-close. Migrated all 27 files
that imported from bootstrap-vue's dropdown family.
Update HistoryOptions to use findAllComponents(GDropdownItem) with
props() checks instead of CSS stub selectors. Update VisualizationExamples
to import GDropdown/GDropdownItem instead of BDropdown/BDropdownItem and
click button instead of anchor. Add router-link stub to MultipleView test.
Update ToolTourGeneratorItem to check disabled attribute instead of
aria-disabled since GDropdownItem uses native button disabled.
GDropdown menu div wasn't handling Escape key events, so send_escape()
in Selenium tests had no effect. Added @keydown.esc="hide" to close
on Escape, matching BDropdown behavior.

VisualizationExamples test was clicking button inside GDropdownItem, but
GDropdownItem now renders as <a> (like BDropdownItem). Updated selectors.
Split GDropdownItem's dynamic <component :is> into separate <router-link>
and <a> elements so the click handler reliably fires for both -- the
dynamic component pattern didn't propagate native click events for
router-link items in Vue 2 compat mode, so hideDropdown() never ran.
Also adds explicit cursor: pointer on .dropdown-item for both item types.
dannon added 5 commits August 26, 2026 13:29
…dDropdown close

Remove noFlip, boundary, and offset props from GDropdown since they were
accepted but never implemented (no Popper.js backing). Remove the corresponding
caller-side attributes. Add aria-disabled to GDropdownItem for screen reader
support. Add headerClasses prop to GDropdownGroup so ToolsListSectionFilters
styling works. Fix MastheadDropdown by providing g-dropdown-hide so GDropdownItem
clicks properly close the BNavItemDropdown. Fix ToolTourGeneratorItem test to
check aria-disabled instead of the disabled DOM attribute. Remove dead onMounted
hook and unused import.
CompositeSlotRow was added on dev after the branch was cut -- swap it
to the GDropdown family along with the rest of the sweep. Import order
fixups in FilterMenuDropdown and Workflow Editor are linter changes.
Dev extracted the select-preference dropdown out of FormSelection.vue into
its own component after this branch forked, so it landed with BDropdown still
in place. Same swap as the rest of the sweep.
The click handler cancelled navigation for anything without a :to, which also
killed target="_blank" -- so external-link items in GCard never opened their
tab. That's what test_workflow_management.py::test_view was tripping over.

Only cancel when the href is "#", explicit or defaulted, which is what BLink
did underneath BDropdownItem. FilterMenuDropdown passes href="#" directly and
still needs the page not to jump, hence checking the value rather than just
its presence.
GDropdownForm declared no props at all, so NodeInspector's form-class="px-2"
was silently dropped and the form kept the hardcoded px-4 py-3 -- much roomier
than BDropdownForm rendered it (0.25rem/1.5rem base with px-2 overriding the
horizontal padding).

Made the padding a prop default the caller replaces instead of layering onto,
since two competing bootstrap spacing utilities are resolved by stylesheet
order, not by which one the caller passed -- px-4 would have beaten px-2.
@dannon
dannon force-pushed the feature/g-dropdown branch from ef2045a to c2432f9 Compare August 26, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants