Skip to content

Conversation

@xvaara
Copy link
Contributor

@xvaara xvaara commented Aug 1, 2025

Describe the PR

closes #2783

A clear and concise description of what the pull request does.

Small replication

A small replication or video walkthrough can help demonstrate the changes made. This is optional, but can help observe the intended changes. A mentioned issue that contains a replication also works.

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix 🐛 - fix(...)
  • Feature - feat(...)
  • ARIA accessibility - fix(...)
  • Documentation update - docs(...)
  • Other (please describe)

The PR fulfills these requirements:

  • Pull request title and all commits follow the Conventional Commits convention or has an override in this pull request body This is very important, as the CHANGELOG is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be denied

Summary by CodeRabbit

  • New Features

    • Popover and tooltip components now support individually configurable trigger options for click, focus, and hover events.
    • Manual control added for popover visibility, allowing users to disable automatic triggers.
  • Documentation

    • Expanded and clarified documentation on trigger customization for popovers, including detailed trigger logic and manual mode.
    • Added explanation of the interactive prop for tooltips.
  • Tests

    • Enhanced test coverage for popover trigger behaviors, including combinations and manual mode.
  • Style

    • Updated popover demo layout for improved clarity and demonstration of trigger options.

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 1, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Caution

Review failed

The pull request is closed.

Walkthrough

This change refactors the popover trigger system to allow independent control over click, focus, and hover triggers via separate boolean props. It updates component logic, types, documentation, and tests to support and demonstrate this granular trigger configuration. The tooltip component and related documentation are also adjusted for consistency.

Changes

Cohort / File(s) Change Summary
Popover Trigger Props & Logic
packages/bootstrap-vue-next/src/components/BPopover/BPopover.vue, packages/bootstrap-vue-next/src/types/ComponentProps.ts, apps/docs/src/data/components/popover.data.ts
Introduced separate click, focus, and hover boolean props (default undefined) for trigger configuration; updated logic to compute active triggers; updated types and prop documentation.
Popover Demo & Documentation
apps/docs/src/docs/components/demo/PopoverTriggers.vue, apps/docs/src/docs/components/popover.md
Expanded demo to show all trigger combinations and manual control; updated documentation to explain new trigger logic, priorities, and backward compatibility.
Popover Tests
packages/bootstrap-vue-next/src/components/BPopover/popover.spec.ts
Added and expanded tests to cover all trigger combinations, backward compatibility, disabling triggers, and manual mode.
Tooltip Consistency
packages/bootstrap-vue-next/src/components/BTooltip/BTooltip.vue, apps/docs/src/docs/components/tooltip.md
Added focus and hover props to tooltip for API consistency; updated documentation to explain the interactive prop.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TargetElement
    participant BPopover

    User->>TargetElement: Interacts (click, focus, hover)
    TargetElement->>BPopover: Event triggered (if enabled)
    alt Manual mode
        BPopover-->>User: No automatic show/hide
    else Triggers enabled
        alt Click enabled
            BPopover-->>User: Show/hide on click
        end
        alt Hover enabled
            BPopover-->>User: Show/hide on hover
        end
        alt Focus enabled
            BPopover-->>User: Show/hide on focus
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Assessment against linked issues

