Skip to content

fix: inconsistent left padding in preview window file path truncation #1196

@kimjune01

Description

@kimjune01

Description

The file path in the code preview window shows inconsistent left padding when truncated. Long file names sometimes render with ~30% padding on the left, and this behavior is inconsistent when re-opening the preview for the same file.

Root Cause

The .truncate-start CSS class uses direction: rtl to enable start-side text truncation. When combined with the dynamic gutter width calculation, this creates inconsistent rendering of the flex container holding the file path.

Reproduction

  1. Open a code preview for a file with a long path
  2. Observe large left padding (~30% of width)
  3. Close and reopen the same preview
  4. Padding may change inconsistently

Related

Fixes #103

Technical Details

The issue is in packages/web/src/app/(app)/search/components/codePreviewPanel/codePreview.tsx lines 128-143, where the file path container uses flex-1 overflow-hidden with a truncate-start span inside that has direction: rtl.

The fix should ensure the truncation works consistently without the layout shift caused by RTL direction interactions with flex layout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions