Skip to content

Fix CAS HTML rendering with WebView and refine header/detail UI#1

Open
EMEEEEMMMM wants to merge 1 commit intoComputerization:mainfrom
EMEEEEMMMM:bear/update
Open

Fix CAS HTML rendering with WebView and refine header/detail UI#1
EMEEEEMMMM wants to merge 1 commit intoComputerization:mainfrom
EMEEEEMMMM:bear/update

Conversation

@EMEEEEMMMM
Copy link
Copy Markdown

Summary

This PR improves CAS club detail rendering and UI polish, with a focus on fixing HTML content display issues that were not possible to solve with HtmlCompat alone.

What changed

  • Replaced full-detail CAS description rendering from TextView + HtmlCompat to WebView-based rendering when full content is needed.
  • Kept lightweight preview rendering (TextView + HtmlCompat) for truncated/preview contexts.
  • Added HTML preprocessing for escaped payloads (for example \u003C, escaped newlines, escaped quotes).
  • Added safer sanitization for rendered content:
    • Removes scripts in WebView path.
    • Strips style/script/head/meta/link in preview path.
    • Handles noisy @font-face fragments in raw content.
  • Updated CAS club detail intro layout to avoid aggressive truncation and better show long descriptions.
  • Adjusted header/title presentation to remove the heavy framed look and improve readability contrast.

Why

  • CAS club descriptions from backend often contain escaped HTML and style-heavy fragments.
  • HtmlCompat cannot reproduce website-level layout/CSS fidelity, which caused visible raw CSS/code and formatting mismatch.
  • Users reported clipped content and poor readability in club detail pages.

Technical details

  • HtmlText now uses a hybrid strategy:
    • maxLines != Int.MAX_VALUE -> preview mode (HtmlCompat).
    • maxLines == Int.MAX_VALUE -> full mode (WebView.loadDataWithBaseURL(...)) with TSIMS base URL.
  • Club detail intro area now gives the description a larger bounded render region and full-content mode to reduce truncation.
  • Existing behavior for other CAS screens remains compatible.

Validation

  • Build check passed:
    • ./gradlew :app:compileDebugKotlin

Notes / Risks

  • WebView rendering is heavier than TextView rendering; this is intentionally limited to full-detail path.
  • Final visual parity still depends on what HTML/CSS the backend sends and any externally referenced resources.
  • Line-ending warnings (LF/CRLF) are environment-related and not functional regressions.

Files touched (key)

  • app/src/main/java/com/computerization/outspire/feature/cas/HtmlText.kt
  • app/src/main/java/com/computerization/outspire/feature/cas/ClubDetailScreen.kt
  • app/src/main/java/com/computerization/outspire/designsystem/OutspireScreen.kt
  • app/src/main/java/com/computerization/outspire/data/remote/CasService.kt

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