Skip to content

Conversation

@civing
Copy link
Contributor

@civing civing commented Mar 6, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added pagination location control to position pagination UI at the top or bottom of tables.
    • New table pagination example component demonstrating pagination features.
  • Style

    • Improved active row styling with updated visual feedback and transitions.
    • Enhanced CSS variable usage for better theming control.
  • Chores

    • Upgraded tabulator library dependencies to latest versions.

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

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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

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

Walkthrough

Upgrades tabulator-tables from v4 to v6, refactoring type imports to explicit types instead of namespace imports across multiple files. Updates table initialization logic with a new createTabulator factory and event listener pattern. Adds paginationLocation prop to control pagination UI placement. Updates SCSS styling with CSS variables and selector renames. Removes custom type declaration file.

Changes

Cohort / File(s) Summary
Dependency upgrade
package.json
Updated tabulator-tables from ^4.9.3 to ^6.3.1 and @types/tabulator-tables from ^4.9.4 to ^6.2.4
Type refactoring (explicit imports)
src/components/table/columns.ts, src/components/table/table-selection.ts
Replaced Tabulator namespace imports with explicit type imports. Updated method/function signatures to use new types (CellComponent, ColumnDefinition, Formatter, RowComponent, ColumnComponent, SorterFromTable, ColumnCalc, TabulatorColumnDefinition, etc.). No behavioral changes.
Table component refactoring
src/components/table/table.tsx, src/components/table/table.spec.ts
Added paginationLocation prop for controlling pagination placement. Replaced direct Tabulator instantiation with createTabulator factory. Introduced initialized flag to track Tabulator build completion. Added event listeners (rowClick, dataSorting, pageLoaded, columnMoved, renderComplete, tableBuilt). Updated initialization/data loading logic. Updated all type signatures with explicit Tabulator types.
Styling updates with CSS variables
src/components/table/partial-styles/tabulator-custom-styles.scss, src/components/table/table.scss
Replaced hard-coded transition timings with CSS variables (limel-clickable-transition-speed, limel-clickable-transform-speed, etc.). Added active state styling for .tabulator-row. Renamed .tabulator-tableHolder to .tabulator-tableholder. Updated CSS variable for row active background color to use --mdc-theme-primary.
Styling structural changes
src/components/table/partial-styles/tabulator-arrow.scss, src/components/table/partial-styles/_table-main-layout.scss
Nested .tabulator-col-sorter styling under .tabulator .tabulator-header .tabulator-col .tabulator-col-content. Moved opacity control into .tabulator-sortable with explicit [aria-sort] state blocks. Added global rotate: 180deg to .tabulator-arrow. Renamed .tabulator-tableHolder to .tabulator-tableholder.
Type system cleanup
types/tabulator-tables/index.d.ts
Removed custom module declaration for 'tabulator-tables'. Relies on package-provided types in v6.
Pagination example
src/components/table/examples/table-pagination.tsx
New example component demonstrating table pagination with UI control to toggle pagination location (top/bottom)
Type annotation updates (tests)
src/components/table/table-selection.spec.ts
Added direct imports of CellComponent and RowComponent. Updated test helpers to use explicit types instead of Tabulator.*

Sequence Diagram

sequenceDiagram
    participant Component as Table Component
    participant Factory as createTabulator Factory
    participant Tabulator as Tabulator Instance
    participant Listeners as Event Listeners
    
    Component->>Factory: Call createTabulator(table)
    Factory->>Tabulator: Instantiate Tabulator
    Factory->>Listeners: Attach rowClick listener
    Factory->>Listeners: Attach dataSorting listener
    Factory->>Listeners: Attach pageLoaded listener
    Factory->>Listeners: Attach columnMoved listener
    Factory->>Listeners: Attach renderComplete listener
    Factory->>Listeners: Attach tableBuilt listener
    
    Tabulator->>Listeners: Emit tableBuilt event
    Listeners->>Component: Set initialized = true
    
    alt Remote Mode
        Component->>Tabulator: setData with AJAX (paginated)
    else Local Mode
        Component->>Tabulator: setData with local data
    end
    
    Tabulator->>Component: Render table with pagination
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • table.tsx initialization refactoring: New createTabulator factory pattern with multiple event listeners and initialized flag tracking requires careful review of flow and potential edge cases
  • Type annotation consistency: Verify all new explicit type imports (TabulatorColumnDefinition, TabulatorCellComponent, etc.) correctly align with v6 API across multiple files
  • CSS variable usage: Confirm transition timing variables and opacity states work correctly across tabulator-custom-styles.scss, tabulator-arrow.scss, and table.scss
  • Pagination configuration: Review paginationMode, paginationOptions, and ajaxParams changes for correctness
  • Removal of custom type declarations: Ensure v6's bundled types provide all necessary type definitions previously in types/tabulator-tables/index.d.ts

Possibly related PRs

  • PR #3482: Modifies table initialization/render lifecycle in table.tsx with renderComplete handler and flag deferral logic, overlapping initialization pattern changes
  • PR #3713: Updates table partial styles (_table-main-layout.scss, tabulator-custom-styles.scss) and pagination/selector visibility, with shared .tabulator-tableHolder renaming
  • PR #3721: Modifies table SCSS (tabulator-custom-styles.scss) and pagination/row-selector positioning with overlapping styling selector changes

Suggested labels

maintenance

Suggested reviewers

  • jgroth
  • adrianschmidt

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of the PR: upgrading the Tabulator library from version 4 to version 6, which encompasses all file changes including dependencies, type updates, and component adjustments.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.

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.

@github-actions
Copy link

github-actions bot commented Mar 6, 2025

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3478/

@Kiarokh
Copy link
Contributor

Kiarokh commented Mar 12, 2025

Not sure if anything from this old PR is useful here. But might be worth to double check #1712

@jgroth jgroth force-pushed the upgrade-tabulator branch from 537e3ab to 8803277 Compare June 19, 2025 13:07
@jgroth
Copy link
Contributor

jgroth commented Jun 19, 2025

Not sure if anything from this old PR is useful here. But might be worth to double check #1712

I checked the old PR and made some updates. All examples seems to work now

@Kiarokh
Copy link
Contributor

Kiarokh commented Jun 24, 2025

Not sure if anything from this old PR is useful here. But might be worth to double check #1712

I checked the old PR and made some updates. All examples seems to work now

I had a quick look. It seems the only thing that is different is our customization for the sorting icon in column headers which is gone now. But maybe we can live with that (if the directions are as we intended them to be, as described in here: https://github.com/Lundalogik/crm-feature/issues/4413) I need to check

@jgroth

This comment was marked as resolved.

@Kiarokh Kiarokh mentioned this pull request Jun 25, 2025
18 tasks
@Kiarokh Kiarokh force-pushed the upgrade-tabulator branch from f78bd9c to 8b63269 Compare July 8, 2025 09:31
@Kiarokh Kiarokh marked this pull request as ready for review July 9, 2025 14:20
@Kiarokh Kiarokh requested a review from a team as a code owner July 9, 2025 14:20
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: 4

🔭 Outside diff range comments (1)
src/components/table/table.scss (1)

72-78: Hover rule will never match – wrong element combination

.tabulator-sortable.tabulator-col-sorter-element requires both classes on the same node.
In Tabulator 6 the sorter element is inside .tabulator-sortable, not the same element.
Result: header hover background is lost.

Apply either of the following fixes:

-&.tabulator-sortable.tabulator-col-sorter-element {
-    &:hover {
-        background-color: rgb(var(--table-header-background-color--hover));
-    }
-}
+.tabulator-sortable:hover {
+    background-color: rgb(var(--table-header-background-color--hover));
+}

or, if you really want to scope to the sorter element:

-.tabulator-sortable.tabulator-col-sorter-element:hover
+.tabulator-sortable .tabulator-col-sorter-element:hover
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9752288 and aed856a.

⛔ Files ignored due to path filters (2)
  • etc/lime-elements.api.md is excluded by !etc/lime-elements.api.md
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • package.json (2 hunks)
  • src/components/table/columns.ts (9 hunks)
  • src/components/table/examples/table-pagination.tsx (1 hunks)
  • src/components/table/partial-styles/_row-selection.scss (1 hunks)
  • src/components/table/partial-styles/_table-main-layout.scss (1 hunks)
  • src/components/table/partial-styles/tabulator-arrow.scss (4 hunks)
  • src/components/table/partial-styles/tabulator-custom-styles.scss (2 hunks)
  • src/components/table/table-selection.spec.ts (3 hunks)
  • src/components/table/table-selection.ts (6 hunks)
  • src/components/table/table.scss (3 hunks)
  • src/components/table/table.tsx (20 hunks)
  • types/tabulator-tables/index.d.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • types/tabulator-tables/index.d.ts
🧰 Additional context used
📓 Path-based instructions (6)
`src/components/**/*.scss`: Do not use BEM-style class names in component CSS files, as components use shadow-DOM.

src/components/**/*.scss: Do not use BEM-style class names in component CSS files, as components use shadow-DOM.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/css-class-names-in-components-using-shadow-dom.mdc)

