Skip to content

feat(icons): allow 3rd party packages to provide icon names for auto completion#3778

Open
jgroth wants to merge 1 commit intomainfrom
autocomplete-icons
Open

feat(icons): allow 3rd party packages to provide icon names for auto completion#3778
jgroth wants to merge 1 commit intomainfrom
autocomplete-icons

Conversation

@jgroth
Copy link
Copy Markdown
Contributor

@jgroth jgroth commented Jan 16, 2026

fix Lundalogik/crm-client#622

Summary by CodeRabbit

  • Improvements
    • Unified icon typing across UI components for consistent icon selection and improved IDE autocompletion.
    • Standardized icon prop expectations everywhere, reducing surprises when configuring UI elements.
    • No runtime or visual behavior changes — type-level alignment that improves developer experience and predictability when passing icons.

How to test

image

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
Copy Markdown
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

Added an extendable IconName registry/type and replaced plain string icon typings with IconName or IconName | Icon across many components and shared types; no runtime or rendering behavior changed.

Changes

Cohort / File(s) Summary
Core type definitions
src/global/shared-types/icon.types.ts
Added IconNameRegistry and IconName types; changed Icon.name from stringIconName.
Shared types
src/global/shared-types/file.types.ts
Updated FileInfo.icon from `string
Simple string → IconName props
src/components/banner/banner.tsx, src/components/shortcut/shortcut.tsx, src/components/split-button/split-button.tsx, src/components/picker/picker.tsx, src/components/chip-set/chip-set.tsx, src/components/input-field/input-field.tsx
Changed public icon/leadingIcon/trailingIcon prop types from stringIconName; added imports.
Union props: string | Icon → IconName | Icon
src/components/action-bar/action-bar.types.ts, src/components/button/button.tsx, src/components/icon-button/icon-button.tsx, src/components/profile-picture/profile-picture.tsx, src/components/card/card.tsx, src/components/chip/chip.tsx, src/components/collapsible-section/collapsible-section.tsx, src/components/dynamic-label/dynamic-label.tsx, src/components/header/header.tsx, src/components/list-item/list-item.types.ts, src/components/menu/menu.types.ts, src/components/select/option.types.ts, src/components/tab-bar/tab.types.ts, src/components/dynamic-label/label.types.ts, src/components/dock/dock.types.ts, src/components/dialog/dialog.types.ts, src/components/chip-set/chip.types.ts
Replaced `string
List/menu/option/tab types tightened
src/components/list-item/list-item.types.ts, src/components/menu/menu.types.ts, src/components/select/option.types.ts, src/components/tab-bar/tab.types.ts, src/components/chip-set/chip.types.ts
Tightened item/option/tab/chip icon fields to `IconName

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

maintenance

Suggested reviewers

  • adrianschmidt
  • Kiarokh
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: enabling third-party packages to provide icon names for autocomplete functionality, which is the core objective of this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch autocomplete-icons

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.

@jgroth jgroth force-pushed the autocomplete-icons branch from b4a0507 to 0f3ea9d Compare January 16, 2026 09:23
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/global/shared-types/icon.types.ts`:
- Around line 3-21: Add a Biome ignore comment immediately above the
intentionally empty IconNameRegistry interface to suppress the noEmptyInterface
rule; place a comment like /* biome-ignore no-empty-interface */ directly before
the export interface IconNameRegistry {} declaration so the linter ignores this
specific rule for that empty interface used for module augmentation.
📜 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 dc434fb and 0f3ea9d.

