Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: anomalyco/opencode-android
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dev
Choose a base ref
...
head repository: anomalyco/opencode-android
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: android/table-cards
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 61 files changed
  • 1 contributor

Commits on Nov 23, 2026

  1. feat(transcript): show tables as cards on phones

    On a phone (smallest width < 600 dp, the app's existing tablet breakpoint,
    read from LocalConfiguration as SessionSheetView does) a Markdown table's
    body rows render as cards, as in the OpenCode chat apps: 10 dp corners
    (OpenCodeRadius.card), openCodeHairline, the floating fill, 12/14 dp padding
    and 10 dp between cards. The first cell is the semibold title over a hairline
    rule; every other cell sits 10 dp below under its column heading as an 11 sp
    medium uppercase label in the accent colour (2 dp gap). Empty cells keep their
    label; the heading row isn't shown. Tablets and wider windows keep the grid
    unchanged.
    
    Cells still go through MarkdownPresentation.present + ArrivingText with their
    tablePart selection keys, links and ReportsSessionLinks. Labels aren't
    selectable and TalkBack reads them as the heading as written, before the
    value; the cards carry collection semantics (one list item per row). A cell
    still streaming in holds its line, so cards grow row by row without jumping.
    The reply's selection document leaves the heading row out when tables are
    cards (TranscriptSelectionContext.tableCards), so copies match what's shown.
    
    Parity rows for MarkdownBands.swift and TranscriptSelectionText.swift say
    Android differs on purpose.
    
    Verified: scripts/check.sh (assembleDebug + lintDebug pass for every module;
    all unit tests pass except composer's
    AttachmentCameraLensTests.labelsShowTheLiveValueOnTheActiveLens, which fails
    the same way on origin/dev under this machine's comma-decimal locale).
    Emulator (Medium_Phone_API_35, 411 dp): the sample services reply and a
    two-column table render as cards in light and dark; origin/dev shows the grid.
    kommander committed Nov 23, 2026
    Configuration menu
    Copy the full SHA
    8e9832f View commit details
    Browse the repository at this point in the history
  2. test(transcript): cover table cards on phones and the grid on wider s…

    …creens
    
    Two Robolectric tests in TranscriptSelectionTests mirror the chat apps' table
    tests: on a phone each row is a card whose cells (empty ones too) carry their
    column heading as a label, the heading row isn't shown, and the selection
    document copies only the cards' cells; at sw720dp the grid shows the heading
    row. They host MarkdownBlocksView in a ComposeView as the composer tests do,
    so the module's tests now use androidx.activity (catalog entry
    androidx-activity-compose, test only). Parity test row updated.
    
    Verified: ./gradlew :feature:transcript:testDebugUnitTest (234 tests, 0
    failures), and each test fails if the phone/tablet switch goes the wrong way.
    kommander committed Nov 23, 2026
    Configuration menu
    Copy the full SHA
    942342d View commit details
    Browse the repository at this point in the history
  3. feat(transcript): show cards only for tables that would scroll

    Table cards now replace the grid only where it would scroll sideways: when
    every column at its narrowest readable width still doesn't fit the block
    (MarkdownTableFit.scrolls, narrowest total > room). Tables that fit, or fit
    by shrinking their columns, keep today's grid on any screen. The phone-only
    gate (showsTableCards) is gone.
    
    The grid's column sizing moved unchanged into one pure function
    (Density.markdownTableFit → MarkdownTableFit.columnWidths/scrolls) that both
    the grid's layout and the cards decision use. MarkdownTable is a
    SubcomposeLayout: it measures the cells (plain Text probes, same text, style
    and inline content as the grid's cells, not placed and without semantics),
    decides, then composes only the cards or only the grid, so neither draws
    first. A latch keeps a table cards once it went cards at a width, so a
    streaming cell that shrinks as its Markdown closes can't flip it back; a new
    width decides afresh.
    
    Selection: the selection text can't know the drawn width cheaply, so it
    keeps the heading cells as leaves (back to origin/dev's
    TranscriptSelectionText, TranscriptListSelection and TranscriptList). Leaves
    without a drawn anchor are already normal (rows scrolled away): hit testing
    and handles only use drawn ones, so the only effect is that a copy starting
    before a carded table includes its heading row.
    
    Tests: a five-column table with long cells → cards with labels (empty cells
    too) and no heading row; a table that fits → grid with its heading row.
    Both run with Robolectric native graphics (real text widths). Forcing the
    decision to always-cards or always-grid fails exactly one each. Parity rows
    updated.
    
    Verified: scripts/check.sh tasks with --continue: assembleDebug and
    lintDebug pass for every module; unit tests pass everywhere except
    composer's AttachmentCameraLensTests.labelsShowTheLiveValueOnTheActiveLens
    (comma-decimal locale on this machine; fails the same on origin/dev).
    Emulator (Medium_Phone_API_35, 411 dp): the six-column endpoints reply
    renders as cards (light and dark); origin/dev scrolls it; the two-column
    settings table stays a grid.
    kommander committed Nov 23, 2026
    Configuration menu
    Copy the full SHA
    101ab46 View commit details
    Browse the repository at this point in the history
  4. feat(transcript): switch a carded table to the grid and back

    A table that goes to cards automatically (it would scroll sideways) gets a
    quiet switch at the top end of its block: the table glyph (tablecells) over
    the cards, the cards glyph (rectangle.split.1x2) over the grid. It follows
    the code block's Copy button: a 24 dp face with a 16 dp glyph in the
    secondary text colour, darker with a light fill while pressed, no ripple or
    haptic. Its 48 dp target is centred on the face and reaches into the margins
    around it, so the table moves down only 28 dp. TalkBack reads it as a button,
    “Show as Table” / “Show as Cards” (new strings, translated for all 56
    languages with scripts/translate.py --model opencode/deepseek-v4-pro, since
    the default model was unavailable). Tables that fit stay grids with no switch.
    
    The pick is per table, in rememberSaveable inside the table's block, so it
    stays while the row scrolls away and back and while the reply grows; picking
    the table shows today's grid with its heading row.
    
    Tests: the wide table shows cards and “Show as Table”; tapping it shows the
    grid with its heading row and “Show as Cards”; tapping again shows cards; a
    fitting table has no switch. Parity row updated.
    
    Verified: scripts/check.sh tasks with --continue (translations OK; assemble
    and lint pass everywhere; all unit tests pass except composer's
    AttachmentCameraLensTests locale failure, same on origin/dev). Emulator
    (Medium_Phone_API_35): cards with the switch in light and dark, tap → grid,
    and after scrolling the table several screens out of the list and back it is
    still the grid; the two-column table has no switch.
    kommander committed Nov 23, 2026
    Configuration menu
    Copy the full SHA
    a4a751d View commit details
    Browse the repository at this point in the history
Loading