List of files the instruction was applied to:

  • src/components/table/partial-styles/_row-selection.scss
  • src/components/table/partial-styles/_table-main-layout.scss
  • src/components/table/partial-styles/tabulator-custom-styles.scss
  • src/components/table/table.scss
  • src/components/table/partial-styles/tabulator-arrow.scss
`**/*.{tsx,scss}`: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

**/*.{tsx,scss}: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/partial-styles/_row-selection.scss
  • src/components/table/partial-styles/_table-main-layout.scss
  • src/components/table/partial-styles/tabulator-custom-styles.scss
  • src/components/table/table.scss
  • src/components/table/examples/table-pagination.tsx
  • src/components/table/partial-styles/tabulator-arrow.scss
  • src/components/table/table.tsx
`**/*.{ts,tsx}`: Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

**/*.{ts,tsx}: Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/table-selection.spec.ts
  • src/components/table/table-selection.ts
  • src/components/table/examples/table-pagination.tsx
  • src/components/table/columns.ts
  • src/components/table/table.tsx
`**/*.{tsx,jsx}`: When returning multiple JSX elements from the `render` method,...

**/*.{tsx,jsx}: When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element. When there is already a single top-level element, it does not have to be wrapped in <Host>.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc)

List of files the instruction was applied to:

  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
`**/*.tsx`: Our `.tsx` files are typically using StencilJS, not React. When a de...

**/*.tsx: Our .tsx files are typically using StencilJS, not React. When a developer wants to return multiple top-level JSX elements from the render method, they will sometimes wrap them in an array literal. In these cases, rather than recommending they add key properties to the elements, recommend removing the hardcoded array literal. Recommend wrapping the elements in StencilJS's special <Host> element.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
`src/components/**/examples/**/*.{ts,tsx}`: These files are an exception to the ...

src/components/**/examples/**/*.{ts,tsx}: These files are an exception to the rule that all imports should use relative paths. When these example files import something that is publically exported by lime-elements, the import should be made from @limetech/lime-elements. If they import something from another file inside the example folder, the import should use a relative path.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/examples/table-pagination.tsx
🧠 Learnings (10)
src/components/table/partial-styles/_row-selection.scss (1)
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3518
File: src/components/chip-set/chip-set.tsx:367-385
Timestamp: 2025-04-14T12:22:22.298Z
Learning: In limel-chip-set, the onClick handler should be placed on the content div (<div slot="content">) rather than on the limel-notched-outline component, and should only be applied when type is 'input'.
src/components/table/partial-styles/_table-main-layout.scss (1)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
src/components/table/partial-styles/tabulator-custom-styles.scss (2)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3539
File: src/components/text-editor/text-editor.scss:14-14
Timestamp: 2025-04-24T10:16:05.891Z
Learning: In SCSS, prefer using `calc()` function over native SCSS arithmetic operations (like `$variable / 2`) as it aligns with modern SASS recommendations for better CSS compatibility and interoperability with CSS variables.
src/components/table/table.scss (1)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
src/components/table/table-selection.spec.ts (2)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with @beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.
src/components/table/table-selection.ts (1)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
src/components/table/examples/table-pagination.tsx (4)
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with @beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. Example files should only import public exports from '@limetech/lime-elements' or use relative imports for other files within the examples folder. Duplicating simple type definitions in example files is preferred over importing internal types.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T14:27:29.714Z
Learning: In example components (typically found in `src/components/*/examples/`), imports of lime-elements exports should use `@limetech/lime-elements` instead of relative paths. This is because example components aren't included in type declarations and are used in documentation to show developers how to properly use lime-elements components.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
src/components/table/partial-styles/tabulator-arrow.scss (2)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3529
File: src/components/lime-ai-avatar/lime-ai-avatar.scss:0-0
Timestamp: 2025-04-25T14:23:48.175Z
Learning: The `rotate` CSS property (from CSS Transforms Level 2) should be preferred over `transform: rotate()` in cases where multiple independent transformations need to be animated simultaneously to avoid animation conflicts. If all transformations used the `transform` property, they would override each other.
src/components/table/columns.ts (1)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
src/components/table/table.tsx (7)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T14:27:29.714Z
Learning: In example components (typically found in `src/components/*/examples/`), imports of lime-elements exports should use `@limetech/lime-elements` instead of relative paths. This is because example components aren't included in type declarations and are used in documentation to show developers how to properly use lime-elements components.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. Example files should only import public exports from '@limetech/lime-elements' or use relative imports for other files within the examples folder. Duplicating simple type definitions in example files is preferred over importing internal types.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3581
File: src/components/chip-set/chip-set.tsx:626-626
Timestamp: 2025-07-02T12:49:21.522Z
Learning: When contributors add new props to existing components in the lime-elements repository, they should always add documentation examples that demonstrate the new prop's usage and explain how it works. This helps with user adoption, feature discoverability, and maintains comprehensive documentation.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with @beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3518
File: src/components/notched-outline/examples/notched-outline-basic.scss:11-22
Timestamp: 2025-04-14T10:01:18.721Z
Learning: Examples in Lime Elements use Shadow DOM (with `shadow: true` in the component decorator) for style encapsulation, making additional class-based selectors unnecessary. This ensures styles are automatically scoped to each component without leaking to the rest of the application.
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc:0-0
Timestamp: 2025-07-01T14:43:09.742Z
Learning: Applies to **/*.{tsx,jsx} : When returning multiple JSX elements from the `render` method, never wrap them in an array literal. Instead, always wrap them in the special `<Host>` element. When there is already a single top-level element, it does not have to be wrapped in `<Host>`.
🧬 Code Graph Analysis (3)
src/components/table/examples/table-pagination.tsx (3)
src/components/table/table.tsx (1)
  • Component (58-933)
src/components/table/table.types.ts (1)
  • Column (5-45)
src/components/select/option.types.ts (1)
  • Option (7-56)
src/components/table/columns.ts (2)
src/components/table/table.types.ts (2)
  • Column (5-45)
  • ColumnSorter (122-132)
src/components/table/element-pool.ts (1)
  • ElementPool (1-67)
src/components/table/table.tsx (1)
src/components/table/table.types.ts (2)
  • ColumnSorter (122-132)
  • Column (5-45)
🪛 Biome (1.9.4)
src/components/table/table.tsx

[error] 221-221: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


[error] 548-548: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (25)
src/components/table/partial-styles/_table-main-layout.scss (1)

19-27: No remaining .tabulator-tableHolder references
Search across the codebase found only the new lowercase .tabulator-tableholder, confirming the old selector has been fully replaced.

src/components/table/table.scss (1)

52-57: Selector rename looks good

Alignment with Tabulator 6’s .tabulator-tableholder is correct.

src/components/table/partial-styles/tabulator-custom-styles.scss (1)

164-170: :has() selector – double-check Firefox & old Safari support

The :has() pseudo-class is still absent in Firefox ESR and some enterprise browsers.
If table pagination placement is critical, provide a graceful fallback (e.g., additional host class toggled via JS).

src/components/table/table-selection.spec.ts (2)

1-1: LGTM: Consistent import refactoring for Tabulator upgrade

The change from default import to named imports aligns with the broader refactor to use explicit Tabulator type imports throughout the codebase.


44-44: LGTM: Type annotations updated correctly

The type annotations for makeCell and makeRow functions are properly updated to use the imported CellComponent and RowComponent types directly, maintaining consistency with the new import structure.

Also applies to: 60-63

src/components/table/table-selection.ts (2)

2-7: LGTM: Well-structured import refactoring

The migration from default import to named imports with clear aliases (e.g., TabulatorCellComponent, TabulatorRowComponent) improves type clarity and aligns with the Tabulator version 6 upgrade.


140-142: LGTM: Good defensive programming practice

The guard clause prevents further processing when getPosition(true) returns false, which is a good safety measure for edge cases in the row selection logic.

src/components/table/partial-styles/tabulator-arrow.scss (3)

3-12: LGTM: Better CSS organization with nested selectors

The nested structure provides better specificity and organization for the tabulator column sorter styles, aligning with the Tabulator version 6 upgrade.


15-47: LGTM: Improved opacity and hover state handling

The restructured opacity controls with nested selectors provide cleaner separation between different sorting states (none, desc, asc) and their respective hover behaviors.


50-50: LGTM: Centralized arrow rotation

Moving the rotate: 180deg property directly to .tabulator-arrow centralizes the arrow direction styling, making it cleaner than applying rotation in individual state transforms.

src/components/table/examples/table-pagination.tsx (3)

1-8: LGTM: Correct imports following coding guidelines

The imports correctly use @limetech/lime-elements for public API types and components, following the established pattern for example files in the lime-elements project.


19-23: LGTM: Proper StencilJS component structure

The component follows StencilJS conventions correctly with proper decorators, shadow DOM usage, and component metadata.


44-63: LGTM: Effective pagination demonstration

The render method clearly demonstrates the pagination functionality with both the table component and interactive controls, wrapped correctly in the <Host> element as per StencilJS guidelines.

src/components/table/columns.ts (2)

2-9: LGTM: Consistent Tabulator type imports

The migration to named imports from tabulator-tables provides better type clarity and consistency with the broader codebase refactor for the Tabulator version 6 upgrade.


25-26: LGTM: Comprehensive type annotation updates

All function signatures and type annotations are properly updated to use the imported Tabulator types directly, maintaining type safety while improving clarity. The changes are consistent across all affected functions.

Also applies to: 92-92, 134-134, 159-159, 239-239, 274-274, 284-284

src/components/table/table.tsx (10)

11-24: LGTM! Proper migration to Tabulator v6 named imports.

The refactoring from default import to named imports aligns with Tabulator v6's export structure and improves tree-shaking capabilities.


46-46: Good addition of pagination example documentation.

Adding the example component reference helps developers discover and understand the new pagination location feature.


293-295: Good defensive check for table initialization.

Adding the initialized check prevents potential race conditions where data updates are attempted before the table is fully ready.


448-448: Proper state management during table destruction.

Resetting the initialized flag ensures the component state accurately reflects the table's lifecycle.


487-504: Excellent refactoring of tabulator initialization logic.

The createTabulator method properly encapsulates table creation, event handler setup, and initialization flow. Using the tableBuilt event to manage the initialized flag ensures data operations only occur after the table is fully constructed.


529-529: Proper type updates for Tabulator v6 compatibility.

The method signatures now use specific Tabulator types instead of generic ones, improving type safety and API alignment.

Also applies to: 547-547, 555-562, 564-564


658-669: Clean pagination configuration for Tabulator v6.

The updated pagination options with explicit pagination: true and paginationMode provide clearer intent and align with Tabulator v6's API structure.


742-744: Proper event propagation handling.

Checking defaultPrevented allows child elements to stop row activation when needed, improving component flexibility.


859-859: Proper implementation of pagination location rendering.

The render method correctly:

  1. Calculates total rows for accurate pagination display logic
  2. Applies CSS class based on paginationLocation prop
  3. Shows pagination based on actual row count vs page size

Also applies to: 865-865, 871-871


174-178: Pagination location styling confirmed

The paginationLocation prop is correctly typed ('top' | 'bottom'), reflected as an attribute, and defaults to 'bottom'. Custom SCSS covers the top placement, and the bottom placement falls back to Tabulator’s default styling.

• src/components/table/table.tsx – binds the class has-pagination-on-top when paginationLocation === 'top.
• src/components/table/partial-styles/tabulator-custom-styles.scss – defines the CSS rules under :host(.has-pagination-on-top) to reorder header/pagination.

Approving these changes.

@jgroth jgroth force-pushed the upgrade-tabulator branch from aed856a to 5b6b9fa Compare July 10, 2025 06:48
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: 4

🔭 Outside diff range comments (1)
src/components/table/table.scss (1)

72-78: Over-specific compound selector may miss future Tabulator changes
Coupling hover styles to both .tabulator-sortable and .tabulator-col-sorter-element risks losing the hover colour if Tabulator refactors its internal class list (it already changed once in v6). Prefer targeting .tabulator-sortable only, or add a fallback rule.

♻️ Duplicate comments (4)
src/components/table/partial-styles/_row-selection.scss (1)

18-18: Magic number 4px is still hard-coded
The earlier feedback about avoiding literal offsets hasn’t been addressed. If density or checkbox size changes, this value drifts again. Consider deriving it from $cell-padding or the checkbox size via calc() instead of functions.pxToRem(4).

src/components/table/partial-styles/tabulator-custom-styles.scss (1)

149-152: Selector rename – ensure no orphaned styles
Same caveat as before: verify there are no remaining .tabulator-tableHolder selectors elsewhere.

src/components/table/table.tsx (2)

221-221: Remove redundant type annotation.

The type annotation is unnecessary as TypeScript infers the boolean type from the initialization value.


621-624: Use optional chaining for safer property access.

The current implementation could throw if tabulator is null. Optional chaining provides a safer approach.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aed856a and 5b6b9fa.

⛔ Files ignored due to path filters (2)
  • etc/lime-elements.api.md is excluded by !etc/lime-elements.api.md
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • package.json (2 hunks)
  • src/components/table/columns.ts (9 hunks)
  • src/components/table/examples/table-pagination.tsx (1 hunks)
  • src/components/table/partial-styles/_row-selection.scss (1 hunks)
  • src/components/table/partial-styles/_table-main-layout.scss (1 hunks)
  • src/components/table/partial-styles/tabulator-arrow.scss (4 hunks)
  • src/components/table/partial-styles/tabulator-custom-styles.scss (2 hunks)
  • src/components/table/table-selection.spec.ts (3 hunks)
  • src/components/table/table-selection.ts (6 hunks)
  • src/components/table/table.scss (3 hunks)
  • src/components/table/table.tsx (20 hunks)
  • types/tabulator-tables/index.d.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • types/tabulator-tables/index.d.ts
🧰 Additional context used
📓 Path-based instructions (6)
`src/components/**/*.scss`: Do not use BEM-style class names in component CSS files, as components use shadow-DOM.

src/components/**/*.scss: Do not use BEM-style class names in component CSS files, as components use shadow-DOM.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/css-class-names-in-components-using-shadow-dom.mdc)

List of files the instruction was applied to:

  • src/components/table/partial-styles/_table-main-layout.scss
  • src/components/table/partial-styles/_row-selection.scss
  • src/components/table/table.scss
  • src/components/table/partial-styles/tabulator-custom-styles.scss
  • src/components/table/partial-styles/tabulator-arrow.scss
`**/*.{tsx,scss}`: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

**/*.{tsx,scss}: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/partial-styles/_table-main-layout.scss
  • src/components/table/partial-styles/_row-selection.scss
  • src/components/table/table.scss
  • src/components/table/partial-styles/tabulator-custom-styles.scss
  • src/components/table/partial-styles/tabulator-arrow.scss
  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
`**/*.{ts,tsx}`: Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

**/*.{ts,tsx}: Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/table-selection.spec.ts
  • src/components/table/table-selection.ts
  • src/components/table/examples/table-pagination.tsx
  • src/components/table/columns.ts
  • src/components/table/table.tsx
`**/*.{tsx,jsx}`: When returning multiple JSX elements from the `render` method,...

**/*.{tsx,jsx}: When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element. When there is already a single top-level element, it does not have to be wrapped in <Host>.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc)

List of files the instruction was applied to:

  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
`**/*.tsx`: Our `.tsx` files are typically using StencilJS, not React. When a de...

**/*.tsx: Our .tsx files are typically using StencilJS, not React. When a developer wants to return multiple top-level JSX elements from the render method, they will sometimes wrap them in an array literal. In these cases, rather than recommending they add key properties to the elements, recommend removing the hardcoded array literal. Recommend wrapping the elements in StencilJS's special <Host> element.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
`src/components/**/examples/**/*.{ts,tsx}`: These files are an exception to the ...

src/components/**/examples/**/*.{ts,tsx}: These files are an exception to the rule that all imports should use relative paths. When these example files import something that is publically exported by lime-elements, the import should be made from @limetech/lime-elements. If they import something from another file inside the example folder, the import should use a relative path.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/table/examples/table-pagination.tsx
🧠 Learnings (10)
src/components/table/partial-styles/_table-main-layout.scss (1)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
src/components/table/partial-styles/_row-selection.scss (2)
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3539
File: src/components/text-editor/text-editor.scss:14-14
Timestamp: 2025-04-24T10:16:05.891Z
Learning: In SCSS, prefer using `calc()` function over native SCSS arithmetic operations (like `$variable / 2`) as it aligns with modern SASS recommendations for better CSS compatibility and interoperability with CSS variables.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3518
File: src/components/chip-set/chip-set.tsx:367-385
Timestamp: 2025-04-14T12:22:22.298Z
Learning: In limel-chip-set, the onClick handler should be placed on the content div (<div slot="content">) rather than on the limel-notched-outline component, and should only be applied when type is 'input'.
src/components/table/table.scss (1)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
src/components/table/table-selection.spec.ts (2)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with @beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.
src/components/table/partial-styles/tabulator-custom-styles.scss (2)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3539
File: src/components/text-editor/text-editor.scss:14-14
Timestamp: 2025-04-24T10:16:05.891Z
Learning: In SCSS, prefer using `calc()` function over native SCSS arithmetic operations (like `$variable / 2`) as it aligns with modern SASS recommendations for better CSS compatibility and interoperability with CSS variables.
src/components/table/table-selection.ts (1)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
src/components/table/partial-styles/tabulator-arrow.scss (3)
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/css-class-names-in-components-using-shadow-dom.mdc:0-0
Timestamp: 2025-07-01T14:43:04.238Z
Learning: Applies to src/components/**/*.scss : Do not use BEM-style class names in component CSS files, as components use shadow-DOM.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3567
File: src/components/ai-avatar/ai-avatar.scss:0-0
Timestamp: 2025-05-28T08:37:45.610Z
Learning: In SCSS files, CSS property values can be split across multiple lines when properly indented, particularly for complex values like animation shorthands with CSS custom properties. This is valid SCSS syntax that compiles correctly to CSS and is often the result of auto-formatting tools.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3529
File: src/components/lime-ai-avatar/lime-ai-avatar.scss:0-0
Timestamp: 2025-04-25T14:23:48.175Z
Learning: The `rotate` CSS property (from CSS Transforms Level 2) should be preferred over `transform: rotate()` in cases where multiple independent transformations need to be animated simultaneously to avoid animation conflicts. If all transformations used the `transform` property, they would override each other.
src/components/table/examples/table-pagination.tsx (4)
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with @beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. Example files should only import public exports from '@limetech/lime-elements' or use relative imports for other files within the examples folder. Duplicating simple type definitions in example files is preferred over importing internal types.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T14:27:29.714Z
Learning: In example components (typically found in `src/components/*/examples/`), imports of lime-elements exports should use `@limetech/lime-elements` instead of relative paths. This is because example components aren't included in type declarations and are used in documentation to show developers how to properly use lime-elements components.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
src/components/table/columns.ts (1)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
src/components/table/table.tsx (7)
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3547
File: src/components/text-editor/examples/text-editor-with-inline-images-file-storage.tsx:46-46
Timestamp: 2025-05-02T07:14:19.314Z
Learning: When reviewing TypeScript/JavaScript code, don't suggest converting object literals to constants when the object is mutable and will be modified later in the code. Due to reference semantics, this can cause unintended side effects where the "constant" version is also modified.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T14:27:29.714Z
Learning: In example components (typically found in `src/components/*/examples/`), imports of lime-elements exports should use `@limetech/lime-elements` instead of relative paths. This is because example components aren't included in type declarations and are used in documentation to show developers how to properly use lime-elements components.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. Example files should only import public exports from '@limetech/lime-elements' or use relative imports for other files within the examples folder. Duplicating simple type definitions in example files is preferred over importing internal types.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3581
File: src/components/chip-set/chip-set.tsx:626-626
Timestamp: 2025-07-02T12:49:21.522Z
Learning: When contributors add new props to existing components in the lime-elements repository, they should always add documentation examples that demonstrate the new prop's usage and explain how it works. This helps with user adoption, feature discoverability, and maintains comprehensive documentation.
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with @beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.
Learnt from: adrianschmidt
PR: Lundalogik/lime-elements#3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like `EditorUiType` which are part of the component's public API.
Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc:0-0
Timestamp: 2025-07-01T14:43:09.742Z
Learning: Applies to **/*.{tsx,jsx} : When returning multiple JSX elements from the `render` method, never wrap them in an array literal. Instead, always wrap them in the special `<Host>` element. When there is already a single top-level element, it does not have to be wrapped in `<Host>`.
🧬 Code Graph Analysis (2)
src/components/table/columns.ts (2)
src/components/table/table.types.ts (2)
  • Column (5-45)
  • ColumnSorter (122-132)
src/components/table/element-pool.ts (1)
  • ElementPool (1-67)
src/components/table/table.tsx (1)
src/components/table/table.types.ts (2)
  • ColumnSorter (122-132)
  • Column (5-45)
🪛 Biome (1.9.4)
src/components/table/table.tsx

[error] 221-221: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


[error] 548-548: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ 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). (3)
  • GitHub Check: Docs / Publish Docs
  • GitHub Check: Build
  • GitHub Check: Test
🔇 Additional comments (20)
src/components/table/partial-styles/_table-main-layout.scss (1)

19-27: ✅ Renamed selector verified – no stale references found
A global search for both .tabulator-tableHolder and tabulatorTableHolder yielded no matches in TSX/JS/SCSS files. The selector rename to .tabulator-tableholder is safe to merge.

src/components/table/table.scss (1)

52-57: Verify Tabulator 6 table holder CSS class usage
Grep didn’t return any matches (the Tabulator bundle isn’t in this repo), so we need to confirm whether Tabulator 6 emits .tabulator-tableholder (all-lowercase) or still uses .tabulator-tableHolder. A mismatch will cause your theming rule to be ignored and you’ll lose text-color styling.

  • Location to verify:
    • src/components/table/table.scss (Lines 52–57)
        .tabulator-tableholder {
            .tabulator-table {
                color: var(--table-text-color);
                background-color: transparent;
            }
        }
  • Suggested checks:
    # Inspect installed Tabulator package
    grep -R "tableholder" node_modules/tabulator-tables
    grep -R "tableHolder" node_modules/tabulator-tables
  • Alternatively, open your app in the browser, inspect the table holder element in DevTools, and note the exact class name.

Ensure your SCSS selector matches the emitted class to preserve theming.

package.json (1)

61-61: ESM-Only Upgrade Verified—No Changes Needed
We’ve confirmed there are no default/namespace imports of tabulator-tables in the codebase and that @rollup/plugin-node-resolve is enabled in all stencil configs (stencil.config.ts, .dist.ts, .docs.ts). The ESM-only upgrade to tabulator-tables@6 can proceed without additional toolchain changes.

src/components/table/table-selection.spec.ts (2)

1-1: LGTM: Import structure updated for Tabulator v6

The change from namespace imports to explicit named imports aligns with the broader refactoring to upgrade Tabulator from v4 to v6. This improves type clarity and follows the new package structure.


44-44: Type annotations correctly updated

The type annotations have been properly updated to use the imported types directly (CellComponent, RowComponent) instead of the namespace-qualified versions (Tabulator.CellComponent, Tabulator.RowComponent).

Also applies to: 60-63

src/components/table/table-selection.ts (3)

2-7: LGTM: Import structure improved with explicit aliases

The change from default import to named imports with "Tabulator" prefixes improves type clarity and prevents naming conflicts. This aligns with the broader refactoring for Tabulator v6 upgrade.


87-88: Type annotations correctly updated

All type annotations have been properly updated to use the new imported type aliases (TabulatorColumnDefinition, TabulatorCellComponent, TabulatorRowComponent), maintaining consistency throughout the file.

Also applies to: 92-92, 111-111, 132-132, 172-172, 182-182


140-142: Good defensive programming with guard clause

The guard clause prevents further processing when getPosition(true) returns false, which can happen when the row is not found or in certain edge cases. This is a good defensive programming practice.

src/components/table/partial-styles/tabulator-arrow.scss (4)

3-12: CSS selector restructuring looks good

The nesting structure has been improved and the removal of !important flags from right and position properties suggests better CSS specificity management. This aligns with the Tabulator v6 upgrade requirements.


14-47: Opacity control restructuring improves organization

The opacity control has been better organized by moving it inside .tabulator-sortable with clearer separation between different sorting states. The nested structure makes the relationship between states more explicit.


49-50: Centralized arrow rotation is a good approach

Adding a global rotate: 180deg to .tabulator-arrow centralizes the rotation logic, which is cleaner than having rotation defined in each individual state. This follows the DRY principle and makes the styling more maintainable.


78-78: Transform simplification aligns with centralized rotation

Removing rotate(180deg) from individual state transforms and keeping only the translate3d operations is consistent with the centralized rotation approach. This simplifies the transform rules and reduces redundancy.

Also applies to: 89-89

src/components/table/examples/table-pagination.tsx (2)

1-8: Imports correctly follow example file guidelines

The imports properly use @limetech/lime-elements for public API types and components, which aligns with the coding guidelines for example files. The relative import for ./birds is appropriate for shared example data.


19-76: Well-structured example component

The component follows established Stencil patterns with proper decorators, state management, and event handling. It effectively demonstrates the new pagination functionality with both pageSize and paginationLocation properties, providing a clear example of how to use these features.

src/components/table/columns.ts (2)

2-9: Import structure properly updated for Tabulator v6

The change from namespace imports to explicit named imports improves type clarity and aligns with the Tabulator v6 upgrade pattern. Using SorterFromTable instead of a custom TabulatorSorter interface reduces custom type definitions in favor of official types.


25-26: Type annotations consistently updated

All function signatures and type annotations have been properly updated to use the imported Tabulator types directly. This maintains type safety while leveraging the official type definitions from the upgraded package.

Also applies to: 92-92, 108-108, 134-134, 159-159, 239-239, 274-274, 284-284

src/components/table/table.tsx (4)

11-24: LGTM! Good refactoring to use explicit named imports.

The change from generic imports to specific named imports from 'tabulator-tables' improves type safety, enables better tree-shaking, and makes dependencies more explicit.


487-504: Good refactoring of Tabulator initialization logic.

Extracting the table creation into a separate method improves code organization and makes the initialization flow clearer. The proper management of the initialized flag in the 'tableBuilt' event ensures components know when the table is ready.


742-744: Good addition of event propagation check.

Checking event.defaultPrevented before processing the row click is a best practice that respects event handling by other components and prevents unintended activations.


859-871: Proper implementation of pagination location styling.

The render method correctly implements the pagination location feature by:

  • Adding the appropriate CSS class based on the paginationLocation property
  • Properly calculating totalRows for pagination visibility
  • Following the existing pattern for conditional CSS classes

Copilot AI review requested due to automatic review settings July 28, 2025 14:28
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 upgrades the Tabulator table library from version 4 to version 6, introducing new features and improving the table component's functionality.

  • Updated Tabulator dependency from 4.9.3 to 6.3.1 with corresponding type definitions
  • Added pagination location control allowing positioning of pagination controls at top or bottom
  • Enhanced table initialization handling and improved type safety throughout the codebase

Reviewed Changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/components/table/table.tsx Updated imports, types, and initialization logic for Tabulator v6 compatibility; added pagination location feature
src/components/table/table.scss Fixed CSS class name and adjusted column header padding
src/components/table/table-selection.ts Updated imports and type definitions for Tabulator v6
src/components/table/table-selection.spec.ts Updated test types for Tabulator v6 compatibility
src/components/table/partial-styles/tabulator-custom-styles.scss Fixed CSS class name and adjusted select-all checkbox positioning
src/components/table/partial-styles/tabulator-arrow.scss Refactored sorting arrow styles and fixed arrow direction
src/components/table/partial-styles/_table-main-layout.scss Fixed CSS class name reference
src/components/table/partial-styles/_row-selection.scss Adjusted select-all checkbox positioning
src/components/table/examples/table-pagination.tsx Added new example demonstrating pagination location control
src/components/table/columns.ts Updated imports and type definitions for Tabulator v6
package.json Updated Tabulator dependencies to version 6
etc/lime-elements.api.md Added API documentation for new pagination location property

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

♻️ Duplicate comments (2)
src/components/table/table.tsx (2)

489-506: Good refactoring of initialization logic with one issue.

The extraction of tabulator creation improves code organization. However, the hardcoded URL on line 499 should use a configured value.

             if (this.isRemoteMode()) {
-                this.tabulator.setData('https://localhost');
+                const remoteUrl = 'https://localhost'; // This should match the URL used in getAjaxOptions
+                this.tabulator.setData(remoteUrl);
             } else {

623-626: Convert ajaxParams to a function for safer initialization.

The current implementation may evaluate this.tabulator methods before the instance is ready. Converting to a function ensures lazy evaluation.

-            ajaxParams: {
-                page: this.tabulator?.getPage() || FIRST_PAGE,
-                sorters: this.tabulator?.getSorters() || [],
-            },
+            ajaxParams: () => ({
+                page: this.tabulator?.getPage() || FIRST_PAGE,
+                sorters: this.tabulator?.getSorters() || [],
+            }),
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b6b9fa and dfffd65.

📒 Files selected for processing (1)
  • src/components/table/table.tsx (20 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc)

When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element. When there is already a single top-level element, it does not have to be wrapped in <Host>.

Files:

  • src/components/table/table.tsx

⚙️ CodeRabbit Configuration File

Our .tsx files are typically using StencilJS, not React. When a developer wants to return multiple top-level JSX elements from the render method, they will sometimes wrap them in an array literal. In these cases, rather than recommending they add key properties to the elements, recommend removing the hardcoded array literal. Recommend wrapping the elements in StencilJS's special <Host> element.

Files:

  • src/components/table/table.tsx
**/*.{ts,tsx}