📒 Files selected for processing (12)
  • src/components/action-bar/action-bar.types.ts
  • src/components/banner/banner.tsx
  • src/components/button/button.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/dock/dock.types.ts
  • src/components/icon-button/icon-button.tsx
  • src/components/input-field/input-field.tsx
  • src/components/picker/picker.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/global/shared-types/icon.types.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.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/input-field/input-field.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/banner/banner.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/picker/picker.tsx
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/button/button.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/input-field/input-field.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/banner/banner.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/picker/picker.tsx
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/button/button.tsx
**/*.{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/input-field/input-field.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/banner/banner.tsx
  • src/components/dock/dock.types.ts
  • src/components/profile-picture/profile-picture.tsx
  • src/components/picker/picker.tsx
  • src/components/shortcut/shortcut.tsx
  • src/global/shared-types/icon.types.ts
  • src/components/split-button/split-button.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/action-bar/action-bar.types.ts
  • src/components/button/button.tsx
**/*.{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/input-field/input-field.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/banner/banner.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/picker/picker.tsx
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/button/button.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/input-field/input-field.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/banner/banner.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/picker/picker.tsx
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/button/button.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: Kiarokh
Repo: Lundalogik/lime-elements PR: 3658
File: src/components/profile-picture/profile-picture.scss:120-124
Timestamp: 2025-09-03T07:17:23.267Z
Learning: Issue `#3666` in the lime-elements repository tracks the removal of a CSS hack in profile-picture component that overrides icon color via --limel-theme-on-surface-color, to be replaced with proper icon color support in limel-icon-button.
📚 Learning: 2025-04-25T13:32:56.396Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3529
File: src/components/lime-ai-avatar/lime-ai-avatar.tsx:30-38
Timestamp: 2025-04-25T13:32:56.396Z
Learning: For StencilJS components in lime-elements, prefer using the `<Host>` element to wrap child elements in the render method instead of returning an array of elements, which eliminates the need for key attributes and follows StencilJS best practices.

Applied to files:

  • src/components/banner/banner.tsx
📚 Learning: 2025-04-25T13:32:56.396Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements PR: 3529
File: src/components/lime-ai-avatar/lime-ai-avatar.tsx:30-38
Timestamp: 2025-04-25T13:32:56.396Z
Learning: For StencilJS components in lime-elements, prefer using the `<Host>` element to wrap child elements in the render method instead of returning an array of elements. This follows the standard pattern in the codebase and eliminates the need for key attributes.

Applied to files:

  • src/components/banner/banner.tsx
📚 Learning: 2025-04-17T09:39:36.254Z
Learnt from: adrianschmidt
Repo: Lundalogik/lime-elements 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.

Applied to files:

  • src/components/profile-picture/profile-picture.tsx
  • src/components/picker/picker.tsx
  • src/components/shortcut/shortcut.tsx
  • src/global/shared-types/icon.types.ts
🧬 Code graph analysis (11)
src/components/input-field/input-field.tsx (1)
src/global/shared-types/icon.types.ts (1)
  • IconName (31-31)
src/components/chip-set/chip-set.tsx (1)
src/global/shared-types/icon.types.ts (1)
  • IconName (31-31)
src/components/banner/banner.tsx (1)
src/global/shared-types/icon.types.ts (1)
  • IconName (31-31)
src/components/dock/dock.types.ts (1)
src/global/shared-types/icon.types.ts (1)
  • IconName (31-31)
src/components/profile-picture/profile-picture.tsx (1)
src/global/shared-types/icon.types.ts (2)
  • IconName (31-31)
  • Icon (38-68)
src/components/picker/picker.tsx (1)
src/global/shared-types/icon.types.ts (1)
  • IconName (31-31)
src/components/shortcut/shortcut.tsx (1)
src/global/shared-types/icon.types.ts (1)
  • IconName (31-31)
src/components/split-button/split-button.tsx (1)
src/global/shared-types/icon.types.ts (1)
  • IconName (31-31)
src/components/icon-button/icon-button.tsx (1)
src/global/shared-types/icon.types.ts (2)
  • IconName (31-31)
  • Icon (38-68)
src/components/action-bar/action-bar.types.ts (1)
src/global/shared-types/icon.types.ts (2)
  • IconName (31-31)
  • Icon (38-68)
src/components/button/button.tsx (1)
src/global/shared-types/icon.types.ts (2)
  • IconName (31-31)
  • Icon (38-68)
🪛 Biome (2.1.2)
src/global/shared-types/icon.types.ts

[error] 21-21: An empty interface is equivalent to {}.

Safe fix: Use a type alias instead.

(lint/suspicious/noEmptyInterface)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Docs / Publish Docs
  • GitHub Check: Test
🔇 Additional comments (12)
src/components/action-bar/action-bar.types.ts (1)

1-19: LGTM — IconName integration is consistent.

Line 19 aligns the icon typing with the new IconName registry without changing runtime behavior.

src/global/shared-types/icon.types.ts (1)

38-42: LGTM — Icon.name now uses IconName.

Line 42 correctly aligns Icon with the new IconName type.

src/components/dock/dock.types.ts (1)

1-20: LGTM — DockItem.icon typed as IconName.

Line 20 aligns with the new IconName registry and preserves behavior.

src/components/icon-button/icon-button.tsx (1)

7-28: LGTM — Icon prop now supports IconName | Icon.

Line 28 correctly tightens typing while retaining compatibility.

src/components/banner/banner.tsx (1)

2-24: LGTM — Banner icon now typed as IconName.

Line 24 aligns with the shared IconName type without changing behavior.

src/components/shortcut/shortcut.tsx (1)

5-32: Icon prop typing alignment looks good.

Switching to IconName keeps the runtime behavior intact while aligning the public API with the shared icon typing.

src/components/chip-set/chip-set.tsx (1)

21-21: Leading icon typing update is consistent.

Using IconName for leadingIcon matches the shared icon types and should improve autocomplete without behavioral changes.

Also applies to: 174-174

src/components/button/button.tsx (1)

6-50: Button icon typing update looks correct.

IconName | Icon keeps existing behavior and aligns the public API with the shared icon types.

src/components/split-button/split-button.tsx (1)

4-45: SplitButton icon typing change is consistent.

IconName usage matches the shared icon typing strategy without changing rendering behavior.

src/components/profile-picture/profile-picture.tsx (1)

13-63: ProfilePicture icon typing update looks good.

Switching to IconName | Icon keeps behavior intact while aligning with the shared icon typing.

src/components/picker/picker.tsx (1)

26-26: IconName alignment looks good.

This keeps the prop consistent with the shared icon typing for autocomplete and broader icon registry usage.

Also applies to: 85-85

src/components/input-field/input-field.tsx (1)

28-28: IconName prop typing is consistent and appropriate.

Aligns the input field with the centralized icon type for safer autocomplete.

Also applies to: 135-135, 141-141

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread src/global/shared-types/icon.types.ts
@jgroth jgroth force-pushed the autocomplete-icons branch from 0f3ea9d to b795194 Compare January 16, 2026 09:30
@jgroth jgroth requested a review from a team as a code owner January 16, 2026 09:30
@jgroth jgroth force-pushed the autocomplete-icons branch 2 times, most recently from 74751e3 to b6f4a28 Compare January 16, 2026 10:10
@jgroth jgroth force-pushed the autocomplete-icons branch from b6f4a28 to d6b98cd Compare February 11, 2026 07:37
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (2)
src/components/button/button.tsx (1)

152-152: 🧹 Nitpick | 🔵 Trivial

Update renderIcon parameter type to match the new prop type.

The private method signature still uses string | Icon, but the icon prop is now IconName | Icon. This should be aligned for consistency.

Proposed fix
-    private renderIcon(icon?: string | Icon) {
+    private renderIcon(icon?: IconName | Icon) {
src/components/input-field/input-field.tsx (1)

761-761: 🧹 Nitpick | 🔵 Trivial

Consider updating private helper signatures to use IconName for consistency.

renderLinkIcon and renderTrailingIcon accept icon: string, but they now receive values originating from IconName-typed properties. While this is type-safe (since IconName is assignable to string), updating these private signatures to IconName would keep the typing consistent throughout the file.

Suggested diff
-    private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {
+    private renderLinkIcon = (linkProps: LinkProperties, icon: IconName) => {
-    private renderTrailingIcon = (icon: string) => {
+    private renderTrailingIcon = (icon: IconName) => {

Also applies to: 779-779

@github-actions
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just making CodeRabbit's "outside the diff" comments more visible 🙂

Caution

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

⚠️ Outside diff range comments (2)

src/components/button/button.tsx (1)> 152-152: 🧹 Nitpick | 🔵 Trivial

Update renderIcon parameter type to match the new prop type.
The private method signature still uses string | Icon, but the icon prop is now IconName | Icon. This should be aligned for consistency.

Proposed fix

-    private renderIcon(icon?: string | Icon) {
+    private renderIcon(icon?: IconName | Icon) {

src/components/input-field/input-field.tsx (1)> 761-761: 🧹 Nitpick | 🔵 Trivial

Consider updating private helper signatures to use IconName for consistency.
renderLinkIcon and renderTrailingIcon accept icon: string, but they now receive values originating from IconName-typed properties. While this is type-safe (since IconName is assignable to string), updating these private signatures to IconName would keep the typing consistent throughout the file.

Suggested diff

-    private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {
+    private renderLinkIcon = (linkProps: LinkProperties, icon: IconName) => {
-    private renderTrailingIcon = (icon: string) => {
+    private renderTrailingIcon = (icon: IconName) => {

Also applies to: 779-779

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed the outside-diff nitpicks for input-field.tsx (updated renderLinkIcon and renderTrailingIcon signatures to use IconName) in #3864. The button.tsx one was already fixed in the PR.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/components/dynamic-label/label.types.ts`:
- Line 1: The import in label.types.ts is inconsistent: replace the current
import of IconName and Icon from '../../interface' with the same module used
elsewhere ('../../global/shared-types/icon.types') so IconName and Icon are
imported from the direct shared types module; update the import statement that
references IconName and Icon to point to '../../global/shared-types/icon.types'
to match other files (stay mindful of the symbols IconName and Icon and the file
label.types.ts when editing).

In `@src/global/shared-types/file.types.ts`:
- Line 2: The import for Icon and IconName uses an overly verbose path; update
the import in file.types.ts to use the local sibling module path by replacing
the '../../global/shared-types/icon.types' import with './icon.types' so it
matches the other same-directory imports and preserves the Icon and IconName
symbols.

@@ -1,4 +1,4 @@
import { Icon } from '../../interface';
import { IconName, Icon } from '../../interface';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Inconsistent import path compared to other files in this PR.

All other files in this PR import IconName and Icon from '../../global/shared-types/icon.types', but this file imports from '../../interface'. While both are valid relative paths, consider aligning to the direct module path for consistency.

🤖 Prompt for AI Agents
In `@src/components/dynamic-label/label.types.ts` at line 1, The import in
label.types.ts is inconsistent: replace the current import of IconName and Icon
from '../../interface' with the same module used elsewhere
('../../global/shared-types/icon.types') so IconName and Icon are imported from
the direct shared types module; update the import statement that references
IconName and Icon to point to '../../global/shared-types/icon.types' to match
other files (stay mindful of the symbols IconName and Icon and the file
label.types.ts when editing).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I left this one as-is — using ../../interface (the barrel export) is a valid pattern and the PR author may prefer it for this file. The other files import directly because they're closer to the source.

Comment thread src/global/shared-types/file.types.ts Outdated
@adrianschmidt
Copy link
Copy Markdown
Contributor

@jgroth, do you want me to ask @adrianschmidt-bot to finish this one for you?

@adrianschmidt-bot
Copy link
Copy Markdown
Contributor

I went through the review comments and prepared fixes for all of them. However, since this branch lives on the upstream repo (not our fork), I don't have push access. Here's what I've prepared:

Fixes addressing all 4 review comments:

  1. label.types.ts — Changed import from '../../interface' to '../../global/shared-types/icon.types' for consistency with all other files in this PR
  2. file.types.ts — Changed import from '../../global/shared-types/icon.types' to './icon.types' (sibling import, matching other same-directory imports)
  3. input-field.tsx — Updated renderLinkIcon and renderTrailingIcon parameter types from string to IconName for consistency
  4. icon.types.ts Biome comment — Not applicable; this project doesn't use Biome
Full diff (apply with git apply)
diff --git a/src/components/dynamic-label/label.types.ts b/src/components/dynamic-label/label.types.ts
index be7720b51..3b1c5e812 100644
--- a/src/components/dynamic-label/label.types.ts
+++ b/src/components/dynamic-label/label.types.ts
@@ -1,4 +1,4 @@
-import { IconName, Icon } from '../../interface';
+import { IconName, Icon } from '../../global/shared-types/icon.types';
 
 export type LabelValue = string | number | boolean | null | undefined;
 
diff --git a/src/components/input-field/input-field.tsx b/src/components/input-field/input-field.tsx
index 27ab461f6..bf6a32a4e 100644
--- a/src/components/input-field/input-field.tsx
+++ b/src/components/input-field/input-field.tsx
@@ -758,7 +758,7 @@ export class InputField {
         return props;
     };
 
-    private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {
+    private renderLinkIcon = (linkProps: LinkProperties, icon: IconName) => {
         // If the trailing icon uses the class `mdc-text-field__icon--trailing`,
         // MDC attaches a click handler to it, which apparently runs
         // `preventDefault()` on the event. For links, we don't want that,
@@ -776,7 +776,7 @@ export class InputField {
         );
     };
 
-    private renderTrailingIcon = (icon: string) => {
+    private renderTrailingIcon = (icon: IconName) => {
         if (this.isInvalid()) {
             return (
                 <i
diff --git a/src/global/shared-types/file.types.ts b/src/global/shared-types/file.types.ts
index c4ffc0ad9..03bdf66ec 100644
--- a/src/global/shared-types/file.types.ts
+++ b/src/global/shared-types/file.types.ts
@@ -1,5 +1,5 @@
 import { MenuItem } from '../../components';
-import { Icon, IconName } from '../../global/shared-types/icon.types';
+import { Icon, IconName } from './icon.types';
 import { Color } from './color.types';
 import { ListSeparator } from './separator.types';

@jgroth
Copy link
Copy Markdown
Contributor Author

jgroth commented Feb 16, 2026

@jgroth, do you want me to ask @adrianschmidt-bot to finish this one for you?

It seems it already tried to 😄

@adrianschmidt-bot
Copy link
Copy Markdown
Contributor

Yeah, I got a bit eager 😄 The diff above should be ready to apply if you want — just git apply it. Or if you'd prefer, you could push the branch to our fork and I can push the fixups directly.

@adrianschmidt
Copy link
Copy Markdown
Contributor

@jgroth Sorry, I didn't mean to bulldoze you. I guess I shouldn't have mentioned @adrianschmidt-bot in my question 😅

@adrianschmidt-bot You could open a PR targeting this PR's branch, then Johan can just pull it in, if he wants to.

@adrianschmidt-bot
Copy link
Copy Markdown
Contributor

Done! Opened #3864 targeting this branch with the review feedback fixes. @jgroth can pull it in if it looks useful. 🐙

@jgroth jgroth force-pushed the autocomplete-icons branch from c588dc0 to 006553d Compare March 3, 2026 08:49
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
src/components/header/header.tsx (1)

128-134: ⚠️ Potential issue | 🟡 Minor

title should not be in the style prop.

The title attribute is being set inside the style object (line 133), which is incorrect. HTML attributes like title must be separate props or attributes on the element, not CSS properties. The limel-icon component does not accept a title prop, so this will be ignored and the title attribute won't be set.

Move title outside the style object as a separate attribute on the element, or add title support to the limel-icon component if this functionality is needed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/header/header.tsx` around lines 128 - 134, The title property
is incorrectly placed inside the style object; remove the title entry from the
style literal in header.tsx and add a separate title attribute on the limel-icon
(or its wrapper) using (this.icon as Icon)?.title so the HTML title attribute is
set (e.g., set title={(this.icon as Icon)?.title} on the element) while keeping
the CSS custom properties (--limel-header-icon-color and
--limel-header-icon-background-color) in the style object.
♻️ Duplicate comments (1)
src/global/shared-types/icon.types.ts (1)

21-21: ⚠️ Potential issue | 🟠 Major

Suppress Biome noEmptyInterface for the augmentation anchor.

Line 21 is intentionally empty, but this pattern usually fails lint unless explicitly ignored.

Proposed fix
+// biome-ignore lint/suspicious/noEmptyInterface: used for module augmentation
 export interface IconNameRegistry {}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/global/shared-types/icon.types.ts` at line 21, Add a linter suppression
comment immediately above the empty interface declaration to allow the
augmentation anchor; specifically, for the IconNameRegistry interface add a
single-line disable for the Biome rule that flags empty interfaces (e.g., add a
comment such as // eslint-disable-next-line biome/noEmptyInterface or //
eslint-disable-next-line biome/no-empty-interface) so the empty export interface
IconNameRegistry {} remains but the Biome noEmptyInterface rule is ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/components/header/header.tsx`:
- Around line 128-134: The title property is incorrectly placed inside the style
object; remove the title entry from the style literal in header.tsx and add a
separate title attribute on the limel-icon (or its wrapper) using (this.icon as
Icon)?.title so the HTML title attribute is set (e.g., set title={(this.icon as
Icon)?.title} on the element) while keeping the CSS custom properties
(--limel-header-icon-color and --limel-header-icon-background-color) in the
style object.

---

Duplicate comments:
In `@src/global/shared-types/icon.types.ts`:
- Line 21: Add a linter suppression comment immediately above the empty
interface declaration to allow the augmentation anchor; specifically, for the
IconNameRegistry interface add a single-line disable for the Biome rule that
flags empty interfaces (e.g., add a comment such as // eslint-disable-next-line
biome/noEmptyInterface or // eslint-disable-next-line biome/no-empty-interface)
so the empty export interface IconNameRegistry {} remains but the Biome
noEmptyInterface rule is ignored.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c588dc0 and 006553d.

⛔ Files ignored due to path filters (1)
  • etc/lime-elements.api.md is excluded by !etc/lime-elements.api.md
📒 Files selected for processing (25)
  • src/components/action-bar/action-bar.types.ts
  • src/components/banner/banner.tsx
  • src/components/button/button.tsx
  • src/components/card/card.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/chip-set/chip.types.ts
  • src/components/chip/chip.tsx
  • src/components/collapsible-section/collapsible-section.tsx
  • src/components/dialog/dialog.types.ts
  • src/components/dock/dock.types.ts
  • src/components/dynamic-label/dynamic-label.tsx
  • src/components/dynamic-label/label.types.ts
  • src/components/header/header.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/input-field/input-field.tsx
  • src/components/list-item/list-item.types.ts
  • src/components/menu/menu.types.ts
  • src/components/picker/picker.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/select/option.types.ts
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/components/tab-bar/tab.types.ts
  • src/global/shared-types/file.types.ts
  • src/global/shared-types/icon.types.ts

@jgroth jgroth force-pushed the autocomplete-icons branch from 006553d to fdcc416 Compare March 3, 2026 09:01
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/global/shared-types/icon.types.ts (1)

21-21: ⚠️ Potential issue | 🟠 Major

Add suppression for intentional empty interface to avoid lint failure.

IconNameRegistry at Line 21 is intentionally empty, but this typically triggers Biome’s noEmptyInterface rule unless explicitly ignored.

Suggested fix
+// biome-ignore lint/suspicious/noEmptyInterface: intended module augmentation point
 export interface IconNameRegistry {}
#!/bin/bash
# Verify whether the empty interface is currently unsuppressed
rg -n "export interface IconNameRegistry\\s*\\{\\s*\\}" src/global/shared-types/icon.types.ts -C2
rg -n "biome-ignore.*noEmptyInterface|lint/suspicious/noEmptyInterface" src/global/shared-types/icon.types.ts -C2
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/global/shared-types/icon.types.ts` at line 21, The empty interface export
IconNameRegistry is intentionally blank but triggers Biome's noEmptyInterface
rule; suppress it by adding a Biome ignore comment immediately above the
declaration (for example: /* biome-ignore noEmptyInterface */ or // biome-ignore
noEmptyInterface) so the interface remains empty and the linter no longer
errors; place the suppression directly above the export interface
IconNameRegistry {} line to scope the rule exception to that declaration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/chip-set/chip-set.tsx`:
- Line 173: The leadingIcon property is typed as non-nullable IconName but
initialized to null and documented to allow null; update the type to include
null (e.g., change the declaration of leadingIcon in chip-set.tsx to use
IconName | null) so the TypeScript contract matches the documented/actual
behavior for the component.

---

Duplicate comments:
In `@src/global/shared-types/icon.types.ts`:
- Line 21: The empty interface export IconNameRegistry is intentionally blank
but triggers Biome's noEmptyInterface rule; suppress it by adding a Biome ignore
comment immediately above the declaration (for example: /* biome-ignore
noEmptyInterface */ or // biome-ignore noEmptyInterface) so the interface
remains empty and the linter no longer errors; place the suppression directly
above the export interface IconNameRegistry {} line to scope the rule exception
to that declaration.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 006553d and fdcc416.

⛔ Files ignored due to path filters (1)
  • etc/lime-elements.api.md is excluded by !etc/lime-elements.api.md
📒 Files selected for processing (25)
  • src/components/action-bar/action-bar.types.ts
  • src/components/banner/banner.tsx
  • src/components/button/button.tsx
  • src/components/card/card.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/chip-set/chip.types.ts
  • src/components/chip/chip.tsx
  • src/components/collapsible-section/collapsible-section.tsx
  • src/components/dialog/dialog.types.ts
  • src/components/dock/dock.types.ts
  • src/components/dynamic-label/dynamic-label.tsx
  • src/components/dynamic-label/label.types.ts
  • src/components/header/header.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/input-field/input-field.tsx
  • src/components/list-item/list-item.types.ts
  • src/components/menu/menu.types.ts
  • src/components/picker/picker.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/select/option.types.ts
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/components/tab-bar/tab.types.ts
  • src/global/shared-types/file.types.ts
  • src/global/shared-types/icon.types.ts

*/
@Prop({ reflect: true })
public leadingIcon: string = null;
public leadingIcon: IconName = null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== strict/null settings in tsconfig files =="
fd 'tsconfig.*json' | while read -r file; do
  echo "--- $file"
  rg -n '"strict"\s*:|"strictNullChecks"\s*:' "$file" || true
done

echo
echo "== declaration under review =="
rg -n -C2 'public\s+leadingIcon\s*:\s*IconName\s*=\s*null' src/components/chip-set/chip-set.tsx || true

Repository: Lundalogik/lime-elements

Length of output: 384


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== tsconfig.json content (relevant parts) =="
cat tsconfig.json | head -30

echo
echo "== IconName type definition =="
rg -n 'type\s+IconName|interface\s+IconName|export.*IconName' -A 3

echo
echo "== Full context around leadingIcon (lines 165-180) =="
sed -n '165,180p' src/components/chip-set/chip-set.tsx

Repository: Lundalogik/lime-elements

Length of output: 2843


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Complete tsconfig.json =="
cat tsconfig.json

echo
echo "== Import statement at line 22 =="
sed -n '1,30p' src/components/chip-set/chip-set.tsx | grep -n 'import.*IconName'

Repository: Lundalogik/lime-elements

Length of output: 878


Include null in leadingIcon type to match the actual contract.

leadingIcon is initialized with null and documented as accepting null ("When the value is null, no leading icon is used"), but typed as non-nullable IconName. This creates a misleading type contract for consumers of this component.

Proposed fix
-    public leadingIcon: IconName = null;
+    public leadingIcon: IconName | null = null;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public leadingIcon: IconName = null;
public leadingIcon: IconName | null = null;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/chip-set/chip-set.tsx` at line 173, The leadingIcon property
is typed as non-nullable IconName but initialized to null and documented to
allow null; update the type to include null (e.g., change the declaration of
leadingIcon in chip-set.tsx to use IconName | null) so the TypeScript contract
matches the documented/actual behavior for the component.

@jgroth jgroth force-pushed the autocomplete-icons branch from fdcc416 to b5d7433 Compare March 3, 2026 10:30
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/components/chip-set/chip-set.tsx (1)

169-173: ⚠️ Potential issue | 🟠 Major

leadingIcon type contract is inconsistent with its actual null behavior (Line 173).

The prop is documented and implemented as nullable, but typed as non-nullable IconName. This creates an incorrect public contract for TS consumers.

💡 Proposed fix
-    public leadingIcon: IconName = null;
+    public leadingIcon: IconName | null = null;
#!/bin/bash
set -euo pipefail

echo "== Type declaration and local usage for leadingIcon =="
rg -n -C2 'leadingIcon' src/components/chip-set/chip-set.tsx

echo
echo "== strict/null compiler settings =="
fd 'tsconfig*.json' -x sh -c 'echo "--- $1"; rg -n "\"strict\"|\"strictNullChecks\"" "$1" || true' sh {}

Expected verification outcome:

  • Confirms Line 173 non-nullable type + null initializer and null-based runtime checks.
  • If strictNullChecks is enabled in any active tsconfig, this is a direct typing error; otherwise it is still a misleading public API.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/chip-set/chip-set.tsx` around lines 169 - 173, The public prop
leadingIcon is typed as non-nullable IconName but initialized and checked as
null at runtime; update the type contract to reflect nullability by changing its
type to IconName | null (in src/components/chip-set/chip-set.tsx, symbol
leadingIcon) and adjust any JSDoc to state it can be null; run TypeScript with
strictNullChecks to verify no downstream callers assume a non-null value and add
null-safe checks where leadingIcon is used if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/components/chip-set/chip-set.tsx`:
- Around line 169-173: The public prop leadingIcon is typed as non-nullable
IconName but initialized and checked as null at runtime; update the type
contract to reflect nullability by changing its type to IconName | null (in
src/components/chip-set/chip-set.tsx, symbol leadingIcon) and adjust any JSDoc
to state it can be null; run TypeScript with strictNullChecks to verify no
downstream callers assume a non-null value and add null-safe checks where
leadingIcon is used if needed.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fdcc416 and b5d7433.

⛔ Files ignored due to path filters (1)
  • etc/lime-elements.api.md is excluded by !etc/lime-elements.api.md
📒 Files selected for processing (25)
  • src/components/action-bar/action-bar.types.ts
  • src/components/banner/banner.tsx
  • src/components/button/button.tsx
  • src/components/card/card.tsx
  • src/components/chip-set/chip-set.tsx
  • src/components/chip-set/chip.types.ts
  • src/components/chip/chip.tsx
  • src/components/collapsible-section/collapsible-section.tsx
  • src/components/dialog/dialog.types.ts
  • src/components/dock/dock.types.ts
  • src/components/dynamic-label/dynamic-label.tsx
  • src/components/dynamic-label/label.types.ts
  • src/components/header/header.tsx
  • src/components/icon-button/icon-button.tsx
  • src/components/input-field/input-field.tsx
  • src/components/list-item/list-item.types.ts
  • src/components/menu/menu.types.ts
  • src/components/picker/picker.tsx
  • src/components/profile-picture/profile-picture.tsx
  • src/components/select/option.types.ts
  • src/components/shortcut/shortcut.tsx
  • src/components/split-button/split-button.tsx
  • src/components/tab-bar/tab.types.ts
  • src/global/shared-types/file.types.ts
  • src/global/shared-types/icon.types.ts

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants