Q42 / Q42/Template.ComposeMultiplatform
Standardize ViewStateString usage and documentation in project template
@tom0334 is already working on this.
Since Sep 18, 2026.
- Dominant language
- Kotlin
- Stars
- 1
- Forks
- 0
- Avg merge
- 7d 15h
- Merged PRs (30d)
- 15
Description
Type: Refactoring / Technical Debt
Description:
Currently, there are mixed conventions across our Android / CMP codebase regarding where and how ViewStateString is unwrapped. In several places, elementary Composables take ViewStateString parameters directly, or static strings are constructed via ViewStateString("...").get() directly inside UI components. To improve component reusability, testability, and maintain consistency across project templates, we need to enforce clear conventions on string unwrapping and document them properly.
Agreed Conventions
- Unwrap strings early: Composables (especially elementary/reusable UI components) should accept standard String parameters, not ViewStateString. Unwrapping should occur near the top level where the ViewState is observed.
- No ViewStateString in Composable parameters: Keep UI components "blissfully unaware" of the string source (resource vs. dynamic string vs. hardcoded).
- Avoid redundant unwrapping: Do not instantiate ViewStateString only to immediately call .get() inside a Composable for static text. Use native string resource resolution or direct strings instead.
Tasks
[ ] Refactor Template Codebase: Update current usages of ViewStateString across the project template to align with the agreed rules.
[ ] Add KDoc Documentation: Update ViewStateString class docs to explicitly detail its intended usage and state where unwrapping should occur.
[ ] Update Guidelines: Add clear instructions and examples regarding string unwrapping conventions in agents.md (and relevant architecture docs).
Context
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.