⚙️ CodeRabbit Configuration File

Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

Files:

  • src/components/table/table.tsx
**/*.{tsx,scss}

⚙️ CodeRabbit Configuration File

Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

Files:

  • src/components/table/table.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: Kiarokh
PR: Lundalogik/lime-elements#3478
File: package.json:61-61
Timestamp: 2025-07-28T14:35:21.933Z
Learning: In Tabulator 6, the SCSS files are located in `dist/scss/tabulator.scss`, not in the old `src/scss/` path from version 4.x. The correct import path is `node_modules/tabulator-tables/dist/scss/tabulator.scss`.
src/components/table/table.tsx (9)

Learnt from: Kiarokh
PR: #3478
File: package.json:61-61
Timestamp: 2025-07-28T14:35:21.933Z
Learning: In Tabulator 6, the SCSS files are located in dist/scss/tabulator.scss, not in the old src/scss/ path from version 4.x. The correct import path is node_modules/tabulator-tables/dist/scss/tabulator.scss.

Learnt from: adrianschmidt
PR: #3547
File: src/components/text-editor/examples/text-editor-with-inline-images-file-storage.tsx:46-46
Timestamp: 2025-05-02T07:14:19.314Z
Learning: When reviewing TypeScript/JavaScript code, don't suggest converting object literals to constants when the object is mutable and will be modified later in the code. Due to reference semantics, this can cause unintended side effects where the "constant" version is also modified.

Learnt from: Kiarokh
PR: #3581
File: src/components/chip-set/chip-set.tsx:626-626
Timestamp: 2025-07-02T12:49:21.522Z
Learning: When contributors add new props to existing components in the lime-elements repository, they should always add documentation examples that demonstrate the new prop's usage and explain how it works. This helps with user adoption, feature discoverability, and maintains comprehensive documentation.

Learnt from: adrianschmidt
PR: #3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T14:27:29.714Z
Learning: In example components (typically found in src/components/*/examples/), imports of lime-elements exports should use @limetech/lime-elements instead of relative paths. This is because example components aren't included in type declarations and are used in documentation to show developers how to properly use lime-elements components.

