Skip to content

fix(thread): the list's end holds the typing / working line's slot - #5168

Merged
stamp-build[bot] merged 6 commits into
mainfrom
agent/lagoon/working-line-in-layout
Nov 20, 2026
Merged

stamp-build[bot] merged 6 commits into
mainfrom
agent/lagoon/working-line-in-layout

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Lagoon from raft opened this pull request through Stamp
View in Stamp →


Problem

Android 1.27.0: on entering a channel, the line above the composer ("1 个 Agent 正在这里工作") covered the last line of the newest message.

The line floats over the end of the message list, on a solid 24dp band of the list's end fade. The list's last spacer row was 16dp and grew to 46dp only while the line showed, which is after first layout (the typing / working state arrives late). Every scroll owner parked the newest message with a constant 16dp trailing padding (the initial-anchor check, the focused-tail fit, the RenderedBottom anchor), so the spacer and the anchors disagreed by 30dp whenever the line showed. The row changing height also moved the messages and gave ThreadReadingAnchorKeeper (#5067, new in 1.27) a height change to put back.

Fix

The list's end holds the line's slot in every conversation that can show the line, whether or not it shows.

  • threadBottomSpacerAndAnchorTrailingHeight(typingLineSlot) is 16dp + the 30dp ThreadAgentTypingListEndHeight with the slot, 16dp without. The list resolves it once and uses that one value for its last row. The conditional agentTyping != null term is gone, so the row never changes height with agent activity: nothing moves when the line comes or goes, and the keeper has nothing to undo.
  • typingLineSlot is RaftThreadScreenPayload.agentTypingLineCanShow(): showComposer && joined && !channelArchived, carried on the timeline slice as agentTypingLineSlot. It reads the conversation's own flags only, not access resolution or write authority, which are false for a moment on every open and would change the end right after first layout.
  • The same condition now gates the line itself in rememberThreadAgentTyping. It was showComposer alone, which no production code sets to false. So a channel previewed without joining and an archived channel no longer show the line; otherwise the line would float over a 16dp end there.
  • The scroll owners read the same value: initialBottomAnchorTrailingPaddingPx is derived from it and feeds the initial-anchor check, both focused-tail fits and, through the fit's trailing span, the RenderedBottom anchor. With the slot, the newest message at rest ends 46dp above the list's edge in every path, 22dp above the line's top.
  • The line is still an overlay over that slot, on the end fade's solid band while it shows; without the line only the 24dp gradient is drawn. Unchanged from main.

Per consumer of the old conditional height:

  • Jump pills (Back to Bottom, next unread thread, Select to here): 24dp above the list's edge wherever the conversation has the slot, not only while the line shows. Following the line's visibility would make them jump by a line when it toggles.
  • selectToHereBottomOcclusionPx: unchanged, still follows the line being visible. It only decides which rows count as visible and moves nothing; without the line, a row scrolled into the bottom 24dp really is visible.
  • Share capture: unchanged. The line and the band stay hidden during capture. Each slice is bounded by the message's own remaining height (threadShareCaptureSlice), so the spacer row is never in the image and the taller end adds no blank band.

Accepted cost: about 30dp more blank between the newest message and the composer when no agent is typing or working, and the pills 24dp higher then. Conversations without a composer keep the plain 16dp end.

The condition can change for one open conversation: joining a previewed channel (16dp to 46dp) and a channel learned to be archived from the canonical load (46dp to 16dp). The newest message then moves by 30dp once, in the same moment the footer under the list changes (join footer to composer, composer to archived banner).

The first version of this PR made the line a layout row under the list. That is reverted (d4c90d15): a row moves the whole list by a line whenever the line comes or goes.

Tests

  • New ThreadAgentTypingLineLayoutUiTest (Robolectric, the production ThreadMessagesList, bottom-up):
    • parked at the newest message, anchored on it (focused entry) and following latest: showing and then hiding the line leaves the newest message at least 22dp above the line's top and at exactly the same position;
    • opened on the newest message with the line already showing: clear of the line;
    • opened at the bottom with the line already showing: clear of the line, and the initial bottom anchor logs result=anchored with no result=retry;
    • a channel previewed without joining: the initial anchor logs result=anchored with no retry on the plain end, and after joining the newest message ends exactly 30dp further from the list's edge.
  • Red on main's code (head d4c90d15, run 44769616521, the first four cases): both toggle cases fail on "the newest message moved when the line showed", and the initial-anchor case fails on "the initial anchor retried". The focused-entry case with the line already showing passed on main's code, and the anchored toggle case failed on the move, not on the overlap, so this harness does not reproduce the reported overlap itself.
  • ThreadAgentTypingTest: the condition, its copy on the timeline slice, and the two heights (46dp, 16dp).
  • ThreadChannelOpenSettleTest takes its padding row from the production function.
  • Six assistant.panel.* goldens re-recorded by CI (test.yml record_screenshots=true, run 44777727374): the panel hosts the real list, whose rows sit 30dp higher.

Not covered: no device, iOS or desktop run; no real IME; share capture is not exercised by a test.

🤖 Generated with Claude Code

Lagoon and others added 2 commits November 20, 2026 15:33
Composes the production ThreadMessagesList parked at the newest message
(anchored on it, and following the latest), shows and hides the line, and
checks the list ends where the line starts. Red on main: the line floats
over the list's end.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…mposer

The line ("Niko is typing…", "1 agent working here") floated over the end of
the message list, on a solid band of the list's end fade. The list made room
for it with a taller last row once the typing state arrived; when the
conversation was opened on a message, the reading anchor keeper saw a row
change height without a scroll and put the anchor back, leaving the newest
message's last line under the band.

The line is now a layout sibling under the list viewport, so the list ends
where the line starts and its geometry needs no knowledge of it. Removed with
it: the extra list-end height, the solid band of the end fade, the jump
pills' bottom padding and select-to-here's bottom occlusion. Still hidden
while Generate image captures the list.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@stamp-build stamp-build Bot added the build-alpha Build a cloud-hosted .alpha validation APK label Nov 20, 2026
Lagoon and others added 2 commits November 20, 2026 16:03
…instead

The row made the whole list move by a line whenever the typing / working line
came or went. Back to main's floating line; the regression test now checks
that the newest message is clear of the line and does not move when the line
shows or hides, and that the initial bottom anchor holds on its first attempt
with the line already showing. Red on main's code; the fix follows.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The line above the composer ("Niko is typing…", "1 agent working here")
covered the last line of the newest message on entering a conversation
(Android 1.27.0). The list's last spacer row was 16dp and grew to 46dp only
while the line showed, after first layout, while every scroll owner parked
the newest message with a constant 16dp trailing padding; the row changing
height also moved the messages and gave the reading anchor keeper something
to put back.

The spacer row is now always the full end (16dp + the line's 30dp slot),
and the scroll owners' trailing padding reads the same constant,
ThreadBottomSpacerAndAnchorTrailingHeight: the initial-anchor check, the
focused-tail fit and the RenderedBottom anchor. The line still floats over
that slot on the end fade's solid band while it shows. The jump pills sit
above the slot whether or not the line shows, so they do not move either.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@stamp-build stamp-build Bot changed the title fix(thread): the typing / working line takes its own row above the composer fix(thread): the list's end always holds the typing / working line's slot Nov 20, 2026
Lagoon and others added 2 commits November 20, 2026 17:18
… taller end

The six assistant.panel.* captures host the real message list: its rows sit
30dp higher now that the list's end always holds the typing line's slot.
Recorded by CI (test.yml record_screenshots=true, run 44777727374).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… composer

The list's taller end is for the typing / working line, so it belongs only
to conversations that can show the line. One condition,
RaftThreadScreenPayload.agentTypingLineCanShow (showComposer, joined, not
archived), now decides both the line itself and its slot; the timeline slice
carries it and the list resolves the end's height once
(threadBottomSpacerAndAnchorTrailingHeight) for the spacer row and the
scroll owners. A channel previewed without joining or an archived one keeps
the plain 16dp end and no longer shows the line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@stamp-build stamp-build Bot changed the title fix(thread): the list's end always holds the typing / working line's slot fix(thread): the list's end holds the typing / working line's slot Nov 20, 2026
@stamp-build
stamp-build Bot merged commit 784c5d2 into main Nov 20, 2026
19 checks passed
@stamp-build

stamp-build Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

New failure in post-merge full tests: workflow App link diagnose on branch main after PR 5168 merged.

Newly failing:

  • Report (possibly flaky)

It could be any of PR 5160, PR 5162, PR 5164, PR 5165, PR 5167, PR 5168, PR 5169, PR 5170 and 14 more.

Please fix. See logs: stamp run view 44849680002 --repo botiverse/mobile --log-failed

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

Labels

build-alpha Build a cloud-hosted .alpha validation APK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants