Skip to content

fix: inconsistent left padding in preview file path truncation#1197

Open
kimjune01 wants to merge 3 commits into
sourcebot-dev:mainfrom
kimjune01:fix-preview-path-truncation
Open

fix: inconsistent left padding in preview file path truncation#1197
kimjune01 wants to merge 3 commits into
sourcebot-dev:mainfrom
kimjune01:fix-preview-path-truncation

Conversation

@kimjune01
Copy link
Copy Markdown

@kimjune01 kimjune01 commented May 12, 2026

Summary

  • Changed .truncate-start CSS text-align from left to right to fix inconsistent ~30% left padding when displaying long file paths in the code preview panel
  • The direction: rtl combined with text-align: left caused flex layout rendering inconsistencies across browsers

Fixes #103

Test plan

  • Open a search result with a long file path in the preview panel
  • Verify the file path is flush-right with the start truncated (ellipsis on the left)
  • Test across Chrome, Firefox, and Safari to confirm consistent rendering

Summary by CodeRabbit

  • Bug Fixes
    • Fixed inconsistent left padding in the preview window so truncated file paths align correctly.
    • Adjusted truncation behavior so ellipsized paths display with correct alignment in RTL contexts.

Review Change Stack

kimjune01 added 2 commits May 11, 2026 21:48
The file path in the code preview panel showed inconsistent left
padding when truncated. The .truncate-start CSS class used
direction: rtl with text-align: left, which caused the flex layout
to render inconsistently with the gutter width calculation.

Changed text-align from left to right to properly align RTL text
and eliminate the padding inconsistency.

Fixes sourcebot-dev#103
Closes sourcebot-dev#1196
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b800db2e-121a-41b1-9a1e-dd67704f59cd

📥 Commits

Reviewing files that changed from the base of the PR and between cc6d838 and dbca6c6.

📒 Files selected for processing (1)
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

Walkthrough

This PR changes .truncate-start to right-aligned text to correct preview window file path truncation and adds an Unreleased changelog entry referencing issue #1196.

Changes

Preview File Path Truncation Fix

Layer / File(s) Summary
File path truncation styling and changelog
packages/web/src/app/globals.css, CHANGELOG.md
The .truncate-start CSS rule updates text-align from left to right to correct file path truncation alignment in the preview window. A changelog entry documents this UI fix for issue #1196.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

Possibly related PRs

  • sourcebot-dev/sourcebot#474: Both PRs modify packages/web/src/app/globals.css's .truncate-start styling related to truncated text rendering.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change—fixing inconsistent left padding in preview file path truncation by adjusting CSS text alignment.
Linked Issues check ✅ Passed The changes directly address issue #103 by fixing the inconsistent left padding through CSS adjustment to text-align from left to right with RTL direction.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the padding issue: CHANGELOG.md documents the fix, and globals.css applies the CSS adjustment to resolve the problem.
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 unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 22: Update the CHANGELOG.md entry that currently reads "Fixed
inconsistent left padding in preview window file path truncation.
[`#1196`](https://github.com/sourcebot-dev/sourcebot/issues/1196)" to reference
the correct pull request: change the PR id to 1197 and point the URL to the pull
request page (https://github.com/sourcebot-dev/sourcebot/pull/1197) so the line
ends with [`#1197`](https://github.com/sourcebot-dev/sourcebot/pull/1197); locate
the exact string in CHANGELOG.md and replace both the numeric id and the
/issues/ URL accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cda6d1fc-5f61-4f86-8909-093154ae84f2

📥 Commits

Reviewing files that changed from the base of the PR and between 99b9af5 and cc6d838.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • packages/web/src/app/globals.css

Comment thread CHANGELOG.md
- Upgraded `hono` to `^4.12.18` to address CVE-2026-44455, CVE-2026-44456, CVE-2026-44457, CVE-2026-44458. [#1186](https://github.com/sourcebot-dev/sourcebot/pull/1186)
- Upgraded `ip-address` to `^10.2.0` to address CVE-2026-42338. [#1189](https://github.com/sourcebot-dev/sourcebot/pull/1189)
- Upgraded `fast-xml-builder` to `^1.2.0` to address CVE-2026-44664, CVE-2026-44665. [#1184](https://github.com/sourcebot-dev/sourcebot/pull/1184)
- Fixed inconsistent left padding in preview window file path truncation. [#1196](https://github.com/sourcebot-dev/sourcebot/issues/1196)
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 | ⚡ Quick win

Incorrect PR reference in changelog entry.

The changelog entry references #1196 with an /issues/ URL, but this PR is #1197. According to the coding guidelines, changelog entries must reference the PR number in the format [#<id>](https://github.com/sourcebot-dev/sourcebot/pull/<id>).

🔗 Proposed fix
-- Fixed inconsistent left padding in preview window file path truncation. [`#1196`](https://github.com/sourcebot-dev/sourcebot/issues/1196)
+- Fixed inconsistent left padding in preview window file path truncation. [`#1197`](https://github.com/sourcebot-dev/sourcebot/pull/1197)

As per coding guidelines, entries must include the GitHub pull request id at the end of the line, formatted as # where the URL points to the pull request, not the issue.

📝 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
- Fixed inconsistent left padding in preview window file path truncation. [#1196](https://github.com/sourcebot-dev/sourcebot/issues/1196)
- Fixed inconsistent left padding in preview window file path truncation. [`#1197`](https://github.com/sourcebot-dev/sourcebot/pull/1197)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` at line 22, Update the CHANGELOG.md entry that currently reads
"Fixed inconsistent left padding in preview window file path truncation.
[`#1196`](https://github.com/sourcebot-dev/sourcebot/issues/1196)" to reference
the correct pull request: change the PR id to 1197 and point the URL to the pull
request page (https://github.com/sourcebot-dev/sourcebot/pull/1197) so the line
ends with [`#1197`](https://github.com/sourcebot-dev/sourcebot/pull/1197); locate
the exact string in CHANGELOG.md and replace both the numeric id and the
/issues/ URL accordingly.

@brendan-kellam
Copy link
Copy Markdown
Contributor

heya - thx for raising. Can you provide before / after screenshots?

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.

Preview window file url truncation padding is inconsistent.

2 participants