Learnt from: Kiarokh
PR: #3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. Example files should only import public exports from '@limetech/lime-elements' or use relative imports for other files within the examples folder. Duplicating simple type definitions in example files is preferred over importing internal types.

Learnt from: Kiarokh
PR: #3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-16T14:14:18.253Z
Learning: For lime-elements, example files should be self-contained and avoid importing internal implementation details. This includes not importing types from internal files like '../types.ts', especially those marked with @beta. Duplicating simple type definitions in example files is preferred over importing internal types that may change.

Learnt from: adrianschmidt
PR: #3530
File: src/components/text-editor/examples/text-editor-composite.tsx:4-7
Timestamp: 2025-04-17T09:39:36.254Z
Learning: For lime-elements, example files should import types from the public API using '@limetech/lime-elements' rather than defining duplicate types locally. This includes types like EditorUiType which are part of the component's public API.

Learnt from: Kiarokh
PR: #3518
File: src/components/notched-outline/examples/notched-outline-basic.scss:11-22
Timestamp: 2025-04-14T10:01:18.721Z
Learning: Examples in Lime Elements use Shadow DOM (with shadow: true in the component decorator) for style encapsulation, making additional class-based selectors unnecessary. This ensures styles are automatically scoped to each component without leaking to the rest of the application.

