Skip to content

fix(mobile): show and control review memory state in the app - #8253

Merged
iscekic merged 4 commits into
mainfrom
drain/review-memory-enabled-control
Oct 21, 2026
Merged

iscekic merged 4 commits into
mainfrom
drain/review-memory-enabled-control

Conversation

@iscekic

@iscekic iscekic commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Change

apps/mobile/src/components/code-reviewer/review-memory-screen.tsx grows an enabled-state row above the proposals body. It states that review memory is on and offers the same on/off control as the web review memory panel, calling useSetReviewMemoryEnabled(scope) with the next value.

  • The row is one named control: a Pressable with accessibilityRole="switch", the checked/disabled/busy state, min-h-11 and flex-1, while the native Switch stays out of the accessibility tree — the shape PreferenceRow uses (apps/mobile/src/components/ui/preference-row.tsx). A tap anywhere on the row moves the value. A reader who cannot edit sees the same row inert, plus the existing codeReviewer.reviewMemory.readOnlyDescription line.
  • The row sits above the proposals body, so it stays reachable through the proposals loading skeleton, the first-page load error, the empty proposals state, and the paginated list. The paginated list reserves the tab-bar band with useTabBarBottomPadding from @/components/tab-screen as a footer spacer, the shared helper the other tab screens use.
  • useSetReviewMemoryEnabled now writes the stored value into the cached dashboard summary on success and then invalidates that query, so a settled toggle shows immediately, the screen keeps one source, and the refetch replaces the value.

Copy: one new key, codeReviewer.reviewMemory.on ("Review memory is on"), translated into all 86 non-English catalogs; codeReviewer.reviewMemory.readOnlyDescription becomes "Only organization owners and billing managers can change review memory.", re-translated everywhere.

Tests: review-memory-screen.mounted.test.tsx covers the row above the empty proposals state (asserting the order), the row press calling the mutation with false, the row disabled while the mutation is pending, the read-only variant and its copy, and the tab-bar clearance spacer's height. use-review-memory.test.ts covers the settled cache write, the invalidation, and the error announcement.

End-to-end evidence

Android emulator (omp36, cached CI dev client) against the local dev stack, signed in with a throwaway local test account:

  1. Profile > Code Reviewer > GitHub > Review memory in the off state: "Review memory is off", description, and the "Enable review memory" button.
  2. Pressed "Enable review memory". A UI dump then reports one switch node, checked="true", spanning the label-and-switch row, with the empty proposals state below it.
  3. Tapped the label text. The screen returned to "Review memory is off" with the enable button, and the personal GitHub review config in the local database recorded the disabled value.

Checks run on this VM: catalog parity (87 catalogs match en.json), check:i18n, check:plurals, pnpm --filter kilo-app exec vitest run src/components/code-reviewer src/lib/hooks/use-review-memory.test.ts (12 files, 196 tests), pnpm --filter kilo-app run typecheck (clean), pnpm --filter kilo-app run lint (clean), format:check (clean).

main was merged into the branch twice. The conflicts were the two locale catalogs that had also gained translation fixes on main, and the screen's tab-bar clearance line, where main's shared useTabBarBottomPadding helper replaced the per-screen height computation; the branch takes main's helper, so the screen keeps one clearance mechanism, and the mounted test asserts the spacer height it feeds.

The change is ordinary JSX with a Switch: no Platform.OS-specific behavior beyond the shared tab-bar height helper, no keyboard, safe-area, or text-truncation behavior, so Android proof covers it.

Proxy answers

The owner's proxy gave these answers in the owner's place.

  1. Question: Control: Enabled state control: native Switch row (parity with the web panel and the mobile auto-reviews row) or an explicit "Turn off" button?
    Answer: Switch row
    Confidence: 0.85 · Precedent: UX: keep similar elements consistent across surfaces — an earlier request was that a thought row should "match the tool call row".
  2. Question: Placement: Should the on-state control stay visible through the proposals loading skeleton, first-page error, empty state, and list, or scroll with the list as its header?
    Answer: Above the body, always visible
    Confidence: 0.85 · Precedent: Plans cover happy, loading, error, and empty states; the brief requires the control to stay reachable.
  3. Question: Read-only: A reader who cannot edit (plain org member) lands on the enabled state: what should they see?
    Answer: Disabled switch + existing read-only copy
    Confidence: 0.85 · Precedent: none
  4. Question: State feedback: How should the switch reflect the change while it settles?
    Answer: Mutation result overrides summary
    Confidence: 0.70 · Precedent: UX best-in-class, no visible lag or layout shift — "design and UX MUST BE BEST-IN-CLASS".
  5. Question: Copy: New English copy for the enabled state: one key ("Review memory is on") or a key plus a description line?
    Answer: One key
    Confidence: 0.65 · Precedent: Remove redundant copy — the owner asked to remove redundant "context" copy once before.

The review memory screen now renders an enabled-state row above the
proposals: it states that review memory is on and exposes the same on/off
control as the web panel, calling useSetReviewMemoryEnabled with the next
value. The row reflects the stored value as soon as the mutation settles,
stays visible above the proposals list, the empty state and the load error,
and renders inert with the permission explanation for a reader who cannot
edit.

Adds the codeReviewer.reviewMemory.on copy key and its translations for every
catalog.
@iscekic iscekic added drain Work item from the findings drain explorer:ios Finding surfaced by the iOS explorer labels Oct 20, 2026
@iscekic

iscekic commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Android emulator proof for the review memory control, exercised through Profile > Code Reviewer > GitHub > Review memory on the local dev stack with a throwaway test account.

  1. Off state before enabling: the enable button is the only control.
  2. After enabling: the screen states that review memory is on and shows the switch in the on position, with the empty proposals state below it.
  3. After toggling the switch off: the off state and enable button return.

The same run's UI dump reported checked="true" for the switch on the enabled screen, and the local database recorded the disabled state after the toggle.

Review memory screen in the off state before enabling

Review memory screen after enabling: on-state row with switch and empty proposals state

Review memory screen after toggling the switch off: off state returns

@kilo-code-bot

kilo-code-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The follow-up commit makes the summary query the single source of truth by writing the settled mutation value into its cache, adds tab-bar clearance to the proposals list, and covers the new toggle row and hook with tests; the previously reported findings are resolved and no new problems were found in the changed lines.

