Skip to content

🐛Fixed Xai logo unmatch issue - #595

Merged
Leo-rq-yu merged 2 commits into
mainfrom
chore/x-ai-logo
Nov 17, 2025
Merged

Leo-rq-yu merged 2 commits into
mainfrom
chore/x-ai-logo

Conversation

@Leo-rq-yu

@Leo-rq-yu Leo-rq-yu commented Nov 17, 2025 •

Copy link
Copy Markdown
Contributor

Summary

Fixed 'Xai' logo unmatch with type

How did you test this change?

Summary by CodeRabbit

  • Bug Fixes
    • Fixed xAI provider display so its name and logo now appear correctly in the app.

@coderabbitai

coderabbitai Bot commented Nov 17, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Updated the xAI provider mapping keys from xai to x-ai in both the display name and logo lookup maps in the AI helpers file. No other logic, control flow, or error handling changes.

Changes

Cohort / File(s) Summary
Mapping Key Update
frontend/src/features/ai/helpers.ts
Changed xAI provider mapping keys from xai to x-ai in both getProviderDisplayName (displayNameMap) and getProviderLogo (logoMap).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Verify consistency of the x-ai key usage elsewhere in the codebase.
  • Confirm no remaining references to the old xai key exist.

Poem

🐰 A tiny key hops from xai to x-ai,
In helpers it settles, neat and spry,
Maps untouched, logic stays true,
A smallest tweak—hello new view! ✨

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 directly addresses the main change: fixing the xAI logo key mapping from 'xai' to 'x-ai' to resolve a type mismatch issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/x-ai-logo

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fab64b9 and b985786.

📒 Files selected for processing (1)
  • frontend/src/features/ai/helpers.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-16T01:09:15.904Z
Learnt from: Leo-rq-yu
Repo: InsForge/InsForge PR: 439
File: frontend/src/features/ai/helpers.ts:169-195
Timestamp: 2025-10-16T01:09:15.904Z
Learning: In frontend/src/features/ai/helpers.ts, the convertOpenRouterModelToOption function uses `model.name.split(':')[1]` to extract modelName. This is safe because OpenRouter predefines the name format to always include a colon, so the split operation will always return a valid value at index 1.

Applied to files:

  • frontend/src/features/ai/helpers.ts
⏰ 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: CI Pre-merge Check
  • GitHub Check: E2E Tests
🔇 Additional comments (2)
frontend/src/features/ai/helpers.ts (2)

64-64: Correct fix for the provider display name mapping!

This change addresses the inconsistency flagged in the previous review. The key 'x-ai' now matches the actual provider ID format used in modelIds throughout the codebase (e.g., x-ai/grok-2). This ensures getProviderDisplayName correctly returns 'xAI' instead of falling back to the incorrectly capitalized 'X-ai'.


64-81: Consistent mapping keys verified—no breaking changes found.

Verification confirms the mapping key change from xai to 'x-ai' is complete and consistent. Search of the codebase shows:

  • No remaining references to the old xai key format
  • Both providerMap (line 64) and logoMap (line 81) correctly use 'x-ai'
  • No breaking references elsewhere in the codebase

The code changes are correct. Manual UI testing of the xAI provider display and logo rendering is recommended to ensure the provider renders correctly in all contexts.


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

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da0ef71 and fab64b9.

📒 Files selected for processing (1)
  • frontend/src/features/ai/helpers.ts (1 hunks)
⏰ 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: CI Pre-merge Check
  • GitHub Check: E2E Tests

Comment thread frontend/src/features/ai/helpers.ts Resolved
@Leo-rq-yu
Leo-rq-yu merged commit 0dc1d85 into main Nov 17, 2025
@Leo-rq-yu
Leo-rq-yu deleted the chore/x-ai-logo branch November 17, 2025 06:19
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.

2 participants