Skip to content

Wrap long question options instead of truncating them at one line - #1092

Closed
khativari wants to merge 1 commit into
opencode-mobile:mainfrom
khativari:question-option-wrap
Closed

khativari wants to merge 1 commit into
opencode-mobile:mainfrom
khativari:question-option-wrap

Conversation

@khativari

@khativari khativari commented Nov 19, 2026 •

Copy link
Copy Markdown
IMG_20261120_025716

Summary

A question option carries the sentence that makes it worth picking, but on a phone both were cut to
one line each. The screenshot below shows the current behaviour: a description stops after some
forty characters ("Правлю исходники, собираю debug-APK (…") and the rest of the sentence, the part
that tells the options apart, is gone. Forced line breaks cannot help, because the row draws a
single line per field, so anything past the screen width is lost.

The list item now lets a caller say how many lines a title and a subtitle may take, and the question
composer uses that: a label takes up to 3 lines and a description up to 5. The question body already
scrolls when it outgrows the panel (heightIn(max = questionBodyMaxHeight()) with verticalScroll
on Android, a ScrollView on iOS), so taller cards cost scroll, not hidden text.

  • OpenCodeListItem gets titleMaxLines / subtitleMaxLines (iOS titleLineLimit /
    subtitleLineLimit), both defaulting to 1, so every other list keeps its single line.
  • Only the question composer passes more; the "Type your own answer" row stays one line because its
    subtitle previews the answer being typed.
  • iOS and Android are both changed, with the same limits.

Screenshots

Before: attached in the conversation below — OpenCode Mobile 1.5.0 from Google Play, Android,
against an opencode server: a question with three options, every description ending in an ellipsis.
The same single-line row is still on main.

After: not captured yet. There is no Android SDK or Xcode on the machine this branch was prepared on,
so it was not built or run; the first build of it is the maintainer-run check.

Checks

  • iOS and Android both covered, or the reason one is not
  • Screenshots for UI changes — the "before" shot is in the conversation; the "after" one needs a
    build of this branch.
  • Tests run — none: no test asserts a row's line count, and the branch was not built here.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A question option carries the sentence that makes it worth picking, but
both list-item rows drew the title and subtitle on one line, so anything
past a phone's width ended in an ellipsis. The question body already
scrolls, so let the option's title take three lines and its description
five, while every other list keeps one line each.
@ivanfenenko

Copy link
Copy Markdown
Collaborator

Thank you for reporting this, @khativari, and for the clear screenshot. You were right about the bug.

We're fixing it in #1093 with our own implementation. It shows the full label and description instead of capping them at 3 and 5 lines, and keeps the selection control beside the first line. That PR credits you as the reporter.

If you'd like to be listed as a co-author, please sign the CLA before #1093 merges and we'll add you. We'll close this PR once it lands.

@ivanfenenko

Copy link
Copy Markdown
Collaborator

Thanks again for finding this, @khativari. The fix is now on main in #1093, so I'm closing this PR in favor of it.

Your report and screenshot showed us the problem, and #1093 credits you as the reporter. We wrote our own version so we could change a few things:

  • Labels and descriptions now show in full instead of stopping at 3 and 5 lines.
  • The selection control stays beside the first line on tall options.
  • The wrapped row is a reusable list item variant, with an example in the component gallery on iOS and Android.

We checked it on both platforms with long, multilingual and very long questions. Thank you for taking the time to report it and propose a fix.

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