Skip to content

feat: improve launchApp#1987

Merged
RohitKushvaha01 merged 5 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:launchApp
Mar 28, 2026
Merged

feat: improve launchApp#1987
RohitKushvaha01 merged 5 commits intoAcode-Foundation:mainfrom
RohitKushvaha01:launchApp

Conversation

@RohitKushvaha01
Copy link
Copy Markdown
Member

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 28, 2026

Greptile Summary

This PR improves the launchApp system plugin API by replacing the single opaque String data parameter with a structured JSONObject extras map, allowing callers to pass properly-typed Android Intent extras (string, int, boolean, double, long). It also bumps the Biome linter/formatter from 2.1.4 to 2.4.6 and reformats JSX ternary expressions across several UI components to match the new style rules.

Key changes:

  • Java (System.java): launchApp now accepts JSONObject extras (retrieved via args.optJSONObject(2) instead of args.optString(2)), iterates its keys, and dispatches typed intent.putExtra calls for each supported type.
  • JS bridge (plugin.js): Updated to pass the extras object directly; added JSDoc with usage example.
  • TypeScript (system.d.ts): Updated launchApp signature — data: stringextras?: Record<string, string | number | boolean>, and onSuccess/onFail made optional; improved JSDoc.
  • Biome + JSX: Version bump to 2.4.6 and corresponding reformatting of ternary expressions in six UI files (no logic changes).

Confidence Score: 5/5

Safe to merge; the launchApp improvements are well-structured and all remaining findings are minor edge-case hardening (P2).

The core logic change is correct — typed extras dispatch handles all expected JSON types, the existing null checks for appId and className are preserved, and args.optJSONObject(2) correctly handles missing/null extras. The single P2 comment (JSONObject.NULL fallthrough) affects only raw-JS callers bypassing TypeScript types and is a robustness concern rather than a present defect. All JSX changes are purely cosmetic.

src/plugins/system/android/com/foxdebug/system/System.java — minor edge case in the extras iteration loop.

Important Files Changed

Filename Overview
src/plugins/system/android/com/foxdebug/system/System.java Core change: launchApp signature updated from a single String data to JSONObject extras, with proper typed dispatch for Integer, Boolean, Double, Long, and String values; minor edge case with JSONObject.NULL falling through to a string "null" extra.
src/plugins/system/www/plugin.js Updated JS bridge to pass extras object instead of data string to Cordova; added JSDoc with usage example.
src/plugins/system/system.d.ts Updated TypeScript signature for launchApp: data: string → `extras?: Record<string, string
biome.json Biome schema bumped from 2.1.4 to 2.4.6.
package.json @biomejs/biome dev dependency updated from 2.1.4 to 2.4.6.
src/components/lspInfoDialog/index.js JSX ternary formatting change only (Biome 2.4.6 style enforcement).
src/components/settingsPage.js JSX ternary formatting change only.
src/components/toast/index.js JSX ternary formatting change only.
src/dialogs/select.js JSX ternary formatting change only.
src/pages/fontManager/fontManager.js JSX ternary formatting change only.
src/pages/plugin/plugin.view.js JSX ternary formatting change only.
src/sidebarApps/extensions/index.js JSX ternary formatting change only.

Sequence Diagram

sequenceDiagram
    participant JS as JavaScript Caller
    participant Bridge as plugin.js (Cordova bridge)
    participant Java as System.java (launchApp)
    participant Android as Android ActivityManager

    JS->>Bridge: launchApp(app, className, extras, onSuccess, onFail)
    Bridge->>Java: cordova.exec(..., "launch-app", [app, className, extras])
    Java->>Java: validate appId (null/empty check)
    Java->>Java: validate className (null/empty check)
    Java->>Java: build Intent (ACTION_MAIN, CATEGORY_LAUNCHER, setClassName)
    loop For each key in extras
        Java->>Java: get(key) → typed putExtra(key, value)
    end
    Java->>Android: activity.startActivity(intent)
    Android-->>Java: success / exception
    Java-->>JS: onSuccess("Launched appId") / onFail(error)
Loading

Reviews (3): Last reviewed commit: "feat: definition" | Re-trigger Greptile

@RohitKushvaha01
Copy link
Copy Markdown
Member Author

@greptileai

@RohitKushvaha01
Copy link
Copy Markdown
Member Author

@greptileai

@RohitKushvaha01 RohitKushvaha01 merged commit a148951 into Acode-Foundation:main Mar 28, 2026
6 of 7 checks passed
@RohitKushvaha01 RohitKushvaha01 deleted the launchApp branch March 28, 2026 09:26
@RohitKushvaha01 RohitKushvaha01 self-assigned this Mar 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