Skip to content

feat(combobox-with-popover, combobox-multi-select): DLT-3395 forward dialogClass to popover dialog - #1254

Merged
Josh Everhart (jeverhart-dialpad) merged 5 commits into
stagingfrom
DLT-3395-combobox-dialog-class
May 7, 2026
Merged

feat(combobox-with-popover, combobox-multi-select): DLT-3395 forward dialogClass to popover dialog#1254
Josh Everhart (jeverhart-dialpad) merged 5 commits into
stagingfrom
DLT-3395-combobox-dialog-class

Conversation

@jeverhart-dialpad

@jeverhart-dialpad Josh Everhart (jeverhart-dialpad) commented May 5, 2026

Copy link
Copy Markdown
Contributor

feat(combobox-with-popover, combobox-multi-select): DLT-3395 forward dialogClass to popover dialog

Obligatory GIF (super important!)

Obligatory GIF

🛠️ Type Of Change

These types will increment the version number on release:

  • Fix
  • Feature
  • Performance Improvement
  • Refactor

These types will not increment the version number, but will still deploy to documentation site on release:

  • Documentation
  • Build system
  • CI
  • Style (code style changes, not css changes)
  • Test
  • Other (chore)

📖 Jira Ticket

https://dialpad.atlassian.net/browse/DLT-3395

📖 Description

Adds a dialogClass prop to DtComboboxWithPopover and DtComboboxMultiSelect. The prop forwards through to the underlying <dt-popover>'s existing dialogClass, which lands on the d-popover__dialog element.

Forwarding chain: DtComboboxMultiSelect → DtComboboxWithPopover → DtPopover → d-popover__dialog.

Matches the established forwarding pattern used by DtHovercard, DtModal, and DtBanner. Tested locally on the docs site and also via storybook (https://dialtone.dialpad.com/vue/deploy-previews/pr-1254/?path=/story/components-combobox-multi-select--default&args=dialogClass:test-class).

Usage:

<dt-combobox-with-popover dialog-class="my-flavor">...</dt-combobox-with-popover>

.my-flavor .d-popover__header { min-height: 0; }

💡 Context

DtPopover already exposes a dialogClass prop (popover.vue:58), but neither combobox component forwarded it to consumers. This blocked any CSS customization scoped to a specific combobox usage — including overriding intrinsic styles like min-height on the popover header.

The dialogClass + descendant selector approach was chosen over per-element wrapper-class props (e.g. a separate headerWrapperClass) because it provides broader reach with a smaller API surface, and matches the convention already used elsewhere in Dialtone.

📝 Checklist

For all PRs:

  • I have ensured no private Dialpad links or info are in the code or pull request description (Dialtone is a public repo!).
  • I have reviewed my changes.
  • I have added all relevant documentation.
  • I have considered the performance impact of my change.

For all Vue changes:

  • I have added / updated unit tests.
  • I have validated components with a screen reader.
  • I have validated components keyboard navigation.

🔮 Next Steps

📷 Screenshots / GIFs

Context of where this may be useful: aligning tabs in the header of a combobox popover:
587377937-593add6d-dff6-4867-a5cc-1d2814677f9b

🔗 Sources

@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 3488880f-661f-481e-a093-66d80c186ab1

📥 Commits

Reviewing files that changed from the base of the PR and between 39454f4 and 21dbcb9.

📒 Files selected for processing (2)
  • packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.test.js
  • packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.test.js

Adds a dialogClass prop to DtComboboxWithPopover and DtComboboxMultiSelect, forwarding it to DtPopover for scoped styling; includes Storybook argTypes updates and unit tests.

Overall Judgement: ✅ Ready to merge

Rationale: Small, backward-compatible API addition with tests and docs that follows existing component patterns.

Walkthrough

Adds a new dialogClass prop to DtComboboxWithPopover and DtComboboxMultiSelect, forwards it through story templates, exposes it in Storybook argTypes, and adds tests asserting the teleported popover element receives the provided class. (≈36 words)

Changes

Dialog Class Customization

Layer / File(s) Summary
Core Prop Definition
packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.vue
Adds public prop dialogClass (type [String, Array, Object], default '') and binds it into the internal DtPopover via :dialog-class="dialogClass".
Component Hierarchy Integration
packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.vue
Adds dialogClass prop to DtComboboxMultiSelect and forwards it to DtComboboxWithPopover with :dialog-class="dialogClass".
Story Template Updates
packages/dialtone-vue/components/combobox_with_popover/..._default.story.vue, packages/dialtone-vue/components/combobox_multi_select/..._default.story.vue
Default story templates forward $attrs.dialogClass into components using :dialog-class="$attrs.dialogClass".
Storybook Controls
packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.stories.js, packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.stories.js
Adds dialogClass entry to argTypesData with description and control.type = 'text'.
Tests
packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.test.js, packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.test.js
New tests mount components with dialogClass: 'custom-dialog-class', open the popover, query teleported [data-qa="dt-popover"] from document.body, and assert the dialog element contains the provided class.
sequenceDiagram
    participant Consumer
    participant DtComboboxMultiSelect
    participant DtComboboxWithPopover
    participant DtPopoverDialog as DtPopover(dialog)
    Consumer->>DtComboboxMultiSelect: pass prop dialogClass="custom-dialog-class"
    DtComboboxMultiSelect->>DtComboboxWithPopover: forward :dialog-class="dialogClass"
    DtComboboxWithPopover->>DtPopoverDialog: bind :dialog-class="dialogClass"
    DtPopoverDialog-->>document.body: teleport dialog element with class "custom-dialog-class"
Loading

Suggested reviewers:

  • francisrupert
  • iropolo
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DLT-3395-combobox-dialog-class

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.test.js`:
- Around line 376-379: The test currently finds the popover dialog via the
internal ref ('content') on DtPopover
(wrapper.findComponent(DtPopover).findComponent({ ref: 'content' })) which
couples the spec to implementation; change the test to target a stable data-qa
attribute on the popover dialog instead (e.g., find the element with
[data-qa="combobox-popover"] under DtPopover) and assert that element exists and
has the 'custom-dialog-class'; if the dialog element in the component doesn’t
yet expose a data-qa attribute, add one there (on the popover/dialog root) so
tests can select it reliably.
- Around line 369-373: The beforeEach is remounting a new wrapper via
_setWrappers() without unmounting any previously mounted wrapper, which can
leave stale DOM; fix by ensuring any existing wrapper is unmounted before
remounting — either call wrapper.unmount() (or wrapper.destroy()) at the start
of this beforeEach or add/ensure an afterEach that unmounts the wrapper;
reference the _setWrappers function and the wrapper/input variables so the
teardown runs before creating a new instance.

In
`@packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.test.js`:
- Around line 560-563: Replace the brittle ref-based traversal that looks up the
popover content via findComponent(DtPopover).findComponent({ ref: 'content' })
with a data-qa selector lookup (e.g.
findComponent(DtPopover).find('[data-qa="combobox-popover-content"]') or
wrapper.find('[data-qa="combobox-popover-content"]')); assert existence and
classes against that element and ensure the popover renders the matching data-qa
attribute in the template so the test follows the repository's data-qa selector
convention.
- Around line 554-557: The nested beforeEach is mounting a new component on top
of an existing one; call wrapper?.unmount() (or wrapper.destroy()/await
wrapper.unmount() depending on your test utils) before invoking _mountWrapper()
so the previous instance is properly torn down; update the block around
_mountWrapper and _openComboboxPopover to unmount the existing wrapper variable
first to avoid stacked instances.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: f1692322-d0cf-452d-8347-28a0f1af13fa

📥 Commits

Reviewing files that changed from the base of the PR and between 8a852e8 and 03fb18f.

📒 Files selected for processing (8)
  • packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.stories.js
  • packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.test.js
  • packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.vue
  • packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select_default.story.vue
  • packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.stories.js
  • packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.test.js
  • packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.vue
  • packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover_default.story.vue

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.test.js`:
- Around line 375-380: The test "should apply the class to the popover dialog
element" contains two assertions; split it into two separate tests so each
assertion stands alone: one test that queries
document.body.querySelector('[data-qa="dt-popover"]') and asserts the dialog is
not null, and a second test that queries the same selector and asserts
dialog.classList.contains('custom-dialog-class') is true; update the spec names
to reflect each behavior (e.g., "renders the popover dialog" and "applies the
custom dialog class") and keep the same selector and test setup used in the
original it block.

In
`@packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.test.js`:
- Around line 560-566: The test "should apply the class to the popover dialog
element" contains two assertions; split it into two separate it blocks so each
test has a single assertion: one test should query document.body for
'[data-qa="dt-popover"]' and assert the dialog is not null, and a second test
(with a clear name like "applies custom dialog class") should assert
dialog.classList.contains('custom-dialog-class') === true; update the existing
it block into two it(...) calls and reuse the same query logic to locate the
popover element.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: fe903ddb-9593-44b3-807f-2c4eb566faee

📥 Commits

Reviewing files that changed from the base of the PR and between 03fb18f and 39454f4.

📒 Files selected for processing (2)
  • packages/dialtone-vue/components/combobox_multi_select/combobox_multi_select.test.js
  • packages/dialtone-vue/components/combobox_with_popover/combobox_with_popover.test.js

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Please add either the visual-test-ready or no-visual-test label to this PR depending on whether you want to run visual tests or not.
It is recommended to run visual tests if your PR changes any UI. ‼️

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

✔️ Deploy previews ready!
😎 Dialtone documentation preview: https://dialtone.dialpad.com/deploy-previews/pr-1254/
😎 Dialtone-vue preview: https://dialtone.dialpad.com/vue/deploy-previews/pr-1254/

@braddialpad Brad Paugh (braddialpad) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks

@jeverhart-dialpad Josh Everhart (jeverhart-dialpad) added the no-visual-test Add this tag when the PR does not need visual testing label May 6, 2026
@jeverhart-dialpad
Josh Everhart (jeverhart-dialpad) merged commit 0059451 into staging May 7, 2026
27 checks passed
@jeverhart-dialpad
Josh Everhart (jeverhart-dialpad) deleted the DLT-3395-combobox-dialog-class branch May 7, 2026 16:50
Brad Paugh (braddialpad) pushed a commit that referenced this pull request May 12, 2026
# [3.220.0](dialtone-vue/v3.219.4...dialtone-vue/v3.220.0) (2026-05-12)

### Features

* **Combobox With Popover, Combobox Multi Select:** DLT-3395 forward dialogClass to popover dialog ([#1254](#1254)) ([0059451](0059451))
Brad Paugh (braddialpad) pushed a commit that referenced this pull request May 12, 2026
# [9.183.0](dialtone/v9.182.3...dialtone/v9.183.0) (2026-05-12)

### Features

* **Combobox With Popover, Combobox Multi Select:** DLT-3395 forward dialogClass to popover dialog ([#1254](#1254)) ([0059451](0059451))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-visual-test Add this tag when the PR does not need visual testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants