Skip to content

🧹 Refactor createBrowserStore to reduce complexity - #87

Merged
undivisible merged 2 commits into
mainfrom
fix/browser-store-refactoring-5483785089623199801
Jun 16, 2026
Merged

undivisible merged 2 commits into
mainfrom
fix/browser-store-refactoring-5483785089623199801

Conversation

@undivisible

Copy link
Copy Markdown
Contributor

🎯 What: Extracted internal store action logic from the monolithic createBrowserStore into separate pure functional action creators: createTabActions, createWorkspaceActions, createHistoryActions, and createBookmarkActions.
💡 Why: createBrowserStore had grown to over 200 lines and handled too many domains (tabs, workspaces, history, bookmarks). This refactoring adheres to the Single Responsibility Principle, drastically reducing the complexity of the main store factory without altering the public API.
Verification: Verified via manual Svelte compilation checks (bun run check) to ensure type safety and that no breaking changes were introduced to the API contract used by existing consumers (DesktopShell.svelte, etc.).
Result: Improved maintainability, cleaner boundaries between domain actions, and safer future evolutions.


PR created automatically by Jules for task 5483785089623199801 started by @undivisible

This commit refactors the monolithic `createBrowserStore` function by extracting its logic into smaller, domain-specific factory functions (`createTabActions`, `createWorkspaceActions`, `createHistoryActions`, and `createBookmarkActions`). This significantly reduces complexity and improves maintainability while preserving the existing store's reactivity model and public API.

A Svelte check (`bun run check`) was executed successfully to ensure there are no compilation or typing issues.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@undivisible
undivisible merged commit 44553f0 into main Jun 16, 2026
1 check 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