Skip to content

Robust long-text handling on app rows, repo headers, announcements (refs #538)#564

Merged
rainxchzed merged 1 commit into
mainfrom
fix/text-overflow-protection
May 10, 2026
Merged

Robust long-text handling on app rows, repo headers, announcements (refs #538)#564
rainxchzed merged 1 commit into
mainfrom
fix/text-overflow-protection

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 10, 2026

What this PR fixes

Refs #538 (UI portion).

Long app names, repo names, owner handles, and version labels could break the layout — pushing siblings off-screen, wrapping awkwardly under the action button, or stacking 4–5 lines deep on apps with verbose versionName schemes (calver dates, multi-segment build identifiers, locale strings).

Hardened components

AppItemCard (apps screen)

  • app.appNamemaxLines = 2, overflow = Ellipsis
  • app.repoOwnermaxLines = 1, overflow = Ellipsis, given weight(1f, fill = false) so it ellipsises before squeezing siblings.
  • Version label (both isUpdateAvailable and idle branches) → maxLines = 2, overflow = Ellipsis — accommodates 1.8.6 → 1.8.7 (released yesterday) style strings without losing the tail.
  • Inline variant tag → maxLines = 1, overflow = Ellipsis.
  • Column gets fillMaxWidth() and the inner Row gets fillMaxWidth() so the weight allocation is unambiguous.

AppHeader (details screen)

  • repository.namemaxLines = 2, overflow = Ellipsis. Long repo names like awesome-cross-platform-multimedia-toolkit-x no longer push the fork badge off the right edge.
  • Author byline → maxLines = 1, overflow = Ellipsis.
  • Required adding import androidx.compose.ui.text.style.TextOverflow.

AnnouncementCard

  • Announcement title → maxLines = 3, overflow = Ellipsis. Three lines is the comfort ceiling — a single critical advisory shouldn't be able to push the body, action row, or acknowledge button off-screen.
  • Required adding import androidx.compose.ui.text.style.TextOverflow.

Already protected (no changes needed)

  • CompactAppRow — already uses maxLines = 1, overflow = Ellipsis on appName / repoOwner / version label.
  • RepositoryCard — already protects every dynamic field on the discovery card.
  • SkippedUpdatesRoot — already protects appName / skippedTag / installedVersion.
  • InspectRow (APK Inspect sheet) — intentionally unprotected because the SHA-256 fingerprint is meant to wrap fully so users can verify it.

Test plan

  • Install an app with an extremely long versionName (e.g. `1.0.0+build.20260510.commit.abc123def4567890`) — the row stays single-card, ellipsises cleanly, and the action button stays accessible.
  • Install an app whose owner login is 30+ chars — owner ellipsises, doesn't push avatar.
  • Open details on a repo with a multi-word name — name fits within 2 lines, fork badge still visible.
  • Trigger a multi-paragraph announcement — title caps at 3 lines, body still readable, acknowledge button still tappable.

Summary by CodeRabbit

  • Bug Fixes
    • Applied text line limits and ellipsis to text elements across announcement cards, app listings, and app detail sections for consistent display.

Review Change Stack

Issue #538 (UI part): long app names, repo names, owner handles, and
version labels could blow up the layout — pushing siblings off-screen,
wrapping awkwardly under the action button, or stacking 4-5 lines
deep on apps with verbose versionName schemes.

Hardened the three highest-traffic offenders:

- AppItemCard (apps screen): appName max 2 lines, repoOwner 1 line
  with weight(fill = false), version label (both isUpdateAvailable
  and idle branches) max 2 lines, inline variant tag 1 line.
- AppHeader (details screen): repository.name max 2 lines, author
  byline 1 line, both ellipsised. Required adding the TextOverflow
  import.
- AnnouncementCard: announcement title capped at 3 lines so an
  unusually long advisory title can't push the body, action row, or
  acknowledge button off-screen.

CompactAppRow, RepositoryCard, SkippedUpdatesRoot were already
protected and don't need touching.

Refs #538.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 10feaa92-5329-4218-a4b0-7c56cf517313

📥 Commits

Reviewing files that changed from the base of the PR and between f20a4b4 and 55ba022.

📒 Files selected for processing (3)
  • core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/components/announcements/AnnouncementCard.kt
  • feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/AppHeader.kt

Walkthrough

This PR adds consistent text overflow handling across three UI components by constraining text elements to maximum line counts and applying ellipsis overflow. The changes add TextOverflow imports and configure line limits on announcement titles, app headers, and app list item cards to prevent layout overflow and uncontrolled text expansion.

Changes

Text Overflow Constraints Across Components

Layer / File(s) Summary
TextOverflow Imports
core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/components/announcements/AnnouncementCard.kt, feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/AppHeader.kt
TextOverflow import statements added to two files to support text overflow configuration.
AnnouncementCard Text Constraints
core/presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/components/announcements/AnnouncementCard.kt
Announcement title text is constrained to a maximum of 3 lines with ellipsis overflow.
AppHeader Text Constraints
feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/AppHeader.kt
Repository name text is limited to 2 lines and author/login text to 1 line, both with ellipsis overflow.
AppsRoot AppItemCard Text Constraints
feature/apps/presentation/src/commonMain/kotlin/zed/rainxch/apps/presentation/AppsRoot.kt
App name column uses weight(1f).fillMaxWidth(); app name text capped at 2 lines, repo owner at 1 line, version labels at 2 lines, and pinned variant label at 1 line, all with ellipsis overflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops through textual bounds,
With ellipsis trailing all around,
Three files trimmed with careful lines,
No overflow shall steal our signs! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main objective of the PR: adding robust text overflow handling across three components (app rows, repo headers, announcements) with concrete improvements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/text-overflow-protection

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.

@rainxchzed rainxchzed merged commit 8083c4d into main May 10, 2026
1 check passed
@rainxchzed rainxchzed deleted the fix/text-overflow-protection branch May 10, 2026 08:47
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