Skip to content

fix: harden Android completion and responsive UI - #13

Merged
Aswanidev-vs merged 1 commit into
mainfrom
develop
Aug 8, 2026
Merged

fix: harden Android completion and responsive UI#13
Aswanidev-vs merged 1 commit into
mainfrom
develop

Conversation

@Aswanidev-vs

Copy link
Copy Markdown
Owner

No description provided.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Aswanidev-vs, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 94ae541e-5144-4226-ab20-9211b9380783

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba4a76 and 3f16594.

📒 Files selected for processing (12)
  • build/android/app/src/main/java/com/wails/app/MainActivity.java
  • frontend/src/components/common/Toast.vue
  • frontend/src/components/layout/AppLayout.vue
  • frontend/src/components/pair/PairModal.vue
  • frontend/src/components/receive/IncomingRequest.vue
  • frontend/src/components/transfer/FileRow.vue
  • frontend/src/components/transfer/TransferArea.vue
  • frontend/src/styles/index.css
  • frontend/src/views/ReceiveView.vue
  • frontend/src/views/SendView.vue
  • frontend/src/views/SettingsView.vue
  • internal/light/filetransfer_integration_test.go

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.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 critical

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Security 1 critical

View in Codacy

🟢 Metrics 21 complexity · 6 duplication

Metric Results
Complexity 21
Duplication 6

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Aswanidev-vs
Aswanidev-vs merged commit 397ed52 into main Aug 8, 2026
15 of 16 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Harden Android SAF copy completion and improve responsive layouts

🐞 Bug fix ✨ Enhancement 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Fix Android SAF copy by resolving tree root URIs and safely encoding event JSON.
• Improve safe-area handling and responsive layouts across navigation, modals, and lists.
• Add HTTP integration tests for successful transfers and checksum mismatch failures.
Diagram

