[PR #6964] [MERGED] fix(android): offer the camera when a page asks for a picture #7407

Closed
opened 2026-10-23 04:19:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6964
Author: @SpicyMarinara
Created: 10/2/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/android-camera


📝 Commits (4)

  • 1f831ed fix(android): offer the camera when a page asks for a picture
  • 622bfd4 fix(android): build the camera chooser inside the error guard
  • 2532c15 Merge remote-tracking branch 'origin/staging' into fix/android-camera
  • 8b5c8e8 fix(android): keep the camera photo's address if the app is closed

📊 Changes

3 files changed (+116 additions, -4 deletions)

View changed files

📝 CHANGELOG.md (+2 -1)
📝 android/app/src/main/java/com/marinara/engine/MainActivity.java (+84 -3)
➕ scripts/regressions/android-file-chooser-camera.regression.ts (+30 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6953

Why this change

In the Marinara Android app, picking a picture never offered the camera, for Noodle posts or chat attachments. You could only choose an existing file. In Chrome on Android you get a Camera option (Noodle 1.4.0 made sure of that), but the app's WebView builds its own file chooser and left it out.

What changed

  • Camera choice: in MainActivity.java, when the page accepts images (image/*, */* or no filter), the file chooser gets a Camera choice next to the usual picker.
  • Where the photo goes: it's saved to Pictures/Marinara through MediaStore, the same place and way the app already saves images, and handed back to the page. If you cancel or pick a file instead, the empty photo entry is removed.
  • No new permission: the app doesn't declare the camera permission, so the camera app handles the capture.
  • Older Android: versions 9 and below keep the plain picker, because MediaStore would need storage permission there.
  • No new dependency: the Android app has none today, so this uses Android's own MediaStore instead of pulling in AndroidX for a FileProvider.
  • Test and changelog: a small source check, android-file-chooser-camera.regression.ts, the same kind of check the other Android regressions use, plus a CHANGELOG entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

What I ran (not a replacement for the checklist):

  • Debug APK: builds locally with ./build-apk.sh debug on Gradle 9.8.0 (BUILD SUCCESSFUL).
  • New regression: passes, and fails without the change.
  • Regressions that read MainActivity: android-local-auth and open-issues pass.
  • Local CodeRabbit: 2 findings.
    • Fixed: the chooser is now built inside the existing try, so an error can't leave the page's file callback hanging. The APK rebuilds fine.
    • Not changed: it suggested scoping the source check to method bodies. The other Android regressions match the whole file the same way.
  • Not tested on a phone.

To check by hand on an Android phone (10 or newer) with the app:

  • In Noodle, start a post and tap the picture button. Check Camera is offered, take a photo, and confirm it's attached.
  • Open the picker again and cancel, then check no empty photo is left in Pictures/Marinara.
  • Attach an image in a chat the same way.
  • On Android 9 or older, the picker should work as before.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG entry only.

UI evidence (if applicable)

Native Android chooser; no screenshots from a device.

Summary by CodeRabbit

  • New Features
    • On Android 10 and newer, image pickers can offer camera capture, with photos saved to Pictures. If camera setup fails, the regular picker remains available. Captured photos are also returned to the page so they can be used in the upload.
  • Bug Fixes
    • NanoGPT GLM models now stop reasoning when Reasoning Effort is Off, whether that setting is chosen in the chat or inherited from Default Chat Parameters.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6964 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/2/2026 **Status:** ✅ Merged **Merged:** 10/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/android-camera` --- ### 📝 Commits (4) - [`1f831ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1f831edc23207ad0f8fed6678b5789b4794bff80) fix(android): offer the camera when a page asks for a picture - [`622bfd4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/622bfd4715d613d0e624f77f89f1060c25823426) fix(android): build the camera chooser inside the error guard - [`2532c15`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2532c1528508613118273d1d4bb3dd2ac2513378) Merge remote-tracking branch 'origin/staging' into fix/android-camera - [`8b5c8e8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8b5c8e856670796776dc4793743da66ec5f0966f) fix(android): keep the camera photo's address if the app is closed ### 📊 Changes **3 files changed** (+116 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -1) 📝 `android/app/src/main/java/com/marinara/engine/MainActivity.java` (+84 -3) ➕ `scripts/regressions/android-file-chooser-camera.regression.ts` (+30 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6953 ## Why this change In the Marinara Android app, picking a picture never offered the camera, for Noodle posts or chat attachments. You could only choose an existing file. In Chrome on Android you get a Camera option (Noodle 1.4.0 made sure of that), but the app's WebView builds its own file chooser and left it out. ## What changed - **Camera choice:** in `MainActivity.java`, when the page accepts images (`image/*`, `*/*` or no filter), the file chooser gets a **Camera** choice next to the usual picker. - **Where the photo goes:** it's saved to **Pictures/Marinara** through MediaStore, the same place and way the app already saves images, and handed back to the page. If you cancel or pick a file instead, the empty photo entry is removed. - **No new permission:** the app doesn't declare the camera permission, so the camera app handles the capture. - **Older Android:** versions 9 and below keep the plain picker, because MediaStore would need storage permission there. - **No new dependency:** the Android app has none today, so this uses Android's own MediaStore instead of pulling in AndroidX for a `FileProvider`. - **Test and changelog:** a small source check, `android-file-chooser-camera.regression.ts`, the same kind of check the other Android regressions use, plus a CHANGELOG entry. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes What I ran (not a replacement for the checklist): - **Debug APK:** builds locally with `./build-apk.sh debug` on Gradle 9.8.0 (BUILD SUCCESSFUL). - **New regression:** passes, and fails without the change. - **Regressions that read `MainActivity`:** `android-local-auth` and `open-issues` pass. - **Local CodeRabbit:** 2 findings. - Fixed: the chooser is now built inside the existing `try`, so an error can't leave the page's file callback hanging. The APK rebuilds fine. - Not changed: it suggested scoping the source check to method bodies. The other Android regressions match the whole file the same way. - **Not tested on a phone.** To check by hand on an Android phone (10 or newer) with the app: - In Noodle, start a post and tap the picture button. Check **Camera** is offered, take a photo, and confirm it's attached. - Open the picker again and cancel, then check no empty photo is left in Pictures/Marinara. - Attach an image in a chat the same way. - On Android 9 or older, the picker should work as before. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG entry only. ## UI evidence (if applicable) Native Android chooser; no screenshots from a device. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - On Android 10 and newer, image pickers can offer camera capture, with photos saved to Pictures. If camera setup fails, the regular picker remains available. Captured photos are also returned to the page so they can be used in the upload. - **Bug Fixes** - NanoGPT GLM models now stop reasoning when Reasoning Effort is Off, whether that setting is chosen in the chat or inherited from Default Chat Parameters. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:19:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7407
No description provided.