Skip to content

Conversation

brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Aug 19, 2025

Fixes #463

Summary by CodeRabbit

  • Style
    • Standardized rendering of file paths and display names by wrapping text in spans for consistent truncation and alignment across the app (Code Preview, Filters, Chat file list).
    • Improved readability of truncated content by forcing left‑to‑right rendering for direct children of elements using truncate-start, enhancing clarity for paths in RTL layouts.
    • Preserves existing click, tooltip, and navigation behaviors; purely visual refinements.

Copy link

coderabbitai bot commented Aug 19, 2025

Walkthrough

Adds a child-level LTR direction override via CSS for .truncate-start containers and wraps displayed text in spans in several components (filter panel entry, code preview header, chat file list) without altering logic, events, or exports.

Changes

Cohort / File(s) Summary
Bidi direction override
packages/web/src/app/globals.css
Adds .truncate-start > * { direction: ltr; unicode-bidi: embed; } to enforce LTR rendering for immediate children while keeping parent RTL for truncation.
Filter panel text wrapper
packages/web/src/app/[domain]/search/components/filterPanel/entry.tsx
Wraps displayName text in an inner <span> within the TooltipTrigger’s <p>, enabling targeted LTR styling.
Code/file path wrappers
packages/web/src/app/[domain]/search/components/codePreviewPanel/codePreview.tsx, packages/web/src/features/chat/components/chatThread/tools/shared.tsx
Wraps rendered file path strings in <span> elements inside existing clickable/link containers; no logic or behavior changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix language names with symbols (e.g., C++, C#) displaying reversed in Filter by Language pane due to .truncate-start RTL direction (#463)

Poem

A nibble of CSS, a whisker of span,
I flipped the script without a grand plan.
C++ hops forward, C# sings true—
No backwards bunnies in this UI zoo.
With LTR tracks and tidy DOM,
I thump my paws: “Bug be gone!”

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bkellam/fix_463

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@brendan-kellam your pull request is missing a changelog!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/web/src/app/[domain]/search/components/filterPanel/entry.tsx (1)

55-55: Correct fix: child-level LTR wrapper enables proper rendering for C++/C# under left-truncation

Wrapping the text in a child element is the right approach to pair with .truncate-start > * { direction: ltr; ... } and fixes the reversed-language issue without breaking left-side ellipsis.

You can drop redundant classes because truncate-start already applies white-space: nowrap, overflow: hidden, and text-overflow: ellipsis.

-<p className="overflow-hidden text-ellipsis whitespace-nowrap truncate-start"><span>{displayName}</span></p>
+<p className="truncate-start"><span>{displayName}</span></p>
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b36de34 and 7341a49.

📒 Files selected for processing (4)
  • packages/web/src/app/[domain]/search/components/codePreviewPanel/codePreview.tsx (1 hunks)
  • packages/web/src/app/[domain]/search/components/filterPanel/entry.tsx (1 hunks)
  • packages/web/src/app/globals.css (1 hunks)
  • packages/web/src/features/chat/components/chatThread/tools/shared.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit Inference Engine (.cursor/rules/style.mdc)

Filenames should always be camelCase. Exception: if there are filenames in the same directory with a format other than camelCase, use that format to keep things consistent.

Files:

  • packages/web/src/app/[domain]/search/components/filterPanel/entry.tsx
  • packages/web/src/app/[domain]/search/components/codePreviewPanel/codePreview.tsx
  • packages/web/src/features/chat/components/chatThread/tools/shared.tsx
  • packages/web/src/app/globals.css
🔇 Additional comments (2)
packages/web/src/features/chat/components/chatThread/tools/shared.tsx (1)

35-35: LGTM: span wrapper aligns with the child-direction override

This pairs correctly with the new CSS rule to keep left-ellipsis behavior while rendering the path LTR inside the truncated container.

packages/web/src/app/[domain]/search/components/codePreviewPanel/codePreview.tsx (1)

224-224: LGTM: child span ensures correct LTR rendering inside left-truncation container

Keeps left-side ellipsis behavior intact and fixes symbol ordering (e.g., ++, #) in the header path. Retaining the title attribute for hover is a nice touch.

Comment on lines +314 to +318
.truncate-start > * {
direction: ltr;
unicode-bidi: embed;
}

Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Direction override looks good; consider unicode-bidi: isolate and verify class usage across the app

The child-level override is the right lever to preserve left-ellipsis (outer RTL) while fixing symbol order (inner LTR). Two follow-ups to consider:

  • Using unicode-bidi: isolate instead of embed typically reduces bidi interactions with neighboring content. It’s a safe tweak for paths/language labels.
  • Since this affects all .truncate-start usages globally, verify that every instance actually wraps text in a single child element (as done in this PR), otherwise the override won’t apply.

If you’d like to try the isolate variant:

-.truncate-start > * {
-  direction: ltr;
-  unicode-bidi: embed;
-}
+.truncate-start > * {
+  direction: ltr;
+  unicode-bidi: isolate;
+}

To audit .truncate-start usage and quickly spot places that may still render text directly (without a child element), run:


🏁 Script executed:

#!/bin/bash
# List all occurrences of `truncate-start` with nearby context
rg -n -C3 --type tsx --type ts --type jsx --type js 'truncate-start' | sed 's/^\(.*\)$/\1\n---/'

echo
echo "Heuristic: show lines where `truncate-start` appears and the next non-empty line doesn't open a child tag (may indicate direct text). Review manually."
rg -nPU --type tsx --type jsx '(?s)className="[^"]*truncate-start[^"]*".*?\n\s*([^<\s])' -C0

Length of output: 660


🏁 Script executed:

#!/bin/bash
# Retry searching for `truncate-start` using glob-based file matching

echo "Occurrences of 'truncate-start' with context:"
rg -n -C3 -g '*.{tsx,ts,jsx,js}' 'truncate-start' | sed 's/^\(.*\)$/\1\n---/'

echo
echo "Heuristic check: show each `.truncate-start` usage and two lines after the opening tag to spot direct text vs. child element:"
rg -n -A2 -g '*.{tsx,jsx}' 'className\s*=\s*"[^"]*truncate-start[^"]*"' 

Length of output: 4869


Wrap direct .truncate-start elements to ensure the override applies

Two instances apply the truncate-start class directly to the text-bearing element, so the child‐selector override (.truncate-start > *) won’t take effect. Please wrap their contents in a single child node:

• packages/web/src/app/[domain]/search/components/codePreviewPanel/codePreview.tsx (≈ line 213)

- <span className="block truncate-start text-sm font-mono cursor-pointer hover:underline" onClick={…}>
-   {filePath}
- </span>
+ <span className="block truncate-start text-sm font-mono cursor-pointer hover:underline" onClick={…}>
+   <span>{filePath}</span>
+ </span>

• packages/web/src/features/chat/components/chatThread/tools/shared.tsx (≈ line 26)

- <Link className="text-sm truncate-start" href={…}>
-   {path}
- </Link>
+ <Link className="text-sm truncate-start" href={…}>
+   <span>{path}</span>
+ </Link>

The existing entry.tsx filter panel already wraps its text correctly.

Optional: to further isolate bidi behavior, you can switch from embed to isolate in globals.css:

 .truncate-start > * {
   direction: ltr;
-  unicode-bidi: embed;
+  unicode-bidi: isolate;
 }
🤖 Prompt for AI Agents
In packages/web/src/app/globals.css around lines 314 to 318, the child-selector
override `.truncate-start > * { direction: ltr; unicode-bidi: embed; }` won’t
apply when `.truncate-start` is applied directly to a text-bearing element; wrap
the direct `.truncate-start` usages in a single child node so the selector
targets that child. Concretely: update
packages/web/src/app/[domain]/search/components/codePreviewPanel/codePreview.tsx
(≈ line 213) and
packages/web/src/features/chat/components/chatThread/tools/shared.tsx (≈ line
26) to wrap the existing text content with one element (e.g., a span/div) inside
the element that has `.truncate-start`. Optionally, in globals.css you can
change `unicode-bidi: embed` to `unicode-bidi: isolate` if you want stronger
bidi isolation.

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.

[bug] [display] In search results page, Filter by Language displays languages with symbols incorrectly
1 participant