Skip to content

fix(dialtone-vue): DP-203134 hide empty message paragraph in DtNoticeContent - #1390

Merged
Belu Montoya (belumontoya) merged 1 commit into
nextfrom
DP-203134-guard-empty-notice-message
Aug 13, 2026
Merged

fix(dialtone-vue): DP-203134 hide empty message paragraph in DtNoticeContent#1390
Belu Montoya (belumontoya) merged 1 commit into
nextfrom
DP-203134-guard-empty-notice-message

Conversation

@belumontoya

Copy link
Copy Markdown
Contributor

Context

JIRA Link: https://dialpad.atlassian.net/browse/DP-203134

The close icon in a title-only DtNotice/DtToast/DtBanner (e.g. the "Copied to clipboard" toast) is misaligned relative to the title text.

Root cause

DtNoticeContent always renders its message <dt-text> element, even when no default-slot content is provided. The header element is already guarded with v-if="headerText || hasSlotContent(\$slots.header)", but the message element has no equivalent guard. A title-only notice ends up with an empty <p class="d-notice__message">, which still takes up line-height and throws off vertical centering against the close icon.

This is shared by every consumer of DtNoticeContent: DtNotice, both DtToast layouts (default and alternate), and DtBanner.

Fix

Guard the message element the same way the header already is: v-if="hasSlotContent(\$slots.default)".

Tests

Added a case to NoticeContent.test.js covering the no-message scenario (asserts the message element does not render). Existing tests unaffected — they always pass real slot content.

…Content

DtNoticeContent always rendered the message <dt-text> element even when
no default-slot content was provided, unlike the header element which is
already guarded by hasSlotContent($slots.header). A title-only Notice,
Toast, or Banner (e.g. the 'Copied to clipboard' toast) would render an
empty <p class="d-notice__message"> that still takes up line-height,
throwing off vertical centering against the close icon/button.

Guards the message element the same way the header already is, using the
same hasSlotContent utility. Fixes DtNotice, DtToast (both layouts), and
DtBanner, which all share this component.
@github-actions

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. ‼️

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 35ad9f66-cd1c-445e-aa68-04a1fdb8fbe4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: d16ad2f3-78ff-46af-8098-b890b3b4c793

📥 Commits

Reviewing files that changed from the base of the PR and between 7a4d73a and 7e464bc.

📒 Files selected for processing (2)
  • packages/dialtone-vue/components/Notice/NoticeContent.test.js
  • packages/dialtone-vue/components/Notice/NoticeContent.vue
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • dialpad/ios (manual)
  • dialpad/firespotter (manual)
  • dialpad/semantic-release-changelog-json (auto-detected)
  • dialpad/conventional-changelog-angular (auto-detected)

Updated DtNoticeContent to render the message <dt-text> only when default-slot content exists. Added a test for title-only notices without message content. This prevents empty paragraphs from affecting vertical alignment.

Overall Judgement: ✅ Ready to merge — The change is focused and includes test coverage for the affected behavior.

Walkthrough

DtNoticeContent now omits the main content element when the default slot is empty. A test verifies this behavior.

Changes

Notice content rendering

Layer / File(s) Summary
Conditional content rendering
packages/dialtone-vue/components/Notice/NoticeContent.vue, packages/dialtone-vue/components/Notice/NoticeContent.test.js
The main dt-text element renders only when the default slot contains content. The test verifies that empty slots do not render the element.

Suggested reviewers: francisrupert, iropolo

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DP-203134-guard-empty-notice-message

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

@github-actions

Copy link
Copy Markdown
Contributor

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

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.

oops, yeah. thx.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e464bc061

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

</slot>
</dt-text>
<dt-text
v-if="hasSlotContent($slots.default)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle the forwarded empty toast fallback

When DtToast has only headerText and its message is empty or undefined, Toast.vue and ToastLayoutDefault.vue each forward <slot>{{ message }}</slot>. Vue wraps that empty fallback in Fragment VNodes, and hasSlotContent only examines the top-level vnode, so it treats the nonempty Fragment wrapper as content and this condition still renders the empty message paragraph. The new direct DtNoticeContent test bypasses this forwarding path, leaving the title-only toast scenario described by the change unfixed; cover DtToast itself and either unwrap nested fragments or suppress the empty fallback before it reaches this component.

Useful? React with 👍 / 👎.

</slot>
</dt-text>
<dt-text
v-if="hasSlotContent($slots.default)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the dangling banner description reference

For a title-only DtBanner, this condition now removes the only element carrying contentId, but Banner.vue still unconditionally renders aria-describedby="contentId" on the dialog. Because contentId has a generated default, every banner without message content now exposes an ARIA reference to a nonexistent element; conditionally omit aria-describedby whenever the message element is suppressed.

Useful? React with 👍 / 👎.

@belumontoya
Belu Montoya (belumontoya) merged commit 1e0810c into next Aug 13, 2026
19 checks passed
@belumontoya
Belu Montoya (belumontoya) deleted the DP-203134-guard-empty-notice-message branch August 13, 2026 18:19
Brad Paugh (braddialpad) pushed a commit that referenced this pull request Aug 13, 2026
# [3.225.0-next.2](dialtone-vue/v3.225.0-next.1...dialtone-vue/v3.225.0-next.2) (2026-08-13)

### Bug Fixes

* **Dialtone Vue:** DP-203134 hide empty message paragraph in DtNoticeContent ([#1390](#1390)) ([1e0810c](1e0810c))
* **Mode Island:** NO-JIRA fix tag order on Mode Island story ([#1389](#1389)) ([7a4d73a](7a4d73a))
* **Popover:** NO-JIRA don't hide dialog from assistive tech while it still holds focus on close ([#1392](#1392)) ([f871496](f871496))

### Features

* **Notice, Toast:** NO-JIRA pretty wrap headline ([#1393](#1393)) ([7a36b89](7a36b89))
Brad Paugh (braddialpad) pushed a commit that referenced this pull request Aug 13, 2026
# [10.0.0-next.13](dialtone/v10.0.0-next.12...dialtone/v10.0.0-next.13) (2026-08-13)

### Bug Fixes

* **Dialtone Vue:** DP-203134 hide empty message paragraph in DtNoticeContent ([#1390](#1390)) ([1e0810c](1e0810c))
* **Mode Island:** NO-JIRA fix tag order on Mode Island story ([#1389](#1389)) ([7a4d73a](7a4d73a))
* **Popover:** NO-JIRA don't hide dialog from assistive tech while it still holds focus on close ([#1392](#1392)) ([f871496](f871496))

### Features

* **Icon:** DLT-3570 update `dialbot` and `dialpad-analytics-ai` to squircle ([#1391](#1391)) ([725fd81](725fd81))
* **Notice, Toast:** NO-JIRA pretty wrap headline ([#1393](#1393)) ([7a36b89](7a36b89))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants