-
-
Notifications
You must be signed in to change notification settings - Fork 174
fix(BToggle)! Remove redundant attribute cleanup & update docs for accessibility attributes on show/hide components #2918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
|
Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughAdds a comprehensive ARIA visibility architecture and docs, updates component accessibility docs to reference a centralized ARIA trigger-registration system, adds three demo Vue SFCs, and changes the v-b-toggle unmount cleanup to delegate aria-expanded and visual-class cleanup to the show/hide composable. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Trigger as Trigger Element
participant Directive as v-b-toggle
participant Composable as useShowHide
participant Target as Target Component
User->>Trigger: Click / activation
Trigger->>Directive: v-b-toggle handler runs
Directive->>Composable: registerTrigger(trigger, targetId)
Composable->>Trigger: set `aria-controls`
Composable->>Target: update visibility state (show/hide)
Composable->>Trigger: set `aria-expanded` + visual classes
alt Unmount trigger / directive
Directive->>Composable: unregisterTrigger(clean: true)
Composable->>Trigger: remove `aria-expanded` + visual classes
Directive->>Trigger: remove `aria-controls`
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (13)📚 Learning: 2025-09-12T14:46:49.416ZApplied to files:
📚 Learning: 2025-09-12T14:46:49.416ZApplied to files:
📚 Learning: 2025-09-12T14:46:49.416ZApplied to files:
📚 Learning: 2025-09-30T23:57:21.526ZApplied to files:
📚 Learning: 2025-09-12T14:46:49.416ZApplied to files:
📚 Learning: 2025-09-12T14:46:49.416ZApplied to files:
📚 Learning: 2025-08-19T14:23:46.775ZApplied to files:
📚 Learning: 2025-10-21T19:31:54.113ZApplied to files:
📚 Learning: 2025-09-12T14:46:49.416ZApplied to files:
📚 Learning: 2025-09-12T14:46:49.416ZApplied to files:
📚 Learning: 2025-10-28T03:37:33.172ZApplied to files:
📚 Learning: 2025-10-21T19:26:36.699ZApplied to files:
📚 Learning: 2025-10-21T01:11:59.901ZApplied to files:
⏰ 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)
🔇 Additional comments (3)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/copilot-instructions.md (1)
200-256: Excellent demo file format guidelines.The new Documentation Examples section provides clear, actionable guidance with concrete examples for template-only and script-based demos. The region marker usage and demo reference syntax are well-documented.
Optionally address the markdown linting hints by:
- Wrapping bare localhost URLs in angle brackets or code blocks (lines 29-31, 45, 47)
- Adding a language identifier to the fenced code block at line 60
These are purely stylistic improvements and can be deferred.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
.github/copilot-instructions.md(4 hunks)apps/docs/src/docs/components/alert.md(1 hunks)apps/docs/src/docs/components/collapse.md(1 hunks)apps/docs/src/docs/components/dropdown.md(1 hunks)apps/docs/src/docs/components/modal.md(1 hunks)apps/docs/src/docs/components/offcanvas.md(1 hunks)apps/docs/src/docs/components/popover.md(1 hunks)apps/docs/src/docs/components/toast.md(1 hunks)apps/docs/src/docs/components/tooltip.md(1 hunks)apps/docs/src/docs/directives/BToggle.md(1 hunks)apps/docs/src/docs/reference/accessibility.md(1 hunks)apps/docs/src/docs/reference/demo/AriaRegistrationDirective.vue(1 hunks)apps/docs/src/docs/reference/demo/AriaRegistrationManual.vue(1 hunks)apps/docs/src/docs/reference/demo/AriaRegistrationProgrammatic.vue(1 hunks)architecture/ARIA_VISIBILITY.md(1 hunks)packages/bootstrap-vue-next/src/directives/BToggle/index.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (23)
📓 Common learnings
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2762
File: apps/docs/src/docs/components/tooltip.md:90-94
Timestamp: 2025-08-19T23:30:07.062Z
Learning: In bootstrap-vue-next docs, tooltip.data.ts uses popoverSharedProps('popover') to define props, which includes the 'manual' prop through the shared props structure from popover-shared.ts. The manual prop is available in BTooltip documentation through this prop spreading/inheritance mechanism.
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2762
File: apps/docs/src/docs/components/tooltip.md:90-94
Timestamp: 2025-08-19T23:30:07.062Z
Learning: In bootstrap-vue-next docs, tooltip.data.ts uses popoverSharedProps('tooltip') to define props, which includes the 'manual' prop through the shared props structure from popover-shared.ts. The manual prop is available in BTooltip documentation through this inheritance mechanism.
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2866
File: apps/docs/src/docs/components/demo/ModalModel.vue:11-15
Timestamp: 2025-09-30T23:57:21.526Z
Learning: The bootstrap-vue-next documentation project uses unplugin-vue-components to automatically resolve and import Vue components like BModal, BButton, etc. Explicit imports for these components in script sections are not required.
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/App.vue : Use packages/bootstrap-vue-next/src/App.vue as a local test area for component changes
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2882
File: apps/docs/src/docs/components/demo/PlaceholderWidth.vue:1-22
Timestamp: 2025-10-21T19:31:54.113Z
Learning: The bootstrap-vue-next project uses unplugin to automatically import components, so explicit imports in demo/documentation components are not needed.
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 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
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2716
File: packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue:240-261
Timestamp: 2025-05-28T07:01:55.095Z
Learning: In BTabs component (packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue), the complex initialization logic with updateInitialActiveIndex and updateInitialActiveId flags is necessary for SSR compatibility. Tab initialization cannot be deferred to mounted lifecycle because tabs must be available for server-side rendering of the initial HTML state.
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/** : Create and modify Vue components only under packages/bootstrap-vue-next/src/components/
📚 Learning: 2025-06-26T19:46:19.333Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 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:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/components/popover.mdapps/docs/src/docs/reference/accessibility.mdapps/docs/src/docs/directives/BToggle.mdapps/docs/src/docs/components/tooltip.mdarchitecture/ARIA_VISIBILITY.md
📚 Learning: 2025-09-30T23:57:21.526Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2866
File: apps/docs/src/docs/components/demo/ModalModel.vue:11-15
Timestamp: 2025-09-30T23:57:21.526Z
Learning: The bootstrap-vue-next documentation project uses unplugin-vue-components to automatically resolve and import Vue components like BModal, BButton, etc. Explicit imports for these components in script sections are not required.
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/reference/accessibility.mdapps/docs/src/docs/directives/BToggle.mdarchitecture/ARIA_VISIBILITY.md.github/copilot-instructions.md
📚 Learning: 2025-08-19T23:30:07.062Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2762
File: apps/docs/src/docs/components/tooltip.md:90-94
Timestamp: 2025-08-19T23:30:07.062Z
Learning: In bootstrap-vue-next docs, tooltip.data.ts uses popoverSharedProps('popover') to define props, which includes the 'manual' prop through the shared props structure from popover-shared.ts. The manual prop is available in BTooltip documentation through this prop spreading/inheritance mechanism.
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/components/popover.mdapps/docs/src/docs/reference/accessibility.mdapps/docs/src/docs/directives/BToggle.mdapps/docs/src/docs/components/tooltip.mdarchitecture/ARIA_VISIBILITY.mdapps/docs/src/docs/components/collapse.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/index.ts : When adding a new component, update packages/bootstrap-vue-next/src/components/index.ts to export it
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/reference/demo/AriaRegistrationDirective.vueapps/docs/src/docs/reference/demo/AriaRegistrationManual.vue.github/copilot-instructions.md
📚 Learning: 2025-05-28T07:01:55.095Z
Learnt from: xvaara
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2716
File: packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue:240-261
Timestamp: 2025-05-28T07:01:55.095Z
Learning: In BTabs component (packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue), the complex initialization logic with updateInitialActiveIndex and updateInitialActiveId flags is necessary for SSR compatibility. Tab initialization cannot be deferred to mounted lifecycle because tabs must be available for server-side rendering of the initial HTML state.
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/reference/accessibility.mdarchitecture/ARIA_VISIBILITY.md
📚 Learning: 2025-05-28T07:57:19.915Z
Learnt from: xvaara
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2716
File: packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue:384-404
Timestamp: 2025-05-28T07:57:19.915Z
Learning: In BTabs component (packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue), the activeIndex and activeId watchers are intentionally designed with separation of concerns: activeIndex watcher handles activate-tab event emission and complex validation logic, while activeId watcher is kept simple for synchronization between activeId and activeIndex values only.
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/reference/accessibility.mdarchitecture/ARIA_VISIBILITY.md
📚 Learning: 2025-08-19T23:30:07.062Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2762
File: apps/docs/src/docs/components/tooltip.md:90-94
Timestamp: 2025-08-19T23:30:07.062Z
Learning: In bootstrap-vue-next docs, tooltip.data.ts uses popoverSharedProps('tooltip') to define props, which includes the 'manual' prop through the shared props structure from popover-shared.ts. The manual prop is available in BTooltip documentation through this inheritance mechanism.
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/components/popover.mdapps/docs/src/docs/reference/accessibility.mdapps/docs/src/docs/directives/BToggle.mdapps/docs/src/docs/components/tooltip.mdarchitecture/ARIA_VISIBILITY.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/App.vue : Use packages/bootstrap-vue-next/src/App.vue as a local test area for component changes
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/reference/demo/AriaRegistrationDirective.vueapps/docs/src/docs/reference/demo/AriaRegistrationProgrammatic.vueapps/docs/src/docs/reference/demo/AriaRegistrationManual.vuearchitecture/ARIA_VISIBILITY.md.github/copilot-instructions.md
📚 Learning: 2025-05-28T07:32:45.658Z
Learnt from: xvaara
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2716
File: packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue:425-430
Timestamp: 2025-05-28T07:32:45.658Z
Learning: In BTabs component (packages/bootstrap-vue-next/src/components/BTabs/BTabs.vue), the activeIndex synchronization within sortTabs() is necessary and correct. When sorting tabs by DOM position, indices change, so activeIndex must be updated immediately to maintain consistency with activeId. This is not an unwanted side effect but a required consequence of the sorting operation.
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.ts
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/** : Create and modify Vue components only under packages/bootstrap-vue-next/src/components/
Applied to files:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsapps/docs/src/docs/reference/demo/AriaRegistrationDirective.vue.github/copilot-instructions.md
📚 Learning: 2025-10-21T01:11:59.901Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2861
File: apps/docs/src/docs/components/demo/CardKitchenSink.vue:28-31
Timestamp: 2025-10-21T01:11:59.901Z
Learning: In the bootstrap-vue-next docs codebase, the apps/docs/.vitepress/plugins/demo-container.ts plugin automatically generates kebab-case IDs from demo component filenames (e.g., CardKitchenSink.vue becomes id="card-kitchen-sink") and injects them into the HighlightCard wrapper elements. Therefore, demo components can use href="#kebab-case-filename" anchors without explicitly declaring the id attribute in the component template, as the id is generated at build time.
Applied to files:
apps/docs/src/docs/reference/demo/AriaRegistrationDirective.vueapps/docs/src/docs/reference/accessibility.mdapps/docs/src/docs/reference/demo/AriaRegistrationManual.vueapps/docs/src/docs/directives/BToggle.mdarchitecture/ARIA_VISIBILITY.md.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/**/*.vue : Keep component-specific styles within their respective .vue single-file components
Applied to files:
apps/docs/src/docs/reference/demo/AriaRegistrationDirective.vue.github/copilot-instructions.md
📚 Learning: 2025-04-28T22:48:46.738Z
Learnt from: xvaara
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 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
📚 Learning: 2025-05-23T23:58:07.165Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 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.
Applied to files:
apps/docs/src/docs/reference/accessibility.mdarchitecture/ARIA_VISIBILITY.md
📚 Learning: 2025-08-20T14:05:32.416Z
Learnt from: xvaara
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2732
File: packages/bootstrap-vue-next/src/components/BApp/BOrchestrator.vue:28-28
Timestamp: 2025-08-20T14:05:32.416Z
Learning: Vue 3 supports TypeScript annotations in template binding expressions when using `<script setup lang="ts">` or `<script lang="ts">`. Template ref callbacks like `:ref="(ref: ComponentPublicInstance) => ..."` are valid TypeScript syntax in Vue templates when TypeScript is enabled in the script block.
Applied to files:
apps/docs/src/docs/components/tooltip.md
📚 Learning: 2025-08-19T14:23:46.775Z
Learnt from: xvaara
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2732
File: packages/bootstrap-vue-next/CHANGELOG.md:35-41
Timestamp: 2025-08-19T14:23:46.775Z
Learning: In the bootstrap-vue-next repository, CHANGELOG.md files (e.g., packages/bootstrap-vue-next/CHANGELOG.md) are autogenerated and should be ignored in reviews; do not propose edits for them.
Applied to files:
architecture/ARIA_VISIBILITY.md.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/styles/styles.scss : Use packages/bootstrap-vue-next/src/styles/styles.scss as the main styles entry point
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-10-21T19:31:54.113Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2882
File: apps/docs/src/docs/components/demo/PlaceholderWidth.vue:1-22
Timestamp: 2025-10-21T19:31:54.113Z
Learning: The bootstrap-vue-next project uses unplugin to automatically import components, so explicit imports in demo/documentation components are not needed.
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to apps/docs/src/data/components/*.data.ts : When adding or modifying component props, events, or slots, ALWAYS update the corresponding .data.ts file in apps/docs/src/data/components/
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to apps/docs/src/data/components/*.data.ts : Documentation format in .data.ts files must match TypeScript interfaces exactly (props, emits, slots definitions)
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-10-28T03:37:33.172Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2891
File: apps/docs/.vitepress/plugins/auto-inject-doc-components.ts:106-130
Timestamp: 2025-10-28T03:37:33.172Z
Learning: In apps/docs/.vitepress/plugins/auto-inject-doc-components.ts, the documentation injection logic is intentionally simple and does not need to handle edge cases like partial presence of ComponentReference/imports, existing <script setup> blocks, or nested component directories. The codebase does not use these patterns and does not expect to support them.
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-10-21T19:26:36.699Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2882
File: apps/docs/src/docs/components/demo/AppCustomMerge.vue:19-22
Timestamp: 2025-10-21T19:26:36.699Z
Learning: In documentation example files under apps/docs/src/docs/components/demo/, keep examples simple and focused on demonstrating the specific feature, even if the implementation is not production-ready. Avoid suggesting complex implementations that would obscure the main point of the example.
Applied to files:
.github/copilot-instructions.md
🪛 GitHub Actions: ci
apps/docs/src/docs/reference/demo/AriaRegistrationProgrammatic.vue
[error] 23-23: Type '(trigger?: string | undefined, noTriggerEmit?: boolean | undefined) => void' is not assignable to type '(value: MouseEvent) => any'. (TS2322)
🪛 markdownlint-cli2 (0.18.1)
.github/copilot-instructions.md
29-29: Bare URL used
(MD034, no-bare-urls)
30-30: Bare URL used
(MD034, no-bare-urls)
31-31: Bare URL used
(MD034, no-bare-urls)
45-45: Bare URL used
(MD034, no-bare-urls)
47-47: Bare URL used
(MD034, no-bare-urls)
60-60: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ 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: Agent
🔇 Additional comments (16)
apps/docs/src/docs/components/dropdown.md (1)
290-291: LGTM! Clear accessibility cross-reference.The addition of the ARIA trigger registration reference is well-placed in the Accessibility section and maintains consistency with the broader documentation updates.
apps/docs/src/docs/components/alert.md (1)
71-74: LGTM! Accessibility guidance added.The new Accessibility section appropriately documents ARIA attribute management for dismissible alerts and links to the centralized guidance.
packages/bootstrap-vue-next/src/directives/BToggle/index.ts (1)
122-128: LGTM! Clean separation of concerns.The change from
clean=falsetoclean=truecorrectly delegates cleanup ofaria-expandedand CSS classes to the composable, while the directive retains responsibility foraria-controls. This architectural split ensures that dynamic state attributes are consistently managed by the component's visibility system, regardless of how visibility changes.The added comments clearly document this responsibility boundary.
.github/copilot-instructions.md (1)
90-94: LGTM! Architecture documentation referenced.The new Architecture Documentation section appropriately references the
ARIA_VISIBILITY.mddocument, establishing a clear location for technical architecture guidance.apps/docs/src/docs/reference/accessibility.md (1)
21-107: Excellent comprehensive ARIA documentation.This new section provides thorough guidance on the ARIA trigger registration system with clear explanations of:
- The opt-in registration model and split responsibilities between directive and composable
- Three distinct usage patterns with concrete demos
- When-to-use guidance for each approach
- Component coverage with proper cross-references
The documentation effectively clarifies the architectural separation where
v-b-togglemanages static relationships (aria-controls) while the visibility system manages dynamic state (aria-expanded, CSS classes).apps/docs/src/docs/components/popover.md (1)
136-138: LGTM! Consistent accessibility documentation.The Accessibility section appropriately references the ARIA trigger registration guidance, maintaining consistency with other component documentation.
apps/docs/src/docs/components/modal.md (1)
300-300: LGTM! Accessibility reference added.The ARIA trigger registration reference is well-integrated into the existing Accessibility section, providing users with centralized guidance on managing modal trigger attributes.
apps/docs/src/docs/components/tooltip.md (1)
154-156: LGTM! Accessibility documentation complete.The Accessibility section maintains the documentation pattern established across other components, providing users with consistent guidance on ARIA trigger management.
apps/docs/src/docs/components/toast.md (1)
82-83: LGTM! Documentation references are clear and consistent.The addition properly directs users to the centralized ARIA Trigger Registration guidance, aligning with the broader documentation refactor across components.
apps/docs/src/docs/directives/BToggle.md (1)
2-28: Excellent documentation of the directive's responsibilities.The rewritten documentation clearly explains the separation between the directive's static attribute management (aria-controls) and the component's dynamic state management (aria-expanded, CSS classes). This aligns perfectly with the architecture described in ARIA_VISIBILITY.md.
apps/docs/src/docs/reference/demo/AriaRegistrationDirective.vue (1)
1-8: Clean demo of automatic ARIA management.This demo effectively illustrates Pattern 1 (v-b-toggle Directive) from the ARIA_VISIBILITY.md architecture, showing the simplest use case with automatic ARIA attribute handling.
apps/docs/src/docs/reference/demo/AriaRegistrationManual.vue (1)
1-27: Excellent demonstration of manual ARIA management.This demo correctly implements Pattern 4 from the architecture documentation, showing developers how to manually manage all ARIA attributes and CSS classes when not using the v-b-toggle directive. The implementation properly synchronizes aria-expanded and CSS classes with the visibility state.
apps/docs/src/docs/reference/demo/AriaRegistrationProgrammatic.vue (1)
1-50: Good demonstration of hybrid v-b-toggle + v-model pattern.This demo effectively illustrates Pattern 2 from the ARIA_VISIBILITY.md architecture, showing how automatic ARIA management (via v-b-toggle) can coexist with programmatic control (via v-model). The example clearly demonstrates both the slot-based hide function and direct v-model manipulation.
apps/docs/src/docs/components/offcanvas.md (1)
153-166: Clear and consistent ARIA guidance.The updated documentation properly explains the division of responsibilities between the v-b-toggle directive (aria-controls, trigger registration) and the offcanvas component (aria-expanded, visual state). The reference to the centralized Accessibility documentation ensures users have access to comprehensive examples.
architecture/ARIA_VISIBILITY.md (1)
1-507: Outstanding architectural documentation!This is exceptionally thorough documentation that clearly explains:
- The rationale for separating static (aria-controls) and dynamic (aria-expanded, classes) ARIA attribute management
- The opt-in trigger registration system and how it works
- Multiple usage patterns with clear examples
- Implementation details including data flows
- Testing considerations and best practices
The document provides excellent guidance for both users and maintainers, with clear explanations of architectural decisions and their benefits. The four usage patterns align perfectly with the demo components added in this PR.
apps/docs/src/docs/components/collapse.md (1)
82-87: Well-integrated ARIA guidance for collapse component.The updated documentation correctly describes how the v-b-toggle directive and BCollapse component work together to manage ARIA attributes, and appropriately references the comprehensive Accessibility documentation for detailed examples including v-model and manual ARIA management patterns.
apps/docs/src/docs/reference/demo/AriaRegistrationProgrammatic.vue
Outdated
Show resolved
Hide resolved
|
@xvaara / @VividLemon I've marked this as a breaking change since I believe it technically is - if someone is doing some fancy footwork that depends on v-b-toggle itself to do the cleanup (although I think one would have to be abusing the system to actually have this code break you). Point is - we should think about this kind of case for once we've hit v1- my assumption is that had I tackled this exact problem post-v1 I could have done all the documentation changes and added a bug tagged |
There was a problem hiding this 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 refactors ARIA attribute management for show/hide components to eliminate redundancy between the v-b-toggle directive and useShowHide composable while maintaining all existing functionality. The key change is passing clean=true to unregisterTrigger() in the directive's unmount handler, allowing the composable to handle cleanup of dynamic attributes (aria-expanded and CSS classes) while the directive only removes the static aria-controls attribute.
Key changes:
- Eliminated duplicate ARIA attribute cleanup logic by clarifying responsibility split
- Added comprehensive architecture documentation explaining the trigger registration system
- Updated user-facing documentation across multiple components with improved accessibility guidance
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/bootstrap-vue-next/src/directives/BToggle/index.ts |
Changed unregisterTrigger call to pass clean=true and removed redundant manual attribute cleanup |
architecture/ARIA_VISIBILITY.md |
New comprehensive architecture documentation for the ARIA visibility system |
apps/docs/src/docs/reference/accessibility.md |
Added new section on ARIA trigger registration with three demonstration patterns |
apps/docs/src/docs/reference/demo/AriaRegistrationDirective.vue |
New demo showing automatic ARIA management with v-b-toggle |
apps/docs/src/docs/reference/demo/AriaRegistrationProgrammatic.vue |
New demo showing hybrid approach combining v-b-toggle with v-model |
apps/docs/src/docs/reference/demo/AriaRegistrationManual.vue |
New demo showing manual ARIA attribute management |
apps/docs/src/docs/directives/BToggle.md |
Updated to explain directive's role in ARIA management |
apps/docs/src/docs/components/collapse.md |
Updated accessibility section with clearer explanation of registration system |
apps/docs/src/docs/components/offcanvas.md |
Simplified v-model section to reference central accessibility documentation |
apps/docs/src/docs/components/modal.md |
Added reference to ARIA trigger registration documentation |
apps/docs/src/docs/components/dropdown.md |
Added reference to ARIA trigger registration documentation |
apps/docs/src/docs/components/toast.md |
Added reference to ARIA trigger registration documentation |
apps/docs/src/docs/components/alert.md |
Added new accessibility section with reference |
apps/docs/src/docs/components/popover.md |
Added new accessibility section with reference |
apps/docs/src/docs/components/tooltip.md |
Added new accessibility section with reference |
.github/copilot-instructions.md |
Added documentation examples section with demo file format guidelines |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/copilot-instructions.md(4 hunks)apps/docs/src/docs/reference/accessibility.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/docs/src/docs/reference/accessibility.md
🧰 Additional context used
🧠 Learnings (13)
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/App.vue : Use packages/bootstrap-vue-next/src/App.vue as a local test area for component changes
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/** : Create and modify Vue components only under packages/bootstrap-vue-next/src/components/
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/**/*.vue : Keep component-specific styles within their respective .vue single-file components
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-30T23:57:21.526Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2866
File: apps/docs/src/docs/components/demo/ModalModel.vue:11-15
Timestamp: 2025-09-30T23:57:21.526Z
Learning: The bootstrap-vue-next documentation project uses unplugin-vue-components to automatically resolve and import Vue components like BModal, BButton, etc. Explicit imports for these components in script sections are not required.
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/styles/styles.scss : Use packages/bootstrap-vue-next/src/styles/styles.scss as the main styles entry point
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/index.ts : When adding a new component, update packages/bootstrap-vue-next/src/components/index.ts to export it
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-08-19T14:23:46.775Z
Learnt from: xvaara
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2732
File: packages/bootstrap-vue-next/CHANGELOG.md:35-41
Timestamp: 2025-08-19T14:23:46.775Z
Learning: In the bootstrap-vue-next repository, CHANGELOG.md files (e.g., packages/bootstrap-vue-next/CHANGELOG.md) are autogenerated and should be ignored in reviews; do not propose edits for them.
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-10-21T19:31:54.113Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2882
File: apps/docs/src/docs/components/demo/PlaceholderWidth.vue:1-22
Timestamp: 2025-10-21T19:31:54.113Z
Learning: The bootstrap-vue-next project uses unplugin to automatically import components, so explicit imports in demo/documentation components are not needed.
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to apps/docs/src/data/components/*.data.ts : When adding or modifying component props, events, or slots, ALWAYS update the corresponding .data.ts file in apps/docs/src/data/components/
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to apps/docs/src/data/components/*.data.ts : Documentation format in .data.ts files must match TypeScript interfaces exactly (props, emits, slots definitions)
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-10-28T03:37:33.172Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2891
File: apps/docs/.vitepress/plugins/auto-inject-doc-components.ts:106-130
Timestamp: 2025-10-28T03:37:33.172Z
Learning: In apps/docs/.vitepress/plugins/auto-inject-doc-components.ts, the documentation injection logic is intentionally simple and does not need to handle edge cases like partial presence of ComponentReference/imports, existing <script setup> blocks, or nested component directories. The codebase does not use these patterns and does not expect to support them.
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-10-21T19:26:36.699Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2882
File: apps/docs/src/docs/components/demo/AppCustomMerge.vue:19-22
Timestamp: 2025-10-21T19:26:36.699Z
Learning: In documentation example files under apps/docs/src/docs/components/demo/, keep examples simple and focused on demonstrating the specific feature, even if the implementation is not production-ready. Avoid suggesting complex implementations that would obscure the main point of the example.
Applied to files:
.github/copilot-instructions.md
📚 Learning: 2025-10-21T01:11:59.901Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2861
File: apps/docs/src/docs/components/demo/CardKitchenSink.vue:28-31
Timestamp: 2025-10-21T01:11:59.901Z
Learning: In the bootstrap-vue-next docs codebase, the apps/docs/.vitepress/plugins/demo-container.ts plugin automatically generates kebab-case IDs from demo component filenames (e.g., CardKitchenSink.vue becomes id="card-kitchen-sink") and injects them into the HighlightCard wrapper elements. Therefore, demo components can use href="#kebab-case-filename" anchors without explicitly declaring the id attribute in the component template, as the id is generated at build time.
Applied to files:
.github/copilot-instructions.md
🪛 markdownlint-cli2 (0.18.1)
.github/copilot-instructions.md
29-29: Bare URL used
(MD034, no-bare-urls)
30-30: Bare URL used
(MD034, no-bare-urls)
31-31: Bare URL used
(MD034, no-bare-urls)
45-45: Bare URL used
(MD034, no-bare-urls)
47-47: Bare URL used
(MD034, no-bare-urls)
60-60: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ 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)
.github/copilot-instructions.md (1)
248-248: Documentation examples section adequately clarifies demo file references.The updated guidance at line 248 clearly shows that
#region namemarkers in demo files are referenced as#namein markdown. The concrete example (#region template→#template) directly addresses the ambiguity flagged in prior reviews.
commit: |
* upstream/main: (28 commits) fix(BToggle)! Remove redundant attribute cleanup & update docs for accessibility attributes on show/hide components (bootstrap-vue-next#2918) chore: release main (bootstrap-vue-next#2912) fix: allow custom component props in orchestrator create methods with type safety (bootstrap-vue-next#2922) fix(BModal): prevent focus trap error when no tabbable elements exist (bootstrap-vue-next#2864) Update package description for clarity (bootstrap-vue-next#2917) Update project description for clarity and detail test: add event emission tests for BTable and BTableLite (bootstrap-vue-next#2915) fix(BTableLite): Use primary key to persist row-details state when items change (bootstrap-vue-next#2871) chore: release main (bootstrap-vue-next#2896) feat(BTable): add configurable debouncing ci: Add publint to the build process (bootstrap-vue-next#2909) docs(Offcanvas): Parity pass (bootstrap-vue-next#2900) fix(directives): Robustness fixes for directives (bootstrap-vue-next#2906) docs(BFormInput): document @wheel.prevent for disabling mousewheel events (bootstrap-vue-next#2903) fix(typings): Fix paths to `*.d.mts` files (bootstrap-vue-next#2907) feat: add name and form props to BFormRating for form submission (bootstrap-vue-next#2895) docs: refactor docs to avoid duplication and boilerplate code (bootstrap-vue-next#2891) docs(BToast): Parity (bootstrap-vue-next#2887) docs(BModal): fix attribute to hide footer (bootstrap-vue-next#2888) docs(BPlaceholder): Parity pass (bootstrap-vue-next#2886) ...
Describe the PR
Overview
This PR refactors ARIA attribute management for show/hide components to eliminate redundancy and improve maintainability while preserving all existing functionality. Fixes #2910
In addition:
Problem Statement
The previous implementation had overlapping responsibilities between the
v-b-toggledirective and theuseShowHidecomposable:aria-expanded,aria-controls, and CSS classes on unmountaria-expandedand classes through its registration systemSolution
Clear Separation of Responsibilities
v-b-toggle Directive - Manages static relationship attributes:
aria-controls(knows target IDs from binding)aria-controlson unmountaria-expandedor classesuseShowHide Composable - Manages dynamic state attributes (for registered triggers):
aria-expandedbased on visibility statecollapsed/not-collapsedCSS classesmodelValuechangesWhy Split This Way?
The division is based on static vs dynamic characteristics:
aria-controls= Staticaria-expanded+ classes = DynamicmodelValueand handles centrallyCode Changes
1. BToggle Directive Cleanup
File:
packages/bootstrap-vue-next/src/directives/BToggle/index.tsChange: Updated
handleUnmountto only removearia-controlsImpact: The composable's
unregisterTrigger(clean=true)now handles cleanup ofaria-expandedand classes, eliminating duplication.2. Documentation Improvements
New Architecture Documentation:
architecture/ARIA_VISIBILITY.md- Comprehensive architecture documentationUpdated User Documentation:
apps/docs/src/docs/directives/BToggle.mdapps/docs/src/docs/components/collapse.mdapps/docs/src/docs/components/offcanvas.mdapps/docs/src/docs/reference/accessibility.mdAdditional component docs updated:
Demo Files Created:
AriaRegistrationDirective.vue- Shows v-b-toggle automatic registrationAriaRegistrationProgrammatic.vue- Shows v-b-toggle + v-model + slot functionsAriaRegistrationManual.vue- Shows manual ARIA management without registrationDevelopment Documentation:
.github/copilot-instructions.md<<< DEMOsyntaxdocs/ARIA_ACCESSIBILITY_REFACTOR.mdHow the System Works
The Registration System
ARIA management is opt-in through trigger registration:
Registered triggers (get automatic ARIA management):
v-b-toggledirective → automatic registrationUnregistered triggers (manual ARIA management required):
v-b-toggledirectivearia-controls,aria-expanded, and classesData Flow Example
Key Insight: The watch mechanism ensures ALL registered triggers update, regardless of HOW visibility changed (directive click, v-model, slot function, etc.)
Usage Patterns
Pattern 1: Automatic (Recommended)
✅ Full automatic ARIA management
Pattern 2: Automatic + Programmatic Control
✅ First button gets automatic ARIA (registered)
✅ First button updates when second button closes collapse
❌ Second button has no ARIA (not registered)
Pattern 3: Manual ARIA Management
✅ Full manual control
⚠️ Developer responsible for keeping attributes in sync
Testing
All existing tests pass with no changes required:
Test coverage includes:
Breaking Changes
None. This is purely an internal refactor:
Benefits
Clearer Separation of Concerns
aria-controls)aria-expanded, classes)Eliminated Redundancy
Better Maintainability
Improved Documentation
Consistent Behavior
Files Changed
Source Code
packages/bootstrap-vue-next/src/directives/BToggle/index.ts- Removed redundant cleanupDocumentation
architecture/ARIA_VISIBILITY.md- New architecture documentationapps/docs/src/docs/directives/BToggle.md- Complete rewriteapps/docs/src/docs/components/collapse.md- Updated accessibility sectionapps/docs/src/docs/components/offcanvas.md- Updated v-model sectionapps/docs/src/docs/reference/accessibility.md- New comprehensive sectionapps/docs/src/docs/reference/demo/AriaRegistrationDirective.vue- New demoapps/docs/src/docs/reference/demo/AriaRegistrationProgrammatic.vue- New demoapps/docs/src/docs/reference/demo/AriaRegistrationManual.vue- New demoapps/docs/src/docs/components/modal.md- Added referenceapps/docs/src/docs/components/dropdown.md- Added referenceapps/docs/src/docs/components/toast.md- Added referenceapps/docs/src/docs/components/alert.md- Added referenceapps/docs/src/docs/components/popover.md- Added referenceapps/docs/src/docs/components/tooltip.md- Added referenceDevelopment Documentation
.github/copilot-instructions.md- Added documentation examples sectiondocs/ARIA_ACCESSIBILITY_REFACTOR.md- Technical planning documentReview Focus Areas
architecture/ARIA_VISIBILITY.mdfor accuracyRelated Issues
This refactor addresses:
Migration Guide: No migration needed - this is a non-breaking internal refactor.
Accessibility: No changes to accessibility behavior - maintains all existing ARIA attributes correctly.
Small replication
See the examples in accessibility.md
PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)feat(...)fix(...)docs(...)The PR fulfills these requirements:
CHANGELOGis 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 deniedSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.