Files Reviewed (91 files)
  • apps/mobile/src/components/code-reviewer/review-memory-screen.tsx
  • apps/mobile/src/components/code-reviewer/review-memory-screen.mounted.test.tsx
  • apps/mobile/src/lib/hooks/use-review-memory.ts
  • apps/mobile/src/lib/hooks/use-review-memory.test.ts
  • apps/mobile/src/i18n/locales/*.json (87 catalogs; only codeReviewer.reviewMemory.readOnlyDescription changed in each, verified against en.json)
Previous Review Summary (commit 6c9d7f9)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 6c9d7f9)

Status: 5 Issues Found | Recommendation: Address before merge

Executive Summary

The new proposals list viewport now extends under the absolutely positioned tab bar, hiding the last row and pagination footer, and the toggle's mutation value permanently overrides fresher summary state.

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/components/code-reviewer/review-memory-screen.tsx 177 style={listStyle} bounds the list to the screen bottom on a tab route with an absolute tab bar and no reserved bottom clearance, so the last proposal and pagination footer sit behind the bar.
apps/mobile/src/components/code-reviewer/review-memory-screen.tsx 46 Mutation data is never reset, so setEnabled.data?.enabled keeps overriding the summary for the whole mount; the added comment claiming the summary takes over is incorrect, and a state change made elsewhere cannot correct the screen.

SUGGESTION

File Line Issue
apps/mobile/src/components/code-reviewer/review-memory-screen.tsx 213 The native Switch is the only interactive element (~51x31pt target) and the visible status label is inert; the shared PreferenceRow/ToggleRow row exists for this shape.
apps/mobile/src/components/code-reviewer/review-memory-screen.tsx 224 The read-only copy talks about who may enable review memory while the disabled control here can only disable it.
apps/mobile/src/components/code-reviewer/review-memory-screen.mounted.test.tsx 310 The "below it" claim is not asserted as ordering, and the first-page error case the commit says is covered never asserts the row is present.
Files Reviewed (89 files)
  • apps/mobile/src/components/code-reviewer/review-memory-screen.tsx - 4 issues
  • apps/mobile/src/components/code-reviewer/review-memory-screen.mounted.test.tsx - 1 issue
  • apps/mobile/src/i18n/locales/*.json (87 catalogs) - no issues; the new codeReviewer.reviewMemory.on key is present once per catalog, directly after off, inside reviewMemory, with no duplicate keys, encoding damage, or copy collisions

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash-1017 · Input: 84.2K · Output: 19.2K · Cached: 1.6M

Review guidance: REVIEW.md from base branch main

- The on-state row exposes a single switch role over the label, so a tap
  anywhere on the row moves the value, and the native switch stays out of the
  accessibility tree — the shape PreferenceRow already uses.
- The proposals list reserves the tab bar band so the last row scrolls clear
  of it.
- The settled mutation writes the stored value into the cached dashboard
  summary, so the screen keeps one source and the refetch replaces it instead
  of a value that outlives the request.
- The read-only copy now covers changing the setting in either direction, with
  every catalog updated.
@iscekic

iscekic commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Updated Android emulator proof after the review fixes, on the final head, through Profile > Code Reviewer > GitHub > Review memory with a throwaway test account.

  1. Off state: only the enable button.
  2. After enabling: the row states that review memory is on, with the empty proposals state below it.

The same run's UI dump exposes one switch node for the row, checked="true", spanning the label- plus-switch row rather than only the switch thumb, and a tap on the label text turned review memory off: the screen returned to the off state and the local database recorded the disabled value.

Checks on this VM: catalog parity across 87 catalogs, check:i18n, check:plurals, pnpm --filter kilo-app exec vitest run src/components/code-reviewer src/i18n src/lib/hooks/use-review-memory.test.ts (26 files, 1753 tests), tsc --noEmit clean, oxlint clean on the changed files.

Review memory screen in the off state

Review memory screen after enabling: on-state row and empty proposals state

@iscekic iscekic added merge:human Substantive functional risk requires human review. merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. and removed merge:human Substantive functional risk requires human review. labels Oct 20, 2026
…nabled-control

# Conflicts:
#	apps/mobile/src/i18n/locales/de.json
#	apps/mobile/src/i18n/locales/sv.json
@iscekic
iscekic disabled auto-merge October 21, 2026 17:11
@iscekic iscekic removed the merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. label Oct 21, 2026
…nabled-control

# Conflicts:
#	apps/mobile/src/components/code-reviewer/review-memory-screen.tsx
@iscekic iscekic added the merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. label Oct 21, 2026
@iscekic

iscekic commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Android emulator proof on the merged head, exercised through Profile > Code Reviewer > GitHub > Review memory on the local dev stack with a throwaway test account.

  1. Off state: only the enable button is offered.
  2. After enabling: the row states that review memory is on and exposes one switch node covering the label and thumb (checked="true"), with the empty proposals state below it.
  3. After tapping that row: the off state and the enable button return.

The uiautomator dumps were taken in the same commands as the captures, and the app config row recorded the disabled value after the toggle.

![Review memory screen in the off state before enabling](attachment:review-memory-off.png#Review memory screen in the off state: enable button only)
![Review memory screen after enabling: on-state row with one switch node and the empty proposals state](attachment:review-memory-on.png#Review memory screen after enabling: on-state row with switch and empty proposals state)
![Review memory screen after toggling the row off: the off state returns](attachment:review-memory-off2.png#Review memory screen after toggling off: off state with enable button)

Review memory screen in the off state: enable button only

Review memory screen after enabling: on-state row with switch and empty proposals state

Review memory screen after toggling off: off state with enable button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drain Work item from the findings drain explorer:ios Finding surfaced by the iOS explorer merge:bot Bot-owned review; merge when ready once readiness passes and a review approves.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants