Conversation
- add src/shared for IPC channel constants and shared types (TabInfo, chat, etc.) - wire main, preload, and renderer to shared IPC; remove dead @Renderer alias and redundant topbar vite config - fix Window tab lifecycle (external links handler per tab; push tabs-updated to topbar; drop unused BaseWindow pass-throughs) - replace ipcMain.removeAllListeners with tracked handle/on cleanup in EventManager; drop unused navigation IPC handlers - switch LLMClient from deprecated CoreMessage to ModelMessage; use shared IPC for chat events - drive topbar tab list from main-process tabs-updated events instead of polling - fix renderer TS issues (StreamingText useEffect return, unused TabBar isLoading); remove react-markdown code renderer `node` prop - extend tsconfig.node/web includes and @shared path for shared folder
- Add main-process Ritual class: dedicated WebContentsView, card/panel/hidden modes, bounds on resize, bring-to-front for z-order above tabs - Integrate Ritual into Window (construct, resize, tab lifecycle alongside topbar/sidebar) - Add shared ritual-types (workflow events, ritual/steps, candidates, metadata, dismissals) - Add shared ritual-ipc (channel names, view modes, replay state shape) - Add ritual preload API surface (ritual.ts + typings) for renderer ↔ main - Add ritual renderer entry (HTML/CSS/React): boot path that probes IndexedDB - Add storage.ts: idb schema for events / rituals / dismissals, indexes, 30-day prune, queries by session/domain/timestamp - Register ritual preload + renderer in electron.vite.config.ts and include ritual sources in tsconfig.web.json - Update package.json / lockfile for new dependencies
- Add RitualCollector to manage tab event subscriptions and cleanup in the Window class. - Implement ritualAPI in the preload script to handle WorkflowEvent emissions and manage event listeners. - Update RitualApp to subscribe to incoming events and persist them, with logging for verification. - Introduce a development tool for debugging during the development phase. - Extend ritual-types and ritual-ipc for improved event handling and communication between renderer and main process.
…event processing - Introduce IGNORED_DOMAINS in RitualCollector to exclude specific domains from event emissions. - Implement lastDomainPerTab tracking to manage domain state per tab. - Update event handling in RitualCollector to prevent duplicate domain emissions. - Enhance RitualApp to integrate a DetectionEngine for processing incoming events and logging candidates. - Improve error handling and logging for event persistence in RitualApp.
- Add RitualAI class to handle metadata generation and Playwright script creation. - Implement IPC handlers for generating metadata and Playwright scripts in the Ritual class. - Update RitualAPI in the preload script to expose new methods for metadata and script generation. - Enhance the Window class to ensure proper cleanup of Ritual resources on close. - Introduce development helpers for testing AI functionality with fake candidates.
…ode handling - Integrate Zustand for managing application state in Ritual. - Implement view mode listener in the Ritual class to handle visibility changes. - Update RitualAPI to include a method for setting the view mode. - Enhance RitualApp to utilize Zustand for state management and improve event handling. - Add development helpers for resetting state during testing.
- Introduce a transparent margin for card shadow rendering in the Ritual class. - Update card positioning logic to accommodate the new shadow padding. - Add new CSS animations for card entry and confirmation check effects. - Modify the RitualApp component to conditionally render the RitualCard based on visibility state. - Extend the Zustand store to include a recently saved ritual state for confirmation feedback.
…anagement - Add togglePanelListener in the Ritual class to handle panel toggle events. - Update RitualAPI to include methods for panel toggle requests and listener management. - Modify Zustand store to manage panel visibility state and integrate with event handling. - Enhance RitualApp to respond to panel toggle requests and conditionally render the RitualPanel. - Introduce new CSS animations for panel transitions and improve overall user experience.
- Add methods to handle ritual replay events in EventManager, including opening tabs and managing replay state. - Enhance TopBar to adjust its height based on the replay banner visibility. - Update Window class to manage tab positioning during replay and coordinate UI updates. - Extend Zustand store to track replay state and handle user interactions for stopping the replay. - Introduce new API methods in the preload script for replay control and state broadcasting. - Modify RitualApp to respond to replay stop requests and manage script viewing state.
- Implement IPC communication to relay the real panel-open state from the ritual renderer to the topbar. - Update RitualAPI to include a method for broadcasting panel state changes. - Enhance topbar functionality to listen for panel state updates and adjust the icon accordingly. - Introduce demo rituals loading functionality in the Zustand store to improve user experience when no rituals are present. - Modify RitualPanel to provide an option for loading demo rituals, enhancing the initial user interaction.
- Streamline the tab creation process in the Window class by directly returning the created tab. - Ensure the active tab is switched immediately upon tab creation, enhancing user experience. - Update TopBarApp to prevent dragging behavior on the top bar for better usability. - Refactor TabBar component to improve layout and responsiveness, ensuring proper handling of pinned and unpinned tabs.
- Implement notifications for tab state changes in EventManager to keep the topbar updated. - Refactor tab navigation methods to utilize new navigation history properties for better accuracy. - Update the Window class to synchronize tab state with the topbar after navigation events. - Modify AddressBar and ToolBarButton components to reflect updated navigation capabilities. - Ensure proper handling of tab state in the BrowserContext for improved user experience.
- Add new dependencies: idb, nanoid, and zustand to package-lock.json. - Update nanoid version to 5.1.11 and zustand to 5.0.13. - Remove the development tools opening line from the Ritual class to clean up the code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces Ritual, a workflow-learning system for Blueberry Browser.
Ritual observes repeated browser behavior patterns across sessions and suggests turning them into reusable automations. The goal is to make the browser feel less like a passive tool and more like a trainable coworker that understands repetitive workflows.
Example:
A user repeatedly opens Notion, copies weekly analytics, switches to Gmail, and sends the report to the same person. After detecting the repeated sequence, Ritual suggests saving it as an automation that can later be replayed from the sidebar in a single click.
What was added
Technical Notes
The detection engine works using domain-sequence analysis across browser sessions.
Repeated contiguous sequences are detected using:
The implementation was intentionally kept lightweight and modular to prioritize fast iteration and product experimentation.
Why I built this
I liked the idea of making the browser proactive instead of reactive.
Current browsers mostly wait for commands. Ritual attempts to recognize intent and repeated work patterns automatically, then turns them into reusable workflows without requiring users to manually configure automations themselves.