Learnt from: CR
PR: Lundalogik/lime-elements#0
File: .cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc:0-0
Timestamp: 2025-07-21T00:28:01.726Z
Learning: Applies to **/*.tsx : When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element. When there is already a single top-level element, it does not have to be wrapped in <Host>.

🔇 Additional comments (9)
src/components/table/table.tsx (9)

11-24: Import changes align with Tabulator 6.x module structure.

The migration from default import to named imports is correct and required for Tabulator 6.x compatibility.


46-46: Good addition of example component for the new pagination feature.

Adding the pagination example follows best practices for documenting new component features.


174-180: Well-documented pagination location property.

The property is properly documented with clear JSDoc comments and appropriate decorator configuration.


294-297: Good defensive check for initialization state.

Adding the initialized flag check prevents potential race conditions during table initialization.


531-531: Proper type annotations for Tabulator 6.x.

All method signatures have been correctly updated with explicit Tabulator types, improving type safety.

Also applies to: 549-549, 557-561, 566-566, 609-609, 660-660, 710-710, 738-738


666-667: Correct pagination configuration for Tabulator 6.x.

The explicit pagination: true and paginationMode settings align with Tabulator 6.x API requirements.


744-746: Good practice: respecting event.defaultPrevented.

Checking defaultPrevented allows proper event handling composition with other components.


842-846: Appropriate guard clause for column movement.

The early return prevents unnecessary processing when column movement is disabled.


861-873: Render method correctly implements pagination location feature.

The CSS class addition and totalRows calculation properly support the new pagination positioning functionality.

@Kiarokh Kiarokh self-assigned this Jul 29, 2025
@Kiarokh Kiarokh removed their assignment Jul 31, 2025
@jgroth jgroth force-pushed the upgrade-tabulator branch from 57d8912 to f732054 Compare August 1, 2025 06:59
@jgroth jgroth force-pushed the upgrade-tabulator branch 2 times, most recently from 9cf3a8c to 9753dfd Compare September 22, 2025 09:20
updateOrAddData: jest.fn(),
};
(component as any).setSelection = jest.fn();
(component as any).initialized = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

@jgroth
All tests are now passing now! Do you still have problems on your device?

According to the intelligent fellas, the issue was that during the Tabulator upgrade, a new initialized property was added to the Table class, and the updateData method now checks for this property before executing:

if (!this.tabulator || !this.initialized) {
    return;
}

The tests were setting up the mock tabulator object but not setting initialized = true (table.tsx line 240) , so all the tabulator method calls were being skipped due to the early return.

The fix was to add (component as any).initialized = true; to the beforeEach block in the test file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great work!

@Kiarokh Kiarokh force-pushed the upgrade-tabulator branch 2 times, most recently from 152c50d to 33b9c73 Compare December 9, 2025 15:58
@Kiarokh
Copy link
Contributor

Kiarokh commented Dec 9, 2025

@coderabbitai please ignore the old "Copilot" review comments which are in this PR, and do a new fresh review from scratch

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

@Kiarokh: I'll perform a fresh, comprehensive review of this PR from scratch, focusing on the Tabulator v6 update and all the related changes. I'll ignore the previous automated review comments and provide new feedback on the entire changeset.


🧠 Learnings used
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 0
File: :0-0
Timestamp: 2025-11-27T12:31:25.573Z
Learning: In lime-elements code reviews, flag any removal of CSS custom properties (including those with `var(--property-name, fallback)` syntax) that doesn't include corresponding updates to all usage instances or backwards compatibility implementation in the same PR.
✅ Actions performed

Full review triggered.

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

Caution

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

⚠️ Outside diff range comments (3)
src/components/table/table.scss (1)

3-3: Update SCSS import path for Tabulator v6.

The import path uses the deprecated v4.x location. For Tabulator 6, change the import to:

@import '../../../node_modules/tabulator-tables/dist/scss/tabulator.scss';
src/components/table/table.tsx (1)

797-803: Mark arrow function members as readonly.

SonarCloud correctly identifies that getActiveRows, getColumnOptions, handleMoveColumn, and findColumn are never reassigned. Marking them as readonly prevents accidental reassignment.

-    private getActiveRows: () => TabulatorRowComponent[] = () => {
+    private readonly getActiveRows: () => TabulatorRowComponent[] = () => {

Apply similar changes to getColumnOptions (line 873), handleMoveColumn (line 883), and findColumn (line 892).

src/components/table/table-selection.ts (1)

184-191: Mark as readonly for consistency.

Same as in table.tsx, this arrow function member should be marked readonly to prevent accidental reassignment.

-    private getActiveRows: () => TabulatorRowComponent[] = () => {
+    private readonly getActiveRows: () => TabulatorRowComponent[] = () => {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82bfa3b and 33b9c73.

⛔ Files ignored due to path filters (2)
  • etc/lime-elements.api.md is excluded by !etc/lime-elements.api.md
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • package.json (2 hunks)
  • src/components/table/columns.ts (9 hunks)
  • src/components/table/examples/table-pagination.tsx (1 hunks)
  • src/components/table/partial-styles/_table-main-layout.scss (1 hunks)
  • src/components/table/partial-styles/tabulator-arrow.scss (4 hunks)
  • src/components/table/partial-styles/tabulator-custom-styles.scss (5 hunks)
  • src/components/table/table-selection.spec.ts (3 hunks)
  • src/components/table/table-selection.ts (6 hunks)
  • src/components/table/table.scss (3 hunks)
  • src/components/table/table.spec.ts (1 hunks)
  • src/components/table/table.tsx (20 hunks)
  • types/tabulator-tables/index.d.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • types/tabulator-tables/index.d.ts
🧰 Additional context used
📓 Path-based instructions (6)
src/components/**/*.scss

📄 CodeRabbit inference engine (.cursor/rules/css-class-names-in-components-using-shadow-dom.mdc)

Do not use BEM-style class names in CSS for components, as components use shadow-DOM.

Files:

  • src/components/table/partial-styles/_table-main-layout.scss
  • src/components/table/partial-styles/tabulator-arrow.scss
  • src/components/table/partial-styles/tabulator-custom-styles.scss
  • src/components/table/table.scss
**/*.{tsx,scss}

⚙️ CodeRabbit configuration file

**/*.{tsx,scss}: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

Files:

  • src/components/table/partial-styles/_table-main-layout.scss
  • src/components/table/partial-styles/tabulator-arrow.scss
  • src/components/table/examples/table-pagination.tsx
  • src/components/table/partial-styles/tabulator-custom-styles.scss
  • src/components/table/table.tsx
  • src/components/table/table.scss
**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

**/*.{ts,tsx}: Imports from other files in the same module (lime-elements) must use relative paths. Using absolute paths for imports will cause the production build to fail.

Files:

  • src/components/table/table.spec.ts
  • src/components/table/table-selection.spec.ts
  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
  • src/components/table/table-selection.ts
  • src/components/table/columns.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/wrap-multiple-jsx-elements-in-host-not-in-array.mdc)

When returning multiple JSX elements from the render method, never wrap them in an array literal. Instead, always wrap them in the special <Host> element. When there is already a single top-level element, it does not have to be wrapped in <Host>.

Files:

  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx

⚙️ CodeRabbit configuration file

**/*.tsx: Our .tsx files are typically using StencilJS, not React. When a developer wants to return multiple top-level JSX elements from the render method, they will sometimes wrap them in an array literal. In these cases, rather than recommending they add key properties to the elements, recommend removing the hardcoded array literal. Recommend wrapping the elements in StencilJS's special <Host> element.

Files:

  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
src/components/**/examples/**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

src/components/**/examples/**/*.{ts,tsx}: These files are an exception to the rule that all imports should use relative paths. When these example files import something that is publicly exported by lime-elements, the import should be made from @limetech/lime-elements. If they import something from another file inside the example folder, the import should use a relative path.

Files:

  • src/components/table/examples/table-pagination.tsx
src/components/**/*.tsx

⚙️ CodeRabbit configuration file

src/components/**/*.tsx: When contributors add new props to existing components in the lime-elements repository, they should always add documentation examples that demonstrate the new prop's usage and explain how it works. This helps with user adoption, feature discoverability, and maintains comprehensive documentation.

Files:

  • src/components/table/examples/table-pagination.tsx
  • src/components/table/table.tsx
🧠 Learnings (13)
📓 Common learnings
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3478
File: package.json:61-61
Timestamp: 2025-07-28T14:35:21.965Z
Learning: In Tabulator 6, the SCSS files are located in `dist/scss/tabulator.scss`, not in the old `src/scss/` path from version 4.x. The correct import path is `node_modules/tabulator-tables/dist/scss/tabulator.scss`.
📚 Learning: 2025-07-28T14:35:21.965Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3478
File: package.json:61-61
Timestamp: 2025-07-28T14:35:21.965Z
Learning: In Tabulator 6, the SCSS files are located in `dist/scss/tabulator.scss`, not in the old `src/scss/` path from version 4.x. The correct import path is `node_modules/tabulator-tables/dist/scss/tabulator.scss`.

Applied to files:

  • src/components/table/partial-styles/_table-main-layout.scss
  • src/components/table/table-selection.spec.ts
  • src/components/table/partial-styles/tabulator-arrow.scss
  • package.json
  • src/components/table/partial-styles/tabulator-custom-styles.scss
  • src/components/table/table.tsx
  • src/components/table/table-selection.ts
  • src/components/table/columns.ts
  • src/components/table/table.scss
📚 Learning: 2025-03-04T14:27:29.714Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T14:27:29.714Z
Learning: In example components (typically found in `src/components/*/examples/`), imports of lime-elements exports should use `limetech/lime-elements` instead of relative paths. This is because example components aren't included in type declarations and are used in documentation to show developers how to properly use lime-elements components.

Applied to files:

  • package.json
  • src/components/table/table.tsx
📚 Learning: 2025-03-04T13:48:44.712Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3464
File: src/components/text-editor/prosemirror-adapter/plugins/image/inserter.ts:1-11
Timestamp: 2025-03-04T13:48:44.712Z
Learning: The lime-elements codebase must use relative imports (even with multiple "../") rather than alias imports or re-exports because they export types to `<repo-root>/dist/types`. Using non-relative imports breaks type generation as import paths from generated type files point to full .ts files rather than .d.ts files.

Applied to files:

  • package.json
📚 Learning: 2025-11-27T12:31:25.573Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 0
File: :0-0
Timestamp: 2025-11-27T12:31:25.573Z
Learning: In lime-elements, custom CSS properties (e.g., `--example-controls-column-layout`) must be treated as component APIs. Before removing or renaming any CSS custom property, all usage instances must be identified and addressed in the same PR, with backwards compatibility implemented if needed.

Applied to files:

  • src/components/table/partial-styles/tabulator-custom-styles.scss