graph TD
  go["Go file receiver"] --> staging[("Staging files")] --> fe["Frontend UI"] --> android["Android MainActivity"] --> saf{{"SAF provider"}}
  go --> tm[("Transfer history")] --> fe
  subgraph Legend
    direction LR
    _svc["Service"] ~~~ _db[("Storage")] ~~~ _ext{{"External"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Build bridge event payloads with JSONObject objects
  • ➕ Eliminates fragile manual string concatenation/escaping for event JSON
  • ➕ Easier to extend payloads without introducing quoting bugs
  • ➖ Slightly more verbose code and small allocation overhead per event
2. Use AndroidX DocumentFile for SAF operations
  • ➕ Higher-level API for tree/document navigation and creation
  • ➕ Can simplify URI correctness checks and future folder/file operations
  • ➖ Additional dependency/API surface
  • ➖ Still requires correct handling of tree vs document URIs; may not reduce core complexity much

Recommendation: The chosen approach (validating tree URIs, resolving to a document URI before createDocument, and quoting JSON string fields) directly addresses common SAF failure modes and is appropriate for a small fix. Consider a follow-up to switch bridge event payload construction to JSONObject+toString() to remove remaining manual JSON string assembly.

Files changed (12) +261 / -59

Enhancement (10) +99 / -53
Toast.vueSafe-area aware toast positioning and width constraints +2/-2

Safe-area aware toast positioning and width constraints

• Moves toast container down using safe-area inset top and adds a max width to prevent overflow on small screens. Keeps toast layout readable on narrow/mobile viewports.

frontend/src/components/common/Toast.vue

AppLayout.vueResponsive navigation: tablet rail + safe-area mobile nav +34/-17

Responsive navigation: tablet rail + safe-area mobile nav

• Switches the root layout to 100dvh with min-height constraints for better scrolling behavior. Adds a compact tablet nav rail (icons only) that expands on large screens, introduces consistent brand lockup, and adjusts mobile header/bottom nav sizing and truncation.

frontend/src/components/layout/AppLayout.vue

PairModal.vueSafe-area bottom padding and dynamic height for pairing modal +2/-2

Safe-area bottom padding and dynamic height for pairing modal

• Adds safe-area bottom padding to the modal overlay and constrains the scanning state to fit within the dynamic viewport height. Prevents content from being obscured by device UI chrome.

frontend/src/components/pair/PairModal.vue

IncomingRequest.vueSafe-area padding and scrollable incoming-request card +2/-2

Safe-area padding and scrollable incoming-request card

• Adds safe-area bottom padding to the overlay and bounds the card height using 100dvh with overflow scrolling. Improves usability on mobile when content is tall.

frontend/src/components/receive/IncomingRequest.vue

FileRow.vueMore responsive file row layout and status pill styling +4/-4

More responsive file row layout and status pill styling

• Reworks the row into a grid that adapts between mobile and desktop, ensuring action buttons align without overflow. Converts the status label into a compact pill badge and tweaks icon sizing for small screens.

frontend/src/components/transfer/FileRow.vue

TransferArea.vueImproved drop zone ergonomics and scroll containment +5/-5

Improved drop zone ergonomics and scroll containment

• Adds min-height and touch-manipulation to the drop zone, truncates long device names, and enforces min-h-0/overflow-y-auto for the transfer list. Reduces layout jank and improves mobile usability.

frontend/src/components/transfer/TransferArea.vue

index.cssGlobal responsive layout utilities, brand styling, and safe-area helpers +34/-5

Global responsive layout utilities, brand styling, and safe-area helpers

• Adds min-height to root containers and removes tap highlight on buttons/links for mobile polish. Increases minimum touch target heights for buttons/nav items, introduces brand/mobile-nav/drop-zone styles, and refines .page padding (including tablet-specific overrides).

frontend/src/styles/index.css

ReceiveView.vueResponsive receive view cards and scrollable transfer list +6/-6

Responsive receive view cards and scrollable transfer list

• Adjusts card spacing/wrapping for narrow screens, makes the settings CTA full-width on mobile, and converts the transfer list area into a scrollable container. Improves readability and prevents overflow.

frontend/src/views/ReceiveView.vue

SendView.vueScrollable device list panel and improved mobile header sizing +4/-4

Scrollable device list panel and improved mobile header sizing

• Adds min-h-0 constraints and makes the device list area overflow-scrollable. Tweaks mobile header height and ensures the transfer area can shrink without clipping.

frontend/src/views/SendView.vue

SettingsView.vueSettings form responsiveness for small screens +6/-6

Settings form responsiveness for small screens

• Widens the card on large screens while making controls stack on mobile (download folder inputs and action buttons). Makes port and save button full-width on small screens for better tap targets.

frontend/src/views/SettingsView.vue

Bug fix (1) +21 / -6
MainActivity.javaFix SAF document creation and harden copy completion event payloads +21/-6

Fix SAF document creation and harden copy completion event payloads

• Validates that the provided folder URI is a tree URI and resolves it to the tree root document URI before calling DocumentsContract.createDocument. Hardens android:copyDone event JSON by using JSONObject.quote for error messages and fileName, and fails explicitly when destination document creation returns null.

build/android/app/src/main/java/com/wails/app/MainActivity.java

Tests (1) +141 / -0
filetransfer_integration_test.goAdd HTTP integration tests for prepare/transfer and checksum failures +141/-0

Add HTTP integration tests for prepare/transfer and checksum failures

• Adds an httptest server exercising /api/prepare and /api/transfer end-to-end, verifying files are written to the configured download directory and history records completion. Adds a negative test that asserts checksum mismatches return 400 and record a failed transfer with the expected error.

internal/light/filetransfer_integration_test.go

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. HTTP tests can hang 🐞 Bug ☼ Reliability
Description
The new integration tests use http.Post/http.DefaultClient.Do without any timeout or request context
deadline, so a handler regression that blocks can hang the test run until an external/global
timeout. This makes CI failures slower and harder to diagnose.
Code

internal/light/filetransfer_integration_test.go[R67-69]

+	transferResponse, err := http.DefaultClient.Do(transferRequest)
+	if err != nil {
+		t.Fatal(err)
Evidence
Both tests make HTTP calls using the default client (no Timeout) and do not attach a context with a
deadline; this can block indefinitely if the handler fails to return.

internal/light/filetransfer_integration_test.go[50-75]
internal/light/filetransfer_integration_test.go[115-136]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The integration tests issue HTTP requests with no deadlines (`http.Post` / `http.DefaultClient.Do`), so if the server handler blocks (e.g., due to a future regression), the tests may hang until a global `go test`/CI timeout.

## Issue Context
These are integration tests; they should fail fast with clear error messages when the server does not respond. Adding a bounded timeout (client timeout or per-request context deadline) improves reliability and debuggability.

## Fix Focus Areas
- internal/light/filetransfer_integration_test.go[50-75]
- internal/light/filetransfer_integration_test.go[115-136]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment on lines +67 to +69
transferResponse, err := http.DefaultClient.Do(transferRequest)
if err != nil {
t.Fatal(err)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Http tests can hang 🐞 Bug ☼ Reliability

The new integration tests use http.Post/http.DefaultClient.Do without any timeout or request context
deadline, so a handler regression that blocks can hang the test run until an external/global
timeout. This makes CI failures slower and harder to diagnose.
Agent Prompt
## Issue description
The integration tests issue HTTP requests with no deadlines (`http.Post` / `http.DefaultClient.Do`), so if the server handler blocks (e.g., due to a future regression), the tests may hang until a global `go test`/CI timeout.

## Issue Context
These are integration tests; they should fail fast with clear error messages when the server does not respond. Adding a bounded timeout (client timeout or per-request context deadline) improves reliability and debuggability.

## Fix Focus Areas
- internal/light/filetransfer_integration_test.go[50-75]
- internal/light/filetransfer_integration_test.go[115-136]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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