Skip to content

fix: restore transfer details and folder labels - #14

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

fix: restore transfer details and folder labels#14
Aswanidev-vs merged 1 commit into
mainfrom
develop

Conversation

@Aswanidev-vs

@Aswanidev-vs Aswanidev-vs commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Android folder selections now display the folder’s readable name instead of a technical storage path.
    • Updated branding uses the application logo in the sidebar and mobile header.
  • Bug Fixes

    • Completed transfers now retain file details when completion events omit size or path information.
    • Transfer history accurately records the completed file size.
    • Settings consistently display normalized Android download locations.

@Aswanidev-vs
Aswanidev-vs merged commit df693ce into main Aug 8, 2026
11 of 14 checks passed
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

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

Results:
1 new issue

Category Results
BestPractice 1 high

View in Codacy

🟢 Metrics 10 complexity · 0 duplication

Metric Results
Complexity 10
Duplication 0

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.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 37aae72f-0a0c-47e1-afcf-99f70ddbb068

📥 Commits

Reviewing files that changed from the base of the PR and between 397ed52 and c73671b.

📒 Files selected for processing (9)
  • build/android/app/src/main/java/com/wails/app/MainActivity.java
  • build/android/app/src/main/java/com/wails/app/WailsJSBridge.java
  • frontend/src/components/layout/AppLayout.vue
  • frontend/src/composables/useSettings.ts
  • frontend/src/composables/useTransfers.ts
  • frontend/src/styles/index.css
  • frontend/src/views/SettingsView.vue
  • internal/light/filetransfer.go
  • internal/light/filetransfer_integration_test.go

📝 Walkthrough

Walkthrough

The change resolves Android SAF folder display names, exposes the resolver to the frontend, preserves transfer completion metadata, updates settings synchronization, and replaces text brand marks with the logo image.

Changes

Android folder and transfer flow

Layer / File(s) Summary
Android SAF folder label resolution
build/android/app/src/main/java/com/wails/app/MainActivity.java, build/android/app/src/main/java/com/wails/app/WailsJSBridge.java, frontend/src/composables/useSettings.ts
SAF tree URIs now resolve to provider display names. The JavaScript bridge exposes this resolver. Android settings normalize stored and received download directories.
Transfer completion payload preservation
internal/light/filetransfer.go, frontend/src/composables/useTransfers.ts, internal/light/filetransfer_integration_test.go
Completion events include file sizes. The frontend preserves known size and file path values. The integration test checks the recorded payload size.
Frontend branding and settings synchronization
frontend/src/components/layout/AppLayout.vue, frontend/src/styles/index.css, frontend/src/views/SettingsView.vue
Sidebar and mobile branding use /logo.png. Settings use an immediate watcher to synchronize local state.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant useSettings
  participant WailsJSBridge
  participant MainActivity
  participant SAFDocumentProvider
  useSettings->>WailsJSBridge: getFolderDisplayName(tree URI)
  WailsJSBridge->>MainActivity: resolve folder display name
  MainActivity->>SAFDocumentProvider: query document display name
  SAFDocumentProvider-->>MainActivity: display label
  MainActivity-->>WailsJSBridge: folder label
  WailsJSBridge-->>useSettings: normalized download directory
Loading

Possibly related PRs

  • Aswanidev-vs/light#4: Covers the earlier Android SAF folder and URI handling extended by this change.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix Android folder labels and restore transfer completion details

🐞 Bug fix ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Show human-readable Android SAF folder names instead of raw /tree/... URIs
• Include file size and preserve filePath on transfer completion events
• Refresh branding by using the app logo image in the sidebar and mobile header
Diagram

graph TD
  JS["Frontend (Settings/Transfers)"] --> Bridge["WailsJSBridge (JS API)"] --> Activity["MainActivity (Android)"] --> SAF{{"Android SAF Provider"}}
  GoSvc["FileTransferService (Go)"] --> Bus["Wails Event Bus"] --> JS
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Persist displayName alongside downloadDirUri in settings
  • ➕ No JS-bridge call on every settings load/change
  • ➕ UI remains stable even if provider queries temporarily fail
  • ➖ Requires schema/migration and deciding when to refresh labels
  • ➖ Display names may become stale if the folder is renamed
2. Use Android DocumentFile.fromTreeUri for display name
  • ➕ Higher-level API than raw ContentResolver query
  • ➕ Can simplify metadata access/validation
  • ➖ Still depends on provider behavior; not always less code
  • ➖ May add overhead/compat considerations depending on minSdk/support libs
3. Frontend-only label normalization (documentId parsing only)
  • ➕ Avoids adding a new JS bridge API
  • ➕ Keeps logic in one place (frontend)
  • ➖ Cannot reliably resolve non-primary providers (e.g., msd:...)
  • ➖ More likely to show incorrect or confusing labels

Recommendation: The PR’s approach (querying the SAF provider for COLUMN_DISPLAY_NAME and providing a JS bridge helper) is the most correct way to produce human-readable labels across different document providers, while also providing a small migration path for previously-saved raw /tree/... labels. If label lookups become performance-sensitive later, consider persisting the resolved display name alongside the URI with a refresh strategy.

Files changed (9) +98 / -28

Enhancement (3) +16 / -4
WailsJSBridge.javaExpose getFolderDisplayName(uri) to JavaScript +12/-0

Expose getFolderDisplayName(uri) to JavaScript

• Adds a @JavascriptInterface method that delegates to MainActivity to resolve a saved SAF URI to the provider’s display name. Enables frontend settings migration away from raw /tree/... labels.

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

AppLayout.vueUse logo image in sidebar and mobile header branding +2/-2

Use logo image in sidebar and mobile header branding

• Replaces the text-based brand mark with an image logo for both desktop sidebar and mobile header layouts. Keeps existing layout structure while updating the rendered element and classes.

frontend/src/components/layout/AppLayout.vue

index.cssReplace brand-mark styles with brand-logo styling +2/-2

Replace brand-mark styles with brand-logo styling

• Removes the old .brand-mark style and introduces .brand-logo styling suited for an image element, including border, background, and object-fit behavior.

frontend/src/styles/index.css

Bug fix (5) +81 / -23
MainActivity.javaResolve SAF folder display names and emit safe JSON payloads +55/-13

Resolve SAF folder display names and emit safe JSON payloads

• Replaces brittle tree-URI path parsing with a SAF display-name lookup via ContentResolver. Emits folderPicked events using JSONObject.quote to avoid broken JSON escaping. Adds helpers to resolve friendly names for both freshly-picked and previously-saved tree URIs.

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

useSettings.tsNormalize Android download directory label using native resolver +16/-2

Normalize Android download directory label using native resolver

• Adds Android-only normalization that replaces legacy '/tree/…' labels with the provider display name derived from downloadDirUri via wails.getFolderDisplayName. Applies normalization on initial settings load and on settings-changed events.

frontend/src/composables/useSettings.ts

useTransfers.tsPreserve transfer size and file path on completion updates +5/-3

Preserve transfer size and file path on completion updates

• When receiving transfer-complete, reuses prior transfer state to fill missing size or filePath fields. Prevents completed transfers from losing metadata when the completion payload is partial.

frontend/src/composables/useTransfers.ts

SettingsView.vueSync local settings state with watch(settings) and immediate run +3/-3

Sync local settings state with watch(settings) and immediate run

• Replaces watchEffect with an explicit watch on the settings ref and enables immediate synchronization. Makes the local editable copy update deterministically when settings change.

frontend/src/views/SettingsView.vue

filetransfer.goInclude size in transfer-complete event payload +2/-2

Include size in transfer-complete event payload

• Adds the 'size' field to transfer-complete events for both download handling and upload completion. Restores size metadata for the frontend transfer history and completion UI logic.

internal/light/filetransfer.go

Tests (1) +1 / -1
filetransfer_integration_test.goAssert completed transfer history includes correct size +1/-1

Assert completed transfer history includes correct size

• Extends the HTTP integration test to verify that a completed transfer records Size matching the payload length, in addition to status and file path checks.

internal/light/filetransfer_integration_test.go

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

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

Qodo Logo

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