Skip to content

fix(mobile): render markdown tables as a chip that opens a full-screen modal#4379

Merged
iscekic merged 3 commits into
mainfrom
mobile/markdown-table-modal
Jul 3, 2026
Merged

fix(mobile): render markdown tables as a chip that opens a full-screen modal#4379
iscekic merged 3 commits into
mainfrom
mobile/markdown-table-modal

Conversation

@iscekic

@iscekic iscekic commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Problem

User report (Samsung Galaxy S24, Android 16): markdown tables with more than 2 columns are unusable, and messages overlap each other in kiloclaw chat.

Both symptoms traced to the same root cause — tables rendered inside a horizontal ScrollView within the message bubble:

  1. Gesture conflict: the bubble's swipe-to-reply Gesture.Pan() activates after just 12px of leftward drag — exactly the gesture needed to scroll a wide table — so the pan steals the touch and the table can't scroll.
  2. Overlapping messages: a horizontal ScrollView inside a width-constrained bubble mis-measures its height on RN Fabric (the same bug already documented and worked around for code blocks in markdown-text.tsx), corrupting FlashList row layout.

Fix

Tables now render as a compact "View table" chip inline (icon + N columns · M rows summary). Tapping it opens a full-screen modal where the table scrolls both horizontally and vertically with roomier columns sized to the window width.

  • No horizontal ScrollView ever renders inside a bubble anymore → both bugs are structurally gone.
  • Added surfaceColor to MarkdownPalette so user-bubble tables (light ink on primary/lime) stay readable when rendered in the modal outside their bubble.
  • Applies to both kiloclaw chat and cloud agents chat — they share the MarkdownText renderer.

Testing

  • pnpm format && pnpm typecheck && pnpm lint && pnpm check:unused all pass.

iscekic added 2 commits July 3, 2026 13:28
…the screen

PermissionCard rendered patterns/metadata (often a full command) in plain
Views with no height limit. As a pinned footer below the message list it
could grow past the screen, pushing the Deny/Allow buttons off-screen with
no way to scroll — approvals became impossible to act on.

Wrap the card body in a ScrollView capped at max-h-96 (same pattern as
QuestionCard) and let both cards shrink when the available height is
smaller (e.g. keyboard open on small screens), keeping the action buttons
pinned and reachable while the content scrolls.
…n modal

Tables previously rendered inside a horizontal ScrollView within the
message bubble, which caused two Android-reported bugs:

- Scrolling the table leftward activated the bubble's swipe-to-reply pan
  gesture (12px activation offset), making tables with more than 2
  columns unusable.
- A horizontal ScrollView inside a width-constrained bubble mis-measures
  its height on RN Fabric (same bug already worked around for code
  blocks), producing overlapping messages in the FlashList.

Tables now render as a compact 'View table' chip inline; tapping it opens
a full-screen modal where the table scrolls both ways with roomier
columns. No horizontal ScrollView ever renders inside a bubble anymore.

Applies to both kiloclaw chat and cloud agents chat via the shared
MarkdownText renderer.
@iscekic iscekic self-assigned this Jul 3, 2026
@iscekic iscekic requested a review from jeanduplessis July 3, 2026 11:37
@iscekic iscekic enabled auto-merge (squash) July 3, 2026 11:40
@iscekic iscekic merged commit 1fe91b8 into main Jul 3, 2026
18 checks passed
@iscekic iscekic deleted the mobile/markdown-table-modal branch July 3, 2026 11:42
@kilo-code-bot

kilo-code-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the current diff (markdown-palette.ts, markdown-table.tsx, markdown-text.tsx) that replaces the in-bubble scrollable markdown table with a chip that opens a full-screen modal; found no high-confidence security, correctness, or breaking-change issues in the changed lines.

Files Reviewed (3 files)
  • apps/mobile/src/components/agents/markdown-palette.ts
  • apps/mobile/src/components/agents/markdown-table.tsx
  • apps/mobile/src/components/agents/markdown-text.tsx

Note: the PR's commit history also includes a permission-card.tsx/question-card.tsx scroll fix, but that change is already present on main and is not part of the current diff against the base branch, so it was excluded from this review.


Reviewed by claude-sonnet-5 · Input: 58 · Output: 25.8K · Cached: 2.2M

Review guidance: REVIEW.md from base branch main

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