Skip to content

Conversation

@dwgray
Copy link
Member

@dwgray dwgray commented Nov 24, 2025

Describe the PR

Fixes #2923

Move sort icons to be background images as they were in BSV. Also implemented sort-icon-left while in the code.

This brings us closer to BSV compatibility. It does change the look of current BSVN tables, as the old icons were inline with the text.

image

Small replication

See the 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

  • New Features

    • Added a boolean prop to allow table sort icons to be positioned on the left.
  • Documentation

    • Added “Sort Icon Positioning” docs, examples, and a demo showing left/right icon variants.
    • Clarified provider sort state, debouncing, request cancellation examples, and migration notes.
  • Style

    • Added header styling and variables to support left/right sort icon placement.
  • Tests

    • Updated/added tests for icon placement classes, aria-sort behavior, and table-level icon toggling.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings November 24, 2025 01:29
@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 Nov 24, 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.

Walkthrough

Adds a boolean prop sortIconLeft to BTable (types, component, and docs), replaces inline SortIcon rendering with CSS background-image icons (left/right placement), updates SCSS and tests, and adds docs/demo showing left-positioned sort icons.

Changes

Cohort / File(s) Summary
Types & Public API
packages/bootstrap-vue-next/src/types/ComponentProps.ts, apps/docs/src/data/components/table.data.ts
Reintroduced and documented sortIconLeft?: boolean on BTable public props; docs data updated to include the new prop and description.
Core Component
packages/bootstrap-vue-next/src/components/BTable/BTable.vue
Added sortIconLeft prop; removed SortIcon import and inline header rendering; compute thClass per field to apply b-table-sort-icon-left when enabled; respect non-sortable fields and noSortableIcon.
Styling
packages/bootstrap-vue-next/src/components/BTable/_table.scss
Added str-replace() and bv-escape-svg() helpers, public SCSS variables for SVG background images/dimensions, applied background-image approach to [aria-sort] headers, added .b-table-sort-icon-left and .b-table-no-sort-icon, and responsive .table-sm adjustments.
Tests
packages/bootstrap-vue-next/src/components/BTable/table.spec.ts
Updated assertions to check aria-sort values and CSS-class presence; added tests for sortIconLeft class application and b-table-no-sort-icon table class; broadened aria-sort-related checks.
Docs & Demos
apps/docs/src/docs/components/demo/TableSortIcons.vue, apps/docs/src/docs/components/table.md
Added demo component showing default and sort-icon-left tables; added "Sort Icon Positioning" doc section and examples; refined provider sortBy description to array shape and formatting tweaks.
Docs housekeeping
apps/docs/src/docs/migration-guide.md
Removed NotYetDocumented placeholder for BTable.

Sequence Diagram(s)

sequenceDiagram
    participant Consumer as Consumer (app/demo)
    participant BTable as BTable component
    participant Computed as computedFields
    participant DOM as Header cell (th)
    participant SCSS as _table.scss

    note over Consumer,BTable: Render request with props (fields, items, sortIconLeft)
    Consumer->>BTable: mount/render(props)
    BTable->>Computed: build fields (add thClass when sortIconLeft)
    Computed-->>BTable: fields with thClass
    BTable->>DOM: render header cells with aria-sort + thClass
    SCSS->>DOM: apply background-image based on [aria-sort] and thClass
    DOM-->>Consumer: header visuals (icon left or right via CSS)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review SCSS SVG/data-URL escaping and background-position logic (_table.scss).
  • Verify thClass computation and aria-sort semantics in BTable.vue.
  • Check updated tests for robustness and correct assertions (table.spec.ts).
  • Confirm docs/demo reflect the new prop and provider sortBy shape.

Possibly related PRs

Suggested reviewers

  • VividLemon

Poem

🐰
I hopped through code with gentle care,
Shifted little arrows left or right with flair,
SVGs tucked snug as background art,
No more wrapping — headers do their part,
A tiny hop — the table's fair.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(BTable): make sort icons background images to avoid wrapping' clearly and specifically describes the main change: converting sort icons from inline elements to background images to prevent wrapping issues.
Linked Issues check ✅ Passed The PR comprehensively addresses all coding requirements from issue #2923: sort icons converted to background images to prevent wrapping [#2923], and sort-icon-left configuration option implemented [#2923] to restore BSV compatibility.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objectives: sort icon styling implementation, supporting SCSS helpers, component prop updates, demo and documentation additions are all within scope of fixing icon wrapping and implementing the sort-icon-left feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description addresses all required sections including a clear description of changes, visual evidence via screenshot, and proper PR checklist completion with conventional commits confirmation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 24, 2025

bsvn-vite-ts

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

commit: 8e02bfe

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 converts BTable sort icons from inline SVG elements to CSS background images to prevent wrapping issues, bringing the implementation closer to Bootstrap Vue (BSV) compatibility. It also implements the sort-icon-left prop to allow positioning icons on the left side of header cells.

  • Replaces inline SortIcon component with CSS background image approach
  • Adds sortIconLeft prop for flexible icon positioning
  • Updates tests to verify CSS-based icon implementation

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 sortIconLeft boolean prop to BTableProps interface
packages/bootstrap-vue-next/src/components/BTable/table.spec.ts Updates tests to verify CSS background image icons and sortIconLeft functionality
packages/bootstrap-vue-next/src/components/BTable/_table.scss Adds CSS for background image sort icons with positioning logic (contains critical bug - missing str-replace function)
packages/bootstrap-vue-next/src/components/BTable/BTable.vue Removes SortIcon component usage, applies b-table-sort-icon-left class conditionally (has bug - applies to all fields)
apps/docs/src/docs/migration-guide.md Removes placeholder comment about BTable not being documented
apps/docs/src/docs/components/table.md Adds documentation for sort icon positioning feature
apps/docs/src/docs/components/demo/TableSortIcons.vue Adds demo showing default and left-aligned sort icons
apps/docs/src/data/components/table.data.ts Documents the new sortIconLeft prop

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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/bootstrap-vue-next/src/components/BTable/BTable.vue (1)

146-151: sortIconLeft integration is solid, but noSortableIcon is now ignored

The new bits here look good:

  • sortIconLeft has a sane default of false in withDefaults.
  • computedFields extends each field with thAttr.aria-sort and a thClass that conditionally adds 'b-table-sort-icon-left' based on props.sortIconLeft, which lines up with the SCSS selectors and tests.

However, the noSortableIcon prop is no longer connected to the rendering pipeline: aria-sort is always set for sortable headers, and SCSS now always renders background icons for [aria-sort] cells. Since tableClasses doesn’t add any class for noSortableIcon, setting no-sort-icon on <BTable> no longer hides icons.

To restore that behavior while preserving accessibility:

  1. Add a suppressor class at the table level:
const tableClasses = computed(() => ({
  'b-table-busy': busyModel.value,
  'b-table-selectable': props.selectable,
  'user-select-none': props.selectable && isSelecting.value,
  'b-table-fixed': props.fixed,
  'b-table-no-border-collapse': props.noBorderCollapse,
+ 'b-table-no-sort-icon': props.noSortableIcon,
}))
  1. In _table.scss, scope the sort‑icon background rules under .table.b-table:not(.b-table-no-sort-icon) as suggested in the stylesheet review, so no-sort-icon only affects the visual icons, not aria-sort or click behavior.

This keeps the new implementation and aria semantics intact while avoiding a regression for existing users of noSortableIcon.

Also applies to: 371-385, 387-393

🧹 Nitpick comments (1)
packages/bootstrap-vue-next/src/components/BTable/table.spec.ts (1)

1070-1121: New sort icon tests align with aria-sort & sortIconLeft behavior

The added tests:

  • Validate that sortable headers expose aria-sort with one of none | ascending | descending.
  • Confirm b-table-sort-icon-left is applied when sortIconLeft is true and absent when false, and that the legacy b-table-sort-icon-inline class is not used.

These assertions match the new CSS‑background implementation.

It would be worth adding a small test once noSortableIcon is wired back in (e.g., checking that the root <table> gains a b-table-no-sort-icon class when no-sort-icon is set), but that can follow the implementation fix.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5d85f2 and 5a8a137.

📒 Files selected for processing (8)
  • apps/docs/src/data/components/table.data.ts (1 hunks)
  • apps/docs/src/docs/components/demo/TableSortIcons.vue (1 hunks)
  • apps/docs/src/docs/components/table.md (4 hunks)
  • apps/docs/src/docs/migration-guide.md (0 hunks)
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue (2 hunks)
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss (1 hunks)
  • packages/bootstrap-vue-next/src/components/BTable/table.spec.ts (2 hunks)
  • packages/bootstrap-vue-next/src/types/ComponentProps.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/docs/src/docs/migration-guide.md
🧰 Additional context used
📓 Path-based instructions (4)
apps/docs/src/data/components/*.data.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

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/
Documentation format in .data.ts files must match TypeScript interfaces exactly (props, emits, slots definitions)

Files:

  • apps/docs/src/data/components/table.data.ts
packages/bootstrap-vue-next/src/components/**

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Create and modify Vue components only under packages/bootstrap-vue-next/src/components/

Files:

  • packages/bootstrap-vue-next/src/components/BTable/table.spec.ts
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
**/*.spec.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write tests following existing patterns in *.spec.ts files

