Skip to content

background workers fix#49

Merged
niklabh merged 1 commit into
mainfrom
feat/background-workers
May 29, 2026
Merged

background workers fix#49
niklabh merged 1 commit into
mainfrom
feat/background-workers

Conversation

@niklabh
Copy link
Copy Markdown
Owner

@niklabh niklabh commented May 29, 2026

Summary by CodeRabbit

  • New Features

    • Added continuous spinner animation to the background worker demo UI for enhanced visual feedback during processing
  • Bug Fixes

    • Fixed URL bar state inconsistency when loading local files—the current URL now properly reflects selected file paths
    • Improved error handling with clearer logging for background worker spawning failures

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9621d954-6fa0-4626-bb70-3f012bbc7286

📥 Commits

Reviewing files that changed from the base of the PR and between d5c5597 and d1be782.

📒 Files selected for processing (2)
  • examples/worker-demo/src/lib.rs
  • oxide-browser/src/ui.rs

📝 Walkthrough

Walkthrough

The PR enhances the worker demo example with proper frame-delta-driven spinner animation and improved error handling, while also fixing URL state consistency in the file picker. The worker demo now tracks spinner rotation via accumulated angle, animates based on frame deltas, and handles worker startup failures with explicit phase transitions and logging.

Changes

Worker Demo Animation and Error Handling

Layer / File(s) Summary
State angle field for animation
examples/worker-demo/src/lib.rs
State struct gains angle: f32 field to track spinner rotation; phase documentation expands to describe error state; initialization sets angle to 0.0.
Frame-driven spinner animation and UI rendering
examples/worker-demo/src/lib.rs
on_frame now accepts dt_ms parameter for frame-delta updates; UI rendering derives status text and per-phase color from phase via match; spinner animation increments angle from frame deltas instead of time-based computation.
Worker startup with URL resolution and error handling
examples/worker-demo/src/lib.rs
Documentation clarifies worker WASM URL resolution relative to module runtime; worker startup uses match-based URL resolution with explicit worker spawn and message posting on success; failures log specific messages and set phase = 3 for consistent error reporting.

File Picker URL State Sync

Layer / File(s) Summary
Host URL state sync for file picker
oxide-browser/src/ui.rs
When file picker selects a local file, also update tab.host_state.current_url to match tab.url_input for state consistency.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • niklabh/oxide#48: Updates the same worker-demo worker control flow and state machine logic that is being enhanced in this PR.

Poem

🐰 A spinner twirls with delta time,

Workers spawn with error handled fine,

URLs now sync where files reside,

Frame by frame, the demo glides! ✨

✨ 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 feat/background-workers

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.

@niklabh niklabh merged commit ccea897 into main May 29, 2026
4 of 5 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