📚 Learning: 2025-11-27T12:31:25.573Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 0
File: :0-0
Timestamp: 2025-11-27T12:31:25.573Z
Learning: In lime-elements code reviews, flag any removal of CSS custom properties (including those with `var(--property-name, fallback)` syntax) that doesn't include corresponding updates to all usage instances or backwards compatibility implementation in the same PR.

Applied to files:

  • src/components/table/partial-styles/tabulator-custom-styles.scss
📚 Learning: 2025-04-25T14:22:02.157Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3529
File: src/components/lime-ai-avatar/lime-ai-avatar.scss:24-28
Timestamp: 2025-04-25T14:22:02.157Z
Learning: In lime-elements, CSS custom properties follow a specific naming convention:
1. Internal use variables (not for consumers) are prefixed with `--limel-component-name-`
2. External use variables (intended for consumers) are prefixed with `--component-name-`
Variables documented with JSDoc comments are typically meant for external use.

Applied to files:

  • src/components/table/partial-styles/tabulator-custom-styles.scss
📚 Learning: 2025-07-02T12:49:21.522Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3581
File: src/components/chip-set/chip-set.tsx:626-626
Timestamp: 2025-07-02T12:49:21.522Z
Learning: When contributors add new props to existing components in the lime-elements repository, they should always add documentation examples that demonstrate the new prop's usage and explain how it works. This helps with user adoption, feature discoverability, and maintains comprehensive documentation.

Applied to files:

  • src/components/table/table.tsx
📚 Learning: 2025-08-21T15:57:46.879Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3628
File: src/components/list-item/examples/list-item-actions.tsx:40-63
Timestamp: 2025-08-21T15:57:46.879Z
Learning: The examples in src/components/list-item/examples/ are for internal usage and verification, not for external developers. The actual consumers of limel-list-item are other internal components like limel-list or limel-menu-list. These examples should be taken with a pinch of salt regarding semantic correctness and accessibility, as the proper implementation will be handled by the consuming components.

Applied to files:

  • src/components/table/table.tsx
📚 Learning: 2025-08-26T08:42:17.994Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3628
File: src/components/list-item/list-item.tsx:316-321
Timestamp: 2025-08-26T08:42:17.994Z
Learning: In src/components/list-item/list-item.tsx, the RadioButtonTemplate and CheckboxTemplate components are used purely for visualization and receive their checked state from the parent component's selected prop. The actual interaction is handled by a centralized onClick handler on the Host element, making the entire list item clickable. Adding onChange handlers to these templates would be redundant and potentially problematic.

Applied to files:

  • src/components/table/table-selection.ts
📚 Learning: 2025-04-24T10:16:05.891Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3539
File: src/components/text-editor/text-editor.scss:14-14
Timestamp: 2025-04-24T10:16:05.891Z
Learning: In SCSS, prefer using `calc()` function over native SCSS arithmetic operations (like `$variable / 2`) as it aligns with modern SASS recommendations for better CSS compatibility and interoperability with CSS variables.

Applied to files:

  • src/components/table/table.scss
📚 Learning: 2025-07-30T14:20:41.791Z
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3624
File: src/components/button-group/button-group.scss:115-118
Timestamp: 2025-07-30T14:20:41.791Z
Learning: In lime-elements, CSS custom properties like `--limel-theme-surface-background-color` are applied at :root level via `core-styles.scss` and should be expected to be available without fallbacks. The library's architecture guarantees these theme variables are present, so adding fallbacks would be redundant and go against the design intention.

Applied to files:

  • src/components/table/table.scss
📚 Learning: 2025-10-12T21:44:29.530Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3703
File: context7.json:24-24
Timestamp: 2025-10-12T21:44:29.530Z
Learning: In the lime-elements repository, CSS custom properties follow a two-tier naming convention: `--lime-*` properties are public API intended for external consumers and are documented in theming guides (e.g., `--lime-primary-color`, `--lime-on-primary-color`), while `--limel-*` properties are internal implementation details used as fallbacks and are not documented for public use (e.g., `--limel-theme-primary-color`). The `--lime-` prefix is used specifically to avoid naming conflicts with third-party code.

Applied to files:

  • src/components/table/table.scss
🧬 Code graph analysis (3)
src/components/table/examples/table-pagination.tsx (3)
src/components/table/table.tsx (1)
  • Component (61-982)
src/components/table/table.types.ts (1)
  • Column (5-45)
src/components/select/option.types.ts (1)
  • Option (7-56)
src/components/table/table.tsx (1)
src/components/table/table.types.ts (2)
  • ColumnSorter (122-132)
  • Column (5-45)
src/components/table/columns.ts (2)
src/components/table/table.types.ts (2)
  • Column (5-45)
  • ColumnSorter (122-132)
src/components/table/element-pool.ts (1)
  • ElementPool (1-67)
🪛 GitHub Check: SonarCloud Code Analysis
src/components/table/examples/table-pagination.tsx

[warning] 42-42: Member 'pageSize' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQJe2zwRe71M66V9&open=AZr-mQJe2zwRe71M66V9&pullRequest=3478


[warning] 37-37: Member 'paginationLocationOptions' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQJe2zwRe71M66V8&open=AZr-mQJe2zwRe71M66V8&pullRequest=3478


[warning] 71-71: Member 'handlePaginationLocationChange' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQJe2zwRe71M66V_&open=AZr-mQJe2zwRe71M66V_&pullRequest=3478


[warning] 65-65: Member 'getSelectedPaginationLocation' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQJe2zwRe71M66V-&open=AZr-mQJe2zwRe71M66V-&pullRequest=3478


[warning] 26-26: Member 'columns' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQJe2zwRe71M66V7&open=AZr-mQJe2zwRe71M66V7&pullRequest=3478

src/components/table/table.tsx

[warning] 797-797: Member 'getActiveRows' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQLi2zwRe71M66WB&open=AZr-mQLi2zwRe71M66WB&pullRequest=3478


[warning] 873-873: Member 'getColumnOptions' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQLi2zwRe71M66WC&open=AZr-mQLi2zwRe71M66WC&pullRequest=3478


[warning] 883-883: Member 'handleMoveColumn' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQLi2zwRe71M66WD&open=AZr-mQLi2zwRe71M66WD&pullRequest=3478


[warning] 892-892: Member 'findColumn' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQLi2zwRe71M66WE&open=AZr-mQLi2zwRe71M66WE&pullRequest=3478

src/components/table/table-selection.ts

[warning] 184-184: Member 'getActiveRows' is never reassigned; mark it as readonly.

See more on https://sonarcloud.io/project/issues?id=Lundalogik_lime-elements&issues=AZr-mQKQ2zwRe71M66WA&open=AZr-mQKQ2zwRe71M66WA&pullRequest=3478

🔇 Additional comments (30)
package.json (1)

54-54: LGTM! Major version upgrade to Tabulator 6.

The dependency upgrades from v4 to v6 are correctly reflected for both the library and its type definitions.

Also applies to: 93-93

src/components/table/partial-styles/tabulator-arrow.scss (3)

3-12: LGTM! Nesting updated for Tabulator v6 DOM structure.

The updated selector nesting correctly targets the sorter element within Tabulator v6's new DOM hierarchy.


14-47: LGTM! Cleaner opacity control via ARIA attributes.

The refactored opacity handling using aria-sort attributes provides better semantic structure and separates sorted/unsorted states cleanly.


49-94: LGTM! Centralized arrow rotation.

Moving the rotate: 180deg to the base .tabulator-arrow selector and removing per-state rotations simplifies the transform logic while maintaining the correct sorting direction convention.

src/components/table/partial-styles/tabulator-custom-styles.scss (4)

16-37: LGTM! Improved transition control with CSS variables.

Replacing hard-coded timing values with CSS variables (--limel-clickable-transition-speed, --limel-clickable-transform-speed, --limel-clickable-transform-timing-function) provides better consistency and allows for easier customization.


69-69: LGTM! Hover background color added.

The hover state now correctly applies the background color using the --table-row-background-color--hover variable.


104-121: LGTM! Refined active state feedback.

The changes improve the active row interaction:

  • Reduced transform (0.08rem → 0.05rem) for more subtle press feedback
  • New active state styling with opacity, background color, and inset shadow provides clear visual feedback for selected rows

191-191: LGTM! Selector renamed for Tabulator v6.

The class name update from .tabulator-tableHolder to .tabulator-tableholder aligns with Tabulator v6's updated class naming convention.

Also applies to: 207-207

src/components/table/partial-styles/_table-main-layout.scss (1)

19-19: LGTM! Selector renamed for Tabulator v6.

Consistent with other styling files, the class name is updated to .tabulator-tableholder to match Tabulator v6's class naming.

src/components/table/table.spec.ts (1)

14-14: LGTM! Test setup updated for Tabulator v6 initialization.

Setting initialized = true in the test setup correctly reflects the new initialization flow introduced with Tabulator v6, where the component checks this flag before executing tabulator methods.