Files:

  • packages/bootstrap-vue-next/src/components/BTable/table.spec.ts
packages/bootstrap-vue-next/src/components/**/*.vue

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Keep component-specific styles within their respective .vue single-file components

Files:

  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
🧠 Learnings (17)
📓 Common learnings
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2777
File: packages/bootstrap-vue-next/CHANGELOG.md:11-11
Timestamp: 2025-08-18T18:20:08.240Z
Learning: For PR #2777 (BSort updates), keep changes scoped to BTable sorting work; unrelated edits like CHANGELOG typos should be deferred to a separate PR/issue.
📚 Learning: 2025-08-18T18:20:08.240Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2777
File: packages/bootstrap-vue-next/CHANGELOG.md:11-11
Timestamp: 2025-08-18T18:20:08.240Z
Learning: For PR #2777 (BSort updates), keep changes scoped to BTable sorting work; unrelated edits like CHANGELOG typos should be deferred to a separate PR/issue.

Applied to files:

  • apps/docs/src/data/components/table.data.ts
  • apps/docs/src/docs/components/demo/TableSortIcons.vue
  • packages/bootstrap-vue-next/src/components/BTable/table.spec.ts
  • apps/docs/src/docs/components/table.md
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
📚 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:

  • apps/docs/src/data/components/table.data.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/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/types/ComponentProps.ts
  • apps/docs/src/docs/components/demo/TableSortIcons.vue
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
📚 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/types/ComponentProps.ts
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
📚 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/types/ComponentProps.ts
📚 Learning: 2025-04-24T20:35:48.629Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 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:

  • packages/bootstrap-vue-next/src/types/ComponentProps.ts
  • apps/docs/src/docs/components/demo/TableSortIcons.vue
📚 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/types/ComponentProps.ts
  • packages/bootstrap-vue-next/src/components/BTable/table.spec.ts
  • apps/docs/src/docs/components/table.md
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
📚 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/types/ComponentProps.ts
  • apps/docs/src/docs/components/demo/TableSortIcons.vue
  • packages/bootstrap-vue-next/src/components/BTable/table.spec.ts
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
📚 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:

  • apps/docs/src/docs/components/demo/TableSortIcons.vue
📚 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/components/demo/TableSortIcons.vue
📚 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:

  • apps/docs/src/docs/components/demo/TableSortIcons.vue
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
📚 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/components/demo/TableSortIcons.vue
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
  • packages/bootstrap-vue-next/src/components/BTable/BTable.vue
📚 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:

  • apps/docs/src/docs/components/demo/TableSortIcons.vue
📚 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:

  • apps/docs/src/docs/components/demo/TableSortIcons.vue
📚 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 **/*.spec.ts : Write tests following existing patterns in *.spec.ts files

Applied to files:

  • packages/bootstrap-vue-next/src/components/BTable/table.spec.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/styles/styles.scss : Use packages/bootstrap-vue-next/src/styles/styles.scss as the main styles entry point

Applied to files:

  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
⏰ 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). (2)
  • GitHub Check: Agent
  • GitHub Check: build
🔇 Additional comments (4)
packages/bootstrap-vue-next/src/types/ComponentProps.ts (1)

1162-1206: BTableProps: sortIconLeft prop wiring looks correct

Adding sortIconLeft?: boolean into BTableProps<Items> is consistent with how the prop is used in BTable.vue, SCSS, tests, and docs. No typing or API-shape issues here.

apps/docs/src/docs/components/demo/TableSortIcons.vue (1)

1-41: TableSortIcons demo correctly showcases sort-icon-left

The demo cleanly contrasts default vs sort-icon-left behavior, and the TableItem<Person> / TableFieldRaw<Person> typings align with existing table demos and the exported types.

apps/docs/src/data/components/table.data.ts (1)

595-767: BTable docs metadata for sortIconLeft matches runtime/API

The sortIconLeft prop entry (type: 'boolean', default: false) and description accurately reflect the component prop and SCSS behavior, and it’s placed alongside the other sort-related props.

apps/docs/src/docs/components/table.md (1)

777-786: Sort Icon Positioning docs match the new implementation

The new section correctly explains that sort icons are CSS background images anchored to the right by default, and that sort-icon-left switches them to the left edge. The linked TableSortIcons.vue demo reinforces the behavior and aligns with the BTable prop and SCSS changes.

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

♻️ Duplicate comments (1)
apps/docs/src/docs/components/table.md (1)

885-891: ✓ Provider context sortBy description now matches its type signature.

The updated description at line 890 now correctly reflects that sortBy is an array of { key, order } entries (or undefined), aligning with the actual type BTableSortBy<T>[] | undefined. This directly addresses the discrepancy flagged in past reviews.

🧹 Nitpick comments (1)
packages/bootstrap-vue-next/src/components/BTable/_table.scss (1)

228-245: Minor: Remove redundant :not(.b-table-no-sort-icon) selector in nested rule.

Since the outer .table.b-table:not(.b-table-no-sort-icon) already gates the icon styles, the nested &.table-sm:not(.b-table-no-sort-icon) on line 228 repeats the :not() check unnecessarily. Simplify to &.table-sm:

- &.table-sm:not(.b-table-no-sort-icon) {
+ &.table-sm {

This is a minor code-quality refinement with no functional impact.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f7f8c9 and 8e02bfe.

📒 Files selected for processing (2)
  • apps/docs/src/docs/components/table.md (4 hunks)
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/bootstrap-vue-next/src/components/**

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Create and modify Vue components only under packages/bootstrap-vue-next/src/components/

Files:

  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
🧠 Learnings (7)
📓 Common learnings
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2777
File: packages/bootstrap-vue-next/CHANGELOG.md:11-11
Timestamp: 2025-08-18T18:20:08.240Z
Learning: For PR #2777 (BSort updates), keep changes scoped to BTable sorting work; unrelated edits like CHANGELOG typos should be deferred to a separate PR/issue.
📚 Learning: 2025-08-18T18:20:08.240Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 2777
File: packages/bootstrap-vue-next/CHANGELOG.md:11-11
Timestamp: 2025-08-18T18:20:08.240Z
Learning: For PR #2777 (BSort updates), keep changes scoped to BTable sorting work; unrelated edits like CHANGELOG typos should be deferred to a separate PR/issue.

Applied to files:

  • apps/docs/src/docs/components/table.md
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
📚 Learning: 2025-04-24T20:35:48.629Z
Learnt from: dwgray
Repo: bootstrap-vue-next/bootstrap-vue-next PR: 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/components/table.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:

  • apps/docs/src/docs/components/table.md
  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
📚 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:

  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
📚 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:

  • packages/bootstrap-vue-next/src/components/BTable/_table.scss
📚 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/components/BTable/_table.scss
⏰ 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 (4)
packages/bootstrap-vue-next/src/components/BTable/_table.scss (2)

155-173: ✓ Helper functions correctly defined and address past review concerns.

The str-replace and bv-escape-svg functions are now properly implemented. The SVG escaping (encoding <, >, # as %3c, %3e, %23) is the standard approach for embedding SVG in CSS data URLs and will work across browsers.


190-226: ✓ Icon visibility gating correctly resolves past concerns about noSortableIcon support.

The selector .table.b-table:not(.b-table-no-sort-icon) successfully gates the sort icon CSS, allowing the noSortableIcon prop to work as expected. Icons will only render when the b-table-no-sort-icon class is absent.

apps/docs/src/docs/components/table.md (2)

777-785: ✓ New "Sort Icon Positioning" section is clear and helpful.

This new documentation section effectively explains the default right-aligned icon behavior, the sort-icon-left prop, and provides a reference to the demo. The note about advanced customization via scoped slots is a good cross-reference.


903-903: ✓ Debouncing and AbortSignal examples are accurate and well-illustrated.

Both the concise debouncing example (line 903) and the Promise-based AbortSignal cleanup pattern (lines 930–936) correctly demonstrate the updated API, with proper clearTimeout and error handling on abort.

Also applies to: 930-936

@dwgray dwgray requested a review from VividLemon November 24, 2025 14:48
@dwgray
Copy link
Member Author

dwgray commented Nov 24, 2025

@VividLemon This is ready to go - I’m not 100% I like the icon positioning on the far right - but that’s what BSV did, and it wasn’t trivial to give the option to continue to inline them (unless I missed something in CSS’s abilities). I think this is the better solution overall...

@VividLemon VividLemon merged commit bae3932 into bootstrap-vue-next:main Dec 1, 2025
5 checks passed
Copilot AI added a commit that referenced this pull request Dec 15, 2025
- Add dark mode SVG icon variants with light colors (#dee2e6)
- Add CSS rules for prefers-color-scheme: dark media query
- Add CSS rules for [data-bs-theme="dark"] selector
- Replace currentColor with explicit colors for both light and dark modes
- Fixes regression from #2924 and #2933

Co-authored-by: dwgray <[email protected]>
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.

BTable sort icons changed

2 participants