Skip to content

Fix Android multi-file attach, add image compression, and trim tab/drawer padding - #2352

Merged
trissim merged 1 commit into
mainfrom
feat/android-multifile-image-compress-and-tab-padding
Nov 28, 2026
Merged

trissim merged 1 commit into
mainfrom
feat/android-multifile-image-compress-and-tab-padding

Conversation

@trissim

@trissim trissim commented Nov 28, 2026

Copy link
Copy Markdown

Fixes Android multi-file attachment, adds 1-tap + oversized image compression on the composer, and removes dead horizontal trailing padding in tabs, marquee scroll, and folded drawers.

Changes

  1. Android multi-file attach (tools/android/keepalive/java/org/toadcomms/AttachChooser.java):
    • Added normalizeMultiSelect: clears data.setData(null) whenever RESULT_OK returns ClipData with >1 items and both data and clipData are populated, working around Qt 6 QAndroidPlatformFileDialogHelper::handleActivityResult short-circuiting on getData() before checking getClipData().
    • Added Android 13+ native multi-select Photo Picker (MediaStore.ACTION_PICK_IMAGES with MediaStore.EXTRA_PICK_IMAGES_MAX = MediaStore.getPickImagesMaxLimit()) to EXTRA_INITIAL_INTENTS alongside Camera when EXTRA_ALLOW_MULTIPLE is set.
  2. Image compression option & scrollable attachment chips (src/toad/client/message_files.py, src/toad/qt/file_pickers.py, src/toad/qt/composer.py):
    • Added ImageCompressionControl + MessagePromptComposer.compress_attached_images() and QtCompressImagesButton(ImageCompressionControl, QtPushButton) beside a horizontally scrollable attached_scroll chip bar on QtMessageComposer.
    • Added compress_image_bytes using Qt built-in QImage/QBuffer (downscales longest edge to 2048px + JPEG quality 82, picking smaller PNG if downscaled PNG wins, keeping only strict size reductions) plus auto-compression in read_picked when an attached image exceeds read_limit.
    • Allowed sending attached files with or without text in QtMessageComposer.submit().
  3. Tab, marquee & drawer padding (src/toad/qt/name_wave.py, src/toad/qt/window.py, src/toad/motion.py):
    • Sized close-button width tightly around × (max(18, advance("×") + 10)) while keeping thumb-friendly height (>= 24), eliminating the ~37 dp dead gap between tab titles and ×.
    • Anchored _cached_title right edge directly to close_slot.geometry().left() - TAB_TEXT_CLOSE_GAP, left-aligned non-overflowing tab text, tightened TAB_MARQUEE.gap (24 -> 14), and trimmed QSS horizontal padding on QTabBar::tab, #SidebarToggle, and navigation.

Verification

  • javac -cp android-35/android.jar AttachChooser.java: JAVAC_OK.
  • pytest tests/model/test_android_perf_ux_arrivals.py tests/textual/test_name_wave_repaint.py tests/textual/test_message_file_chips.py: 52 passed.
  • tools/qt_inherit_ratchet.py: 0/0/0/0/0; tools/glyph_check.py: 0; REL_IMPORTS=0.

@trissim
trissim merged commit 8d15381 into main Nov 28, 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