src/components/table/table.scss (3)

27-27: LGTM! Active row styling updated to use primary theme color.

Using --mdc-theme-primary for the active row background provides better visual prominence and theme consistency compared to the previous --contrast-300.


55-55: LGTM! Selector renamed for Tabulator v6.

Consistent with other files, the class name is updated to .tabulator-tableholder to match Tabulator v6's naming convention.


75-75: LGTM! More specific hover selector.

Adding .tabulator-col-sorter-element to the hover selector ensures the background color change only applies to columns with sorting enabled, preventing unintended hover effects on non-sortable columns.

src/components/table/table-selection.spec.ts (1)

1-1: LGTM! Updated to use Tabulator v6's explicit type exports.

The changes correctly migrate from namespace-based types (Tabulator.CellComponent, Tabulator.RowComponent) to explicit named imports (CellComponent, RowComponent), aligning with Tabulator v6's updated type definitions.

Also applies to: 45-72

src/components/table/examples/table-pagination.tsx (1)

1-76: LGTM! Well-documented example for the new pagination feature.

The example correctly demonstrates the new paginationLocation prop with:

  • Clear JSDoc documentation
  • Interactive controls to toggle pagination location
  • Proper imports from @limetech/lime-elements (as required for example files)
  • Shadow DOM correctly enabled

As per coding guidelines, new props should include documentation examples, and this file fulfills that requirement perfectly.

src/components/table/table.tsx (8)

11-24: LGTM! Explicit type imports align with Tabulator v6 best practices.

The migration from namespace imports to explicit named imports is the correct approach for Tabulator v6 and improves tree-shaking potential.


191-197: LGTM! Well-documented new property.

The paginationLocation prop is properly documented with JSDoc, has appropriate type constraints, and includes a sensible default. The example component limel-example-table-pagination is referenced in the component's example list.


240-240: LGTM! Initialization flag properly tracks Tabulator readiness.

The initialized flag correctly guards against race conditions by preventing data operations until the tableBuilt event fires.


526-543: Good refactoring to factory method with event-based initialization.

The createTabulator factory properly:

  1. Uses TabulatorFull for full feature access in Tabulator v6
  2. Attaches event listeners using the .on() method (idiomatic for v6)
  3. Defers initial data loading until tableBuilt fires, preventing race conditions

The hardcoded 'https://localhost' on line 536 is intentional and safe—the comment on lines 654-656 explains this URL is never actually used since ajaxRequestFunc intercepts all requests.


663-666: Acceptable fallback logic with optional chaining.

The optional chaining (?.) prevents null dereference. Using || instead of ?? for getPage() is reasonable since you want to fallback to FIRST_PAGE for any falsy value (including 0 or false), not just null/undefined.


700-711: Correct migration to Tabulator v6 pagination API.

The pagination configuration correctly uses the v6 pattern with pagination: true and separate paginationMode property, replacing the v4 approach where the mode was passed directly to pagination.


778-795: LGTM! Proper event handling with defaultPrevented guard.

The event.defaultPrevented check at lines 784-786 correctly allows child components (like row selection checkboxes) to prevent row activation by calling preventDefault(). This addresses the previously reported issue where checking selection boxes would also open the sidepanel.


901-936: LGTM! Clean render logic with proper totalRows fallback.

The totalRows ?? this.data.length fallback ensures pagination calculations work when totalRows isn't explicitly provided. The has-pagination-on-top class correctly reflects the new paginationLocation prop.

src/components/table/table-selection.ts (2)

2-7: LGTM! Consistent type import pattern.

The explicit type imports with Tabulator prefix aliases (TabulatorColumnDefinition, TabulatorCellComponent, TabulatorRowComponent) maintain consistency with the main table.tsx file and clearly indicate these are Tabulator-specific types.


143-145: Good defensive guard for invalid row position.

In Tabulator v6, getPosition(true) can return false if the row's position cannot be determined. This guard prevents attempting selection operations on invalid row positions.

src/components/table/columns.ts (5)

2-9: LGTM! Clean explicit type imports.

The explicit imports from tabulator-tables correctly use the v6 type names. Unlike table.tsx and table-selection.ts, this file doesn't alias the types (e.g., CellComponent instead of TabulatorCellComponent), which is acceptable since this file deals primarily with Tabulator internals.


25-48: LGTM! Factory method correctly typed for Tabulator v6.

The create method now returns the explicit ColumnDefinition type, maintaining type safety with the new import structure.


92-112: LGTM! Formatter types correctly aligned with Tabulator v6.

The Formatter return type and CellComponent parameter types correctly match the Tabulator v6 API expectations.


270-280: LGTM! Using Tabulator's native sorter type.

Switching from a custom TabulatorSorter interface to the library-provided SorterFromTable type improves maintainability and ensures compatibility with Tabulator v6's event payloads.


286-295: LGTM! Aggregator return type updated.

The ColumnCalc return type correctly represents Tabulator v6's aggregator options (string literals like 'sum', 'avg', etc., or custom functions).

Comment on lines +334 to +352
if (newData.length > 0) {
this.tabulator.updateOrAddData(newData);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If there are no rows to update or add, why call updateOrAddData at all?
This avoids unnecessary work, and fixes failing e2e tests in this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

But this checks that there IS data 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, maybe you added it 😄 I'm confused

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. sorry I squashed the change. so you don't see what was before. There was no if

before:

            // if (newData.length > 0) {
                this.tabulator.updateOrAddData(newData);
            // }

The intelligent said:

The e2e tests were failing because of a change in behavior in the newer version of Tabulator. The issue was:

When updateData was called with empty data or identical data, the code would fall through to calling this.tabulator.updateOrAddData(newData)
In the new Tabulator version, calling updateOrAddData([]) with an empty array triggers a "No data provided" warning/error
This caused the tests to fail with "Protocol error: Target closed" errors
The fix: Added a check before calling updateOrAddData to ensure we only call it when there's actually data to add

@Kiarokh Kiarokh added 3rd-party Bugs or missing features in 3rd-party dependencies maintenance Things that are important but not urgent, and not directly related to any specific bug or feature labels Dec 10, 2025
Kiarokh
Kiarokh previously approved these changes Dec 10, 2025
Copy link
Contributor

@Kiarokh Kiarokh left a comment

Choose a reason for hiding this comment

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

I've tested this here and there and made changes that I deemed necessary. Implemented some feedback from the rabbit, and removed many sounarcloud warnings.

From my side, this is approved. Unless you wanna check it again @jgroth @civing

@Kiarokh
Copy link
Contributor

Kiarokh commented Dec 10, 2025

@LucyChyzhova seem to have some bugs when testing the the web client. Let's wait until we can verify. Will do it tomorrow

Comment on lines +275 to +287
this.destroyed = true;
this.initialized = false;

if (this.resizeObserver) {
this.resizeObserver.disconnect();
this.resizeObserver = null;
}

if (this.tabulator) {
this.tabulator.destroy();
this.tabulator = null;
}

Copy link
Contributor

@Kiarokh Kiarokh Dec 11, 2025

Choose a reason for hiding this comment

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

when testing in the web client, an error happened after switching between Table view > List view (or any other view) > and then back to Table view.

In the console:

table.tsx:562 Data Load Error: undefined
(anonymous) @ tabulator_esm.mjs:27386
Promise.catch
load @ tabulator_esm.mjs:27385
setData @ tabulator_esm.mjs:29087
(anonymous) @ table.tsx:562
(anonymous) @ tabulator_esm.mjs:27534
_dispatch @ tabulator_esm.mjs:27533
(anonymous) @ tabulator_esm.mjs:28860
Promise.finally
_create @ tabulator_esm.mjs:28858
(anonymous) @ tabulator_esm.mjs:28770
setTimeout
Tabulator @ tabulator_esm.mjs:28769
TabulatorFull @ tabulator_esm.mjs:29616
createTabulator @ table.tsx:549
(anonymous) @ table.tsx:539
requestAnimationFrame
(anonymous) @ table.tsx:534

Why did it happen according to AI, and what this fixup does:
The issue was that in the new version of Tabulator, explicitly calling setData(url) was causing a "Data Load Error" when the request was aborted (via ajaxRequesting returning false) or when requestData returned Promise.reject().

The fix: In remote mode, we no longer need to manually call setData because:

Tabulator automatically loads data when ajaxURL is set in the options
The ajaxRequestFunc callback (requestData) handles the actual data retrieval
The ajaxRequesting callback can abort the first request if data is already provided as a prop
By removing the explicit setData call, we let Tabulator's built-in initialization handle the data loading, which avoids the error.

Copy link
Contributor

Choose a reason for hiding this comment

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

@LucyChyzhova has also tested this in the web client. We don't find any other issues, than the one which is solved now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3rd-party Bugs or missing features in 3rd-party dependencies maintenance Things that are important but not urgent, and not directly related to any specific bug or feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants