Skip to content

Conversation

@ucswift
Copy link
Member

@ucswift ucswift commented Feb 5, 2026

Summary by CodeRabbit

  • Chores
    • Improved web build configuration for better static hosting: the web output is now optimized for static sites and base URL resolution is standardized.
    • Updated desktop app startup so development and production initialize differently: clearer runtime behavior and logging, with developer tools opened only in dev for a cleaner production launch.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Updates Expo web config to emit a static web build with base URL '/', and refactors Electron main process to explicitly branch on development vs production: dev loads the localhost URL, prod loads the local index.html file; devtools open only in development.

Changes

Cohort / File(s) Summary
Expo Web Configuration
app.config.ts
Added web config properties output: 'static' and baseUrl: '/' to change web bundle output and base URL resolution.
Electron Startup Logic
electron/main.js
Replaced single startUrl approach with explicit isDev branching: development calls mainWindow.loadURL('http://localhost:8081') and logs the dev URL; production calls mainWindow.loadFile(indexPath) to load local index.html. DevTools remain enabled only in dev.

Sequence Diagram(s)

sequenceDiagram
    participant DevServer as Dev Server
    participant Main as Electron Main
    participant Browser as BrowserWindow
    participant FS as File System

    Note over Main: Startup
    Main->>Main: determine isDev
    alt isDev == true
        Main->>DevServer: loadURL('http://localhost:8081')
        DevServer-->>Browser: serve app over HTTP
        Main->>Browser: open DevTools
    else isDev == false
        Main->>FS: resolve index.html path
        Main->>Browser: loadFile(index.html)
        FS-->>Browser: provide local file
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through configs, nibbling bits of code,

Web now static, paths on a steady road.
Electron splits — localhost or local file,
I twitch my nose and hop a little while.
Hooray for builds that make the devs smile!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'RD-T39 Working on electron build' is vague and uses generic phrasing that doesn't clearly convey the specific technical changes made, such as the configuration updates or the refactoring of electron URL handling. Consider using a more specific title that describes the actual changes, such as 'Update Expo web config and refactor Electron URL handling for dev/prod environments' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • 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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@app.config.ts`:
- Around line 88-93: The app config currently places baseUrl inside the web
block; move the baseUrl setting into an experiments object (experiments.baseUrl)
and remove baseUrl from the web object, and use an absolute path (e.g., "/" or
"/myapp") or an empty string instead of a relative './' value; update the config
to define experiments with baseUrl and keep web containing favicon, bundler and
output only (referencing the symbols baseUrl, experiments, and web to locate the
change).
🧹 Nitpick comments (1)
electron/main.js (1)

22-29: Harden production index path resolution.

Line 26 relies on a relative path from __dirname; packaged layouts can vary. Please verify the built web assets land at that path in your packaged app; otherwise resolve from app.getAppPath() and guard missing files to fail fast.

♻️ Suggested guard + path resolution
-const path = require('path');
+const path = require('path');
+const fs = require('fs');

...
-        const indexPath = path.join(__dirname, '../dist/index.html');
+        const indexPath = path.join(app.getAppPath(), 'dist', 'index.html');
+        if (!fs.existsSync(indexPath)) {
+            console.error(`Missing web build at ${indexPath}`);
+        }
         console.log('Loading file:', indexPath);
         mainWindow.loadFile(indexPath);

@ucswift
Copy link
Member Author

ucswift commented Feb 5, 2026

Approve

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is approved.

@ucswift ucswift merged commit bb85307 into master Feb 5, 2026
12 checks passed
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