Skip to content

Truncate long profiler name in profiler popup#634

Merged
tgxworld merged 1 commit intomasterfrom
truncate_long_urls
Feb 3, 2025
Merged

Truncate long profiler name in profiler popup#634
tgxworld merged 1 commit intomasterfrom
truncate_long_urls

Conversation

@tgxworld
Copy link
Collaborator

@tgxworld tgxworld commented Feb 3, 2025

Screenshot

Before

Screenshot 2025-02-03 at 11 57 03 AM

After

Screenshot 2025-02-03 at 12 39 41 PM

@tgxworld tgxworld changed the title Truncate long URLs Truncate long profiler name in profiler popup Feb 3, 2025
@SamSaffron
Copy link
Member

look at the truncating on the left (it leaves left and right bounds) ... can you match the algorithm, I would say we have a tiny bit more room though so you can adjust to suite.

@tgxworld
Copy link
Collaborator Author

tgxworld commented Feb 3, 2025

@SamSaffron I've updated the solution to be CSS based instead.

@SamSaffron
Copy link
Member

I am OK with this but

/some/long/...../some/other

would be nicer if possible.

@tgxworld
Copy link
Collaborator Author

tgxworld commented Feb 3, 2025

/some/long/...../some/other

would be nicer if possible.

We wouldn't be able to rely on a CSS solution in this case. This is the current heuristic which we use for the badge

      <span class="profiler-name">
        {{? it.name.length >= 30 }}
          {{= it.name.substring(0,15) + "..." + it.name.slice(-15) }}
        {{??}}
          {{= it.name}}
        {{?}}
      </span>

@SamSaffron
Copy link
Member

yeah this would require js to be dynamic. I guess this is way better than what we have now so we just go with it

@tgxworld tgxworld merged commit 1abeaf7 into master Feb 3, 2025
4 checks passed
@tgxworld tgxworld deleted the truncate_long_urls branch February 3, 2025 05:34
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