Skip to content

truncate template description#1789

Open
carlosabadia wants to merge 1 commit intomainfrom
carlos/truncate-description
Open

truncate template description#1789
carlosabadia wants to merge 1 commit intomainfrom
carlos/truncate-description

Conversation

@carlosabadia
Copy link
Collaborator

No description provided.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 25, 2026

Greptile Summary

This PR makes three small, focused UI polish fixes to the templates pages: truncating long template descriptions to 3 lines in the grid view, preventing flex icons from shrinking when adjacent text wraps in the sidebar list items, and fixing a latent double-slash bug in the placeholder image URL caused by REFLEX_ASSETS_CDN already having a trailing slash.

  • templates_grid.py: Adds line-clamp-3 to the template description <span> so cards in the grid maintain a consistent height regardless of description length.
  • templates_grid.py: Applies .strip('/') to REFLEX_ASSETS_CDN (value: "https://web.reflex-assets.dev/") before building the placeholder logo src URL, preventing a // double-slash that would have formed in the path — consistent with how SCREENSHOT_BUCKET is already handled on line 86.
  • sidebar.py: Adds shrink-0 to ArrowRight02Icon and Tick02Icon in the Requirements and Key Features lists, ensuring icons retain their size when the text beside them wraps to multiple lines.

Confidence Score: 5/5

  • Safe to merge — all changes are additive CSS utility classes and one defensive string operation with no logic risk.
  • All three changes are minimal, targeted, and correct: the line-clamp-3 and shrink-0 additions are pure CSS utilities that improve visual consistency, and the .strip('/') call is a straightforward defensive fix matching an existing pattern already used in the same file. No logic, state, or API surface is affected.
  • No files require special attention.

Important Files Changed

Filename Overview
pcweb/pages/templates/views/templates_grid.py Adds line-clamp-3 to template description span for visual truncation, and strips trailing slash from REFLEX_ASSETS_CDN to prevent double-slash in the placeholder image URL (constant value is "https://web.reflex-assets.dev/").
pcweb/pages/templates/template_details/views/sidebar.py Adds shrink-0 to the ArrowRight02Icon and Tick02Icon instances in list-style flex rows to prevent the icons from being squeezed when requirement/feature text wraps across multiple lines.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[template_card renders] --> B[Image placeholder]
    B --> B1["REFLEX_ASSETS_CDN.strip('/') + /logos/..."]
    B1 --> B2["✅ No double-slash in URL"]

    A --> C[Description span]
    C --> C1["line-clamp-3 applied"]
    C1 --> C2["✅ Text truncated to 3 lines"]

    D[sidebar item renders] --> E["Icon in flex row"]
    E --> E1["shrink-0 applied"]
    E1 --> E2["✅ Icon stays fixed size when text wraps"]
Loading

Reviews (1): Last reviewed commit: "truncate template description" | Re-trigger Greptile

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.

1 participant