Skip to content

fix filepath text wrapping in diff panel #1600

@adboio

Description

@adboio

problem

i fumbled this one :)

the filepaths in the diff review panel are like /path/to/**file.tsx**

but the bold part i guess is not inline with the rest, so when it's too long, it goes like this:

Image

solution

let's fix the wrapping -- but i don't think normal wrapping will look very good here

instead, i think we should get ✨ fancy ✨ with it and use pretext to middle-truncate long file names 🤓

something like this:

frontend/.../marketing_analytics_config/ColumnUnmappedDescriber.tsx

and probably would be best to ensure we don't truncate mid-dir-name, so the truncation always happens between slashes (/.../) instead of something like src/sc....nfig/the-file.tsx

i think this approach also gives us the ability to show the filename in a tooltip on hover, but only if it got truncated (i hate tooltips, so the less, the better lol)

acceptance criteria

filenames in the diff panel...

  • no longer wrap poorly
  • are middle-truncated, always breaking on slashes
  • still keep the filename visually distinct from the path
  • show full filepath in a tooltip on hover, only when they are truncated

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingEnhancementNew feature or requestGood First Issuewant to contribute? these issues are a great place to start! 🦔❤️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions