Skip to content

docs: fix code tabs on getting started and icons pages #2805

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

Merged
merged 4 commits into from
Aug 13, 2025

Conversation

dwgray
Copy link
Member

@dwgray dwgray commented Aug 7, 2025

Describe the PR

I'm not entirely sure what was going on with the existing code - in both pages where we had different flavors of docs, the first one worked and the remaining ones failed. Clicking on the tabs also caused the browser to hang. In any case, for now, I'm moving to using the VitePress method of handling multiple examples in tabs and tweaking the styling a bit to fit in with the rest of the page.

I realize this loses the persistent language selection that we had previously - this is a known issue against vitepress -vuejs/vitepress#2954 - we can grab that if it gets fixed. I'll consider writing a plugin to solve this ala https://github.com/Red-Asuka/vitepress-plugin-tabs/tree/main if I have time. But for now, having a robust solutions to the core problem seems higher priority.

closes #2803

Small replication

See bug

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

  • Documentation

    • Replaced component-based tabbed code blocks with unified markdown code groups for package manager commands.
    • Removed the script that tracked tab selection; examples and instructions remain unchanged.
    • Fixed a minor apostrophe for consistency.
  • Style

    • Improved code-group visuals (borders, padding, rounded corners, background) for clearer, more consistent presentation.

@dwgray dwgray requested a review from xvaara August 7, 2025 22:27
Copy link

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

Copy link

coderabbitai bot commented Aug 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR refactors docs to replace Vue-based tabbed code components with markdown ::: code-group blocks, removes the local tab-state script, and adds presentational CSS in the docs theme to style grouped code blocks.

Changes

Cohort / File(s) Change Summary
Docs: Replace Vue tab components with markdown code-group
apps/docs/src/docs.md, apps/docs/src/docs/icons.md
Removed <ClientOnly>, <BTabs>, <BTab>, <BCard> and associated <script setup> imports/state; replaced tabbed code blocks with ::: code-group and labeled fenced code blocks (e.g., bash [PNPM]); minor ASCII apostrophe fix.
Docs theme: Add code-group styling
apps/docs/.vitepress/theme/Layout.vue
Added presentational CSS rules for .vp-code-group, .vp-code-group .blocks, and .vp-code-group .tabs (border, radius, padding, background, margins).

Sequence Diagram(s)

(omitted — changes are documentation formatting and CSS only)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix broken package manager command tabs in getting started installation instructions (#2803)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Possibly related PRs

Poem

"I hopped through docs to tidy the view,
Tabs turned to code-groups — simple and true.
Borders and padding for each little block,
A rabbit-approved layout, neat as a clock.
🐇✨"


📜 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 a27682c and 1b15f7b.

📒 Files selected for processing (2)
  • apps/docs/.vitepress/theme/Layout.vue (1 hunks)
  • apps/docs/src/docs.md (5 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.
    • 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.
  • 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 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/Issue comments)

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

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

Copy link

pkg-pr-new bot commented Aug 7, 2025

bsvn-vite-ts

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

commit: 1b15f7b

Copy link

@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: 1

🧹 Nitpick comments (1)
apps/docs/src/docs.md (1)

52-52: Remove stray empty <p> element

This lone <p></p> only adds an extra blank line and pollutes the HTML output.

-<p></p>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c50e0ef and c5bb350.

📒 Files selected for processing (3)
  • apps/docs/.vitepress/theme/Layout.vue (1 hunks)
  • apps/docs/src/docs.md (5 hunks)
  • apps/docs/src/docs/icons.md (2 hunks)
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#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.
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#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: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#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.
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.
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2669
File: apps/docs/src/data/components/table.data.ts:334-336
Timestamp: 2025-04-24T20:35:48.629Z
Learning: The generic type parameter for table items should use the singular form `Item` rather than the plural `Items` to improve readability and follow TypeScript conventions. This change would primarily affect two files: `packages/bootstrap-vue-next/src/types/ComponentProps.ts` and `apps/docs/src/data/components/table.data.ts`.
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2689
File: apps/docs/src/docs/components/demo/ProgressCustomLabels.vue:6-8
Timestamp: 2025-05-09T17:28:39.323Z
Learning: In Vue templates, when using Prettier for formatting, tags may be split across multiple lines with patterns like `<span\n>Content</span\n>` where closing angle brackets appear at the beginning of lines. This is valid syntax even though it looks unusual, and should be maintained when Prettier enforces it.
📚 Learning: 2025-05-09T17:28:39.323Z
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2689
File: apps/docs/src/docs/components/demo/ProgressCustomLabels.vue:6-8
Timestamp: 2025-05-09T17:28:39.323Z
Learning: In Vue templates, when using Prettier for formatting, tags may be split across multiple lines with patterns like `<span\n>Content</span\n>` where closing angle brackets appear at the beginning of lines. This is valid syntax even though it looks unusual, and should be maintained when Prettier enforces it.

Applied to files:

  • apps/docs/.vitepress/theme/Layout.vue
  • apps/docs/src/docs.md
📚 Learning: 2025-06-05T11:43:10.793Z
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.

Applied to files:

  • apps/docs/src/docs/icons.md
  • apps/docs/src/docs.md
📚 Learning: 2025-05-23T23:58:07.165Z
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.

Applied to files:

  • apps/docs/src/docs/icons.md
  • apps/docs/src/docs.md
📚 Learning: 2025-05-28T07:01:55.095Z
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#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:

  • apps/docs/src/docs/icons.md
  • apps/docs/src/docs.md
📚 Learning: 2025-05-28T07:57:19.915Z
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#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:

  • apps/docs/src/docs/icons.md
  • apps/docs/src/docs.md
📚 Learning: 2025-06-26T19:46:19.333Z
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/icons.md
  • apps/docs/src/docs.md
📚 Learning: 2025-05-28T07:32:45.658Z
Learnt from: xvaara
PR: bootstrap-vue-next/bootstrap-vue-next#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:

  • apps/docs/src/docs/icons.md
  • apps/docs/src/docs.md
📚 Learning: 2025-05-26T17:28:35.902Z
Learnt from: VividLemon
PR: bootstrap-vue-next/bootstrap-vue-next#2691
File: packages/bootstrap-vue-next/src/composables/useBLinkHelper.ts:85-86
Timestamp: 2025-05-26T17:28:35.902Z
Learning: In the `useBLinkTagResolver` function in `packages/bootstrap-vue-next/src/composables/useBLinkHelper.ts`, the `routerComponentName` parameter is required and typed as `MaybeRefOrGetter<string>`, ensuring it cannot be undefined.

Applied to files:

  • apps/docs/src/docs/icons.md
  • apps/docs/src/docs.md
📚 Learning: 2025-04-24T20:35:48.629Z
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2669
File: apps/docs/src/data/components/table.data.ts:334-336
Timestamp: 2025-04-24T20:35:48.629Z
Learning: The generic type parameter for table items should use the singular form `Item` rather than the plural `Items` to improve readability and follow TypeScript conventions. This change would primarily affect two files: `packages/bootstrap-vue-next/src/types/ComponentProps.ts` and `apps/docs/src/data/components/table.data.ts`.

Applied to files:

  • apps/docs/src/docs.md
📚 Learning: 2025-04-27T17:30:42.045Z
Learnt from: unstoppablecarl
PR: bootstrap-vue-next/bootstrap-vue-next#2671
File: packages/bootstrap-vue-next/src/components/BToast/_toast.scss:1-3
Timestamp: 2025-04-27T17:30:42.045Z
Learning: In global SCSS files for bootstrap-vue-next, `:deep()` combinator should not be used as it only works in Vue's scoped style blocks. Standard CSS/SCSS selectors should be used instead.

Applied to files:

  • apps/docs/src/docs.md
📚 Learning: 2025-04-28T22:48:46.738Z
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.md
📚 Learning: 2025-05-01T23:40:56.146Z
Learnt from: dwgray
PR: bootstrap-vue-next/bootstrap-vue-next#2679
File: apps/docs/.vitepress/theme/Layout.vue:0-0
Timestamp: 2025-05-01T23:40:56.146Z
Learning: In bootstrap-vue-next, the `useScrollspy` hook returns an object with a `current` property which is the ID string (or null) of the currently active item, not an object containing an ID.

Applied to files:

  • apps/docs/src/docs.md
⏰ 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 (2)
apps/docs/src/docs.md (1)

32-50: Switch to VitePress code-group looks good

All converted blocks follow the documented ::: code-group syntax and the labelled fences ( ```bash [PNPM] etc.) render correctly in VitePress ≥1.0.0-beta. Properly closes with ::: and therefore fixes the JS-driven tab crashes reported in #2803.

Also applies to: 78-96, 148-166, 228-248

apps/docs/src/docs/icons.md (1)

23-41: Icon docs refactor LGTM

The two new code-group blocks are syntactically valid and consistent with the rest of the documentation updates.

Also applies to: 110-128

@VividLemon VividLemon merged commit aae9c45 into bootstrap-vue-next:main Aug 13, 2025
3 of 4 checks passed
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.

docs: package manager command tabs don't work on getting started installation instructions, clicking a tab crashes the browser.
3 participants