Skip to content

feat(chat): add attachment categories (Story 1.9) - #184

Closed
assisjp wants to merge 15 commits into
oxidezap:mainfrom
assisjp:feat/attachment-categories
Closed

assisjp wants to merge 15 commits into
oxidezap:mainfrom
assisjp:feat/attachment-categories

Conversation

@assisjp

@assisjp assisjp commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Why

The attachment button needs an explicit choice between sending the original file and sending supported visual media. This keeps the selected WhatsApp media kind predictable without bypassing the existing confirmation step.

What changed

  • The attach button opens Documento and Fotos e vídeos. Dismissing the menu selects and sends nothing.
  • Documento accepts a valid file as OutgoingMedia::Document, including JPG, MP4, and HEIC, while preserving its original name, MIME metadata, and bytes.
  • Fotos e vídeos keeps supported images as images and videos as videos. The browser picker gets an accept hint; all results are validated after selection. The macOS native picker cannot visually filter extensions, so incompatible selections are refused with guidance to use Documento.
  • HEIC is supported as Documento only; the client does not convert it to a drawable photo.
  • Both choices reuse the existing preview and explicit Cancel/Send confirmation, including destination capture and reply-on-first-file behavior. Clipboard and drag/drop keep automatic classification and confirmation.

Validation and remaining checks

  • Passed on macOS: cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo test --workspace --all-features -q (run with local socket access). The development cargo build --bin oxidezap passed; the installed development app was launched and the user confirmed it worked.
  • Automated tests cover category routing, MIME/kind mapping, refusal, confirmation, and clipboard/drop regressions. Browser accept is unit-tested, but browser runtime was not exercised.
  • In the installed combined macOS app, the user manually tested the functions covered by this draft, including photo/video attachment choice and the corrected video flow, and reported they worked. A separate per-format JPG/PNG/MP4 and receiving-device matrix is not documented; no message or media was sent during automated validation.
  • The optimized local build stopped for lack of disk space (No space left on device), not a code error. Build cache was preserved; no cleanup was performed.
  • CodeRabbit is not configured for this repository. Story docs/stories/1.9.story.md is Ready for Review and retains unchecked manual/optimized-build tasks.

Stacked PR context

This draft targets oxidezap/client:main from assisjp:feat/attachment-categories. Commit e68e775 is directly on top of d55b209, the head of #183, which in turn depends on #182. Because the earlier heads exist only on the fork, the GitHub diff against main is cumulative and includes the earlier work until those PRs merge or this branch is rebased. Please review the Story 1.9 delta at commit e68e775 for now. This PR does not merge or modify #182 or #183.

Current integration status: GitHub reports this draft branch conflicts with main. Resolve the stacked integration and run CI on the resulting head before marking it Ready for Review. The macOS manual report concerns the combined app, not a standalone validation of this branch.


Summary by cubic

Adds an explicit Documento or Fotos e vídeos choice to the attachment button so the WhatsApp media kind is set before selection; dismissing the menu selects nothing.

  • Documento sends any valid file as OutgoingMedia::Document, preserving its name, MIME metadata, and bytes; JPG, MP4, and HEIC pass through unchanged.
  • Fotos e vídeos sends images as images and videos as videos. The picker gets an accept hint, but files are still validated after selection; macOS's native picker cannot filter extensions, so incompatible picks are refused with guidance to use Documento.
  • HEIC is Documento-only.
  • Both categories reuse the existing preview and Cancel/Send confirmation, including destination capture and reply-on-first-file behavior. Clipboard and drag/drop keep automatic classification.
  • Follow-up review findings are addressed, and the internal staging stories were removed.

The diff against main is cumulative and also carries the unmerged message-action, attachment-preview, and desktop-reliability branches; this PR's change is the attachment-category routing described above.

Written for commit f0ae64b. Summary will update on new commits.

Review in cubic

Route screenshot paste through a confirmation preview and surface live
server acknowledgements. Complete archived chat discovery, recover
group subjects, and keep phone notifications eligible with manual
companion presence. Desktop alerts inherit mute/archive policy with
a direct-mention exception.

Add preference-provenance migration; legacy rows refresh on the next
history sync because prior source precedence cannot be reconstructed.
An absent archive field from older frames is unknown, not false.
Carry the optional store answer so the GUI can unarchive promptly
without pulling archived chats into the active list on unknown state.
Require confirmation before deleting messages or sending picker/drop attachments. Surface accepted edits on own and received bubbles, and allow copying selected message text.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Prevent stale archive and read state during asynchronous sync, and retain notification clicks through chat hydration. Keep macOS alerts ordered and audible where notification policy permits.
…s-attachment-preview

# Conflicts:
#	crates/gui/src/app/mod.rs
@assisjp

assisjp commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by PR #200, which includes the Documento / Fotos e vídeos attachment-category and selection-validation work from this draft in a single branch based on current main. The discussion and commits here remain available as history. Closing this draft to keep review on #200; its branch will not be deleted.

@assisjp assisjp closed this Sep 23, 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