Skip to content

fix: the attach tray is the tile grid again - #506

Merged
an1ndra merged 1 commit into
Developfrom
fix/attach-tray-ui
Nov 19, 2026
Merged

an1ndra merged 1 commit into
Developfrom
fix/attach-tray-ui

Conversation

@an1ndra

@an1ndra an1ndra commented Nov 19, 2026

Copy link
Copy Markdown
Owner

What was wrong

Merging feat/attach-tray (#493) kept Develop's older list sheet (AttachSheet) wired into the chat, so the branch's own tray — AttachTray — shipped unused. grep AttachTray ChatScreen.kt was 0: the feature merged, the design did not. The tray on screen was a "Share" list (Gallery / Contact / Location / Audio / Camera rows), never the tile grid the branch was built around.

The fix

The chat now opens AttachTray:

  • Camera as the tall tile, Gallery / Audio / Location / Contact beside it in the grid,
  • sized from AttachTrayMetrics (the width/keyboard slot maths that already has unit tests),
  • the launch guard (launchOrExplain) still wraps every tile, so a device without a camera or picker cannot crash the chat,
  • labels reuse the existing chat_media_* strings, so all 13 locales already cover them.

Proof

Installed on emulator-5556 and verified in the GUI: tapping the paperclip shows the tile grid with Camera, Gallery, Audio, Location, Contact — the screenshot is attached to the thread.

AttachTrayMetricsTest still covers the layout maths; the wiring is the one-line change from AttachSheet(...) to AttachTray(...).

Note

AttachSheet.kt is now unused by the chat. I left the file in place for this PR so the review is a single behaviour change; a follow-up can delete it and its preview.

Merging feat/attach-tray kept Develop's older list sheet wired into the
chat: AttachTray shipped, the sheet stayed, and attach still dimmed the
conversation behind a scrim with the keyboard up underneath. Only the
tray's own view was left out of the merge; everything it needs was there.

The chat now opens AttachTray in its own bottom bar, under the composer:

- the plus turns into the cross that closes the tray, and closing it
  hands focus back to the field, so the draft is never lost;
- opening the tray clears focus and hides the keyboard, and the tray is
  built to the measured keyboard height, so the composer holds still
  (0 px across the swap, per AttachTrayHeight);
- the composer clears nothing while the tray holds that slot, and its
  keyboard height comes from ImeGuard, so an OEM that overstates the
  inset cannot hand the tray a window-sized slot;
- Back closes the tray before it leaves the chat;
- every picker still goes through launchOrExplain, so a device without a
  camera app explains itself instead of crashing.

AttachSheet is removed with its preview: with the tray wired in it was a
second, unused attach UI.

JUnit: AttachTrayWiringTest (the tray in the bottom bar, all five tiles,
the keyboard swap, the Back handler, the dead sheet) and AudioAttachmentTest
reads the tray's Audio tile instead of the sheet's row.

scripts/test-attach-tray.sh: 26 checks on emulator-5556, 0 failed; on the
sheet build the same script fails 5, including "the keyboard stayed up
under the tray" and "the conversation disappeared behind the tray".
@an1ndra
an1ndra merged commit c1f6817 into Develop Nov 19, 2026
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.

1 participant