Objective Addressed Explanation
Allow independent control over BPopover triggers via click, focus, and hover props (#2783)
Update documentation and demos to reflect new trigger configuration and usage (#2783)
Add/expand tests to cover all trigger combinations and backward compatibility (#2783)
Add trigger-related prop consistency to BTooltip component (#2783)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of interactive prop documentation for BTooltip (apps/docs/src/docs/components/tooltip.md) This change documents an existing prop and is tangentially related but not required by #2783.

Suggested reviewers

  • dwgray

Poem

A popover hops with triggers three—
Click, focus, hover, all set free!
The docs now tell the tale anew,
And demos show what each can do.
With tests in place and types aligned,
This rabbit’s work is well-designed!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bad1cb and 63c4c07.

📒 Files selected for processing (1)
  • apps/docs/src/docs/components/popover.md (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 1, 2025

bsvn-vite-ts

npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next@2795
npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next/@bootstrap-vue-next/nuxt@2795

commit: 63c4c07

@xvaara xvaara requested review from Copilot and dwgray August 1, 2025 10:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds explicit control over individual popover triggers by introducing new focus and hover boolean props to complement the existing click prop. This provides fine-grained control over how popovers are triggered while maintaining backward compatibility.

  • Introduces dedicated focus and hover props for explicit trigger control
  • Updates trigger logic with priority system: manual mode > explicit props > click compatibility > default behavior
  • Enhances documentation and demos to showcase the new trigger options

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/bootstrap-vue-next/src/types/ComponentProps.ts Adds focus and hover props to BPopoverProps interface
packages/bootstrap-vue-next/src/components/BTooltip/BTooltip.vue Adds defaults for new trigger props in tooltip component
packages/bootstrap-vue-next/src/components/BPopover/popover.spec.ts Comprehensive test coverage for new trigger behaviors and combinations
packages/bootstrap-vue-next/src/components/BPopover/BPopover.vue Core implementation of new trigger logic with computed configuration
apps/docs/src/docs/components/tooltip.md Minor formatting improvement in tooltip documentation
apps/docs/src/docs/components/popover.md Expanded documentation explaining new trigger system and logic
apps/docs/src/docs/components/demo/PopoverTriggers.vue Enhanced demo showcasing all trigger combinations
apps/docs/src/data/components/popover.data.ts Updated prop documentation for new trigger props

dwgray
dwgray previously approved these changes Aug 1, 2025
Copy link
Member

@dwgray dwgray left a comment

Choose a reason for hiding this comment

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

Yes - I like this solution. It's a good compromise between exposing the full functionality for corner cases and keeping the simple cases simple. I'll handle updates to the tooltip docs when I merge #2762 in (which is waiting on #2741).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/docs/src/docs/components/popover.md (2)

60-65: Use canonical Vue Boolean-prop syntax in examples

In Vue, a Boolean prop is considered true when the attribute is present (e.g. <BPopover click>).
Writing click="true" works, but it’s not idiomatic and can mislead users into quoting every Boolean.
Recommend updating the examples to the canonical form or to :click="true" when dynamic.

- - **Click only**: Set `click="true"`
- - **Hover only**: Set `hover="true"`
- - **Focus only**: Set `focus="true"`
- - **Multiple triggers**: Combine triggers like `click="true"` `hover="true"` `focus="true"`
+ - **Click only**: Add the `click` prop (`<BPopover click>`)
+ - **Hover only**: Add the `hover` prop (`<BPopover hover>`)
+ - **Focus only**: Add the `focus` prop (`<BPopover focus>`)
+ - **Multiple triggers**: Combine props, e.g. `<BPopover click hover focus>`

69-76: Clarify “explicit configuration” wording

The current wording could be read as if setting either hover or focus suppresses the other by default, but the actual logic treats each prop independently (undefined → default, true/false → explicit). Consider making the sentence explicit, e.g.:

“Props that are explicitly set (true or false) override their respective defaults, while those left undefined fall through to the next rule.”

This prevents confusion for users trying to disable one trigger but keep the other default.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 704effe and 254242f.

📒 Files selected for processing (1)
  • apps/docs/src/docs/components/popover.md (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#2425
File: packages/bootstrap-vue-next/src/plugins/popoverController/index.ts:138-140
Timestamp: 2025-04-28T22:48:46.738Z
Learning: In bootstrap-vue-next, `PopoverOrchestratorParam` includes an `id` field of type `ControllerKey` through inheritance from base types. This field is declared in the `BvControllerOptions` interface and propagated through the type hierarchy.
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2762
File: apps/docs/src/docs/components/tooltip.md:0-0
Timestamp: 2025-06-26T19:46:19.333Z
Learning: BTooltip is a very thin wrapper around BPopover in bootstrap-vue-next. There is no separate `useTooltipController` composable - the `usePopoverController` composable can be used to programmatically control both popovers and tooltips.
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2701
File: apps/docs/src/docs/migration-guide.md:630-632
Timestamp: 2025-05-23T23:58:07.165Z
Learning: The `<NotYetImplemented/>` component in the bootstrap-vue-next documentation automatically renders text indicating "Not Yet Implemented", so additional explanatory text about features not being implemented is redundant when this component is used.
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#2701
File: apps/docs/src/docs/migration-guide.md:622-626
Timestamp: 2025-06-05T11:43:10.793Z
Learning: In migration guides, links to the old/previous version's documentation (like bootstrap-vue.org) are appropriate and helpful when explaining deprecated features, as they provide users with reference points for what they're migrating from.
📚 Learning: btooltip is a very thin wrapper around bpopover in bootstrap-vue-next. there is no separate `usetool...
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2762
File: apps/docs/src/docs/components/tooltip.md:0-0
Timestamp: 2025-06-26T19:46:19.333Z
Learning: BTooltip is a very thin wrapper around BPopover in bootstrap-vue-next. There is no separate `useTooltipController` composable - the `usePopoverController` composable can be used to programmatically control both popovers and tooltips.

Applied to files:

  • apps/docs/src/docs/components/popover.md
📚 Learning: in bootstrap-vue-next, `popoverorchestratorparam` includes an `id` field of type `controllerkey` thr...
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#2425
File: packages/bootstrap-vue-next/src/plugins/popoverController/index.ts:138-140
Timestamp: 2025-04-28T22:48:46.738Z
Learning: In bootstrap-vue-next, `PopoverOrchestratorParam` includes an `id` field of type `ControllerKey` through inheritance from base types. This field is declared in the `BvControllerOptions` interface and propagated through the type hierarchy.

Applied to files:

  • apps/docs/src/docs/components/popover.md
🪛 markdownlint-cli2 (0.17.2)
apps/docs/src/docs/components/popover.md

78-78: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
apps/docs/src/docs/components/popover.md (1)

77-79: Remove the double blank line to satisfy markdown-lint (MD012)

There are two consecutive blank lines after the ordered list which triggers MD012.

-4. **Default behavior**: Both hover and focus triggers are active
-
-
+4. **Default behavior**: Both hover and focus triggers are active

dwgray
dwgray previously approved these changes Aug 4, 2025
@xvaara xvaara merged commit c50e0ef into bootstrap-vue-next:main Aug 4, 2025
4 of 5 checks passed
@xvaara xvaara deleted the popover-triggers branch August 4, 2025 17:29
@github-actions github-actions bot mentioned this pull request Aug 4, 2025
xvaara added a commit that referenced this pull request Aug 19, 2025
…keover

* upstream/main: (21 commits)
  feat(b-form-rating): add `icon-clear` slot (#2809)
  docs: fix dead links, enable rule (#2808)
  chore: release main (#2801)
  docs: Fix navbar collapse behavior (#2802)
  docs: fix code tabs on getting started and icons pages (#2805)
  docs: fix missing data and use a stronger schema to catch missing errors (#2806)
  feat(BPopover): add explicit props for focus and hover triggers (#2795)
  fix(BNavbar): changed autoClose to noAutoClose and fix the documention mistake about it.
  fix: ssr in scrollspy
  docs: clean up css selector
  docs: fix on-this-page when examples use header tags
  docs(migration): add component aliases guidelines (#2771)
  chore: upgrade dependencies and address all lint warnings (#2785)
  chore: release main (#2769)
  fix(BDropdown): prevent hydration warning in nuxt production mode (#2768)
  docs(BTabs): Updates based on v-model changes (#2760)
  docs(table): fix missing anchor in `BTableLite` and `BTableSimple` links (#2759)
  docs(BFormRating): Parity pass (#2749)
  docs: fix typo in breadcrumb documentation (#2756)
  docs: Fix empty-text and empty-filtered-text description as they require show-empty to be set (#2755)
  ...
@coderabbitai coderabbitai bot mentioned this pull request Aug 19, 2025
6 tasks
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.

BPopover: allow better control over triggers

2 participants