Maestro icon indicating copy to clipboard operation
Maestro copied to clipboard

feat: Encore Feature system with gating infrastructure

Open felipeggv opened this issue 9 months ago β€’ 8 comments

Summary

  • Adds EncoreFeatureFlags type system with unifiedInbox and tabDescription flags
  • Adds Zustand settingsStore integration with persistence via window.maestro.settings
  • Adds Encore tab in Settings Modal with feature toggles (role="switch", aria-checked)
  • Gates keyboard shortcuts (Alt+I for Agent Inbox, Meta+Shift+O for Director Notes) behind feature flags
  • Gates AgentInbox modal rendering and handler props behind unifiedInbox encore feature
  • Sets all encore features to false by default (convention: opt-in only)

Commits

  • feat: add unifiedInbox and tabDescription to EncoreFeatureFlags
  • feat: add Unified Inbox and Tab Descriptions cards to Settings Encore tab
  • feat: gate keyboard shortcuts for agentInbox and directorNotes encore features
  • feat: gate AgentInbox modal rendering and handler props behind unifiedInbox encore feature
  • fix: set tabDescription encore default to false for convention consistency

Test plan

  • [ ] npm run lint passes
  • [ ] npm run test passes
  • [ ] Toggle each feature on/off in Settings β†’ Encore tab
  • [ ] Verify shortcuts only work when feature is enabled
  • [ ] Verify AgentInbox modal only renders when unifiedInbox is enabled
  • [ ] Verify all encore features default to false on fresh install

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced Unified Inbox feature with Alt+i keyboard shortcut access and quick actions integration
    • Added Tab Descriptions feature toggle
    • New feature toggles available in Settings for both Unified Inbox and Tab Descriptions to enable/disable as needed

felipeggv avatar Feb 27 '26 14:02 felipeggv

@coderabbitai review

felipeggv avatar Feb 27 '26 14:02 felipeggv

βœ… Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot] avatar Feb 27 '26 14:02 coderabbitai[bot]

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 9d612b665a7f97a5453d7b26eb024db1f0c52667 and 060ba44a3ed85d5859d1d001c2dec7d25c1d8a77.

πŸ“’ Files selected for processing (9)
  • src/renderer/App.tsx
  • src/renderer/components/AppModals.tsx
  • src/renderer/components/QuickActionsModal.tsx
  • src/renderer/components/SettingsModal.tsx
  • src/renderer/constants/shortcuts.ts
  • src/renderer/hooks/keyboard/useMainKeyboardHandler.ts
  • src/renderer/stores/modalStore.ts
  • src/renderer/stores/settingsStore.ts
  • src/renderer/types/index.ts

πŸ“ Walkthrough

Walkthrough

This PR introduces a new Agent Inbox feature with modal state management, keyboard shortcut (Alt+i), feature flags, and UI integration. Changes include modal state store updates, keyboard handler wiring, quick action menu entry, settings panel controls, and app-level callback exposure.

Changes

Cohort / File(s) Summary
Modal State & Type Definitions
src/renderer/stores/modalStore.ts, src/renderer/stores/settingsStore.ts, src/renderer/types/index.ts
Added agentInbox modal identifier to ModalId union, introduced setAgentInboxOpen() action with state selector, extended EncoreFeatureFlags with unifiedInbox and tabDescription boolean toggles (default false).
App-Level Wiring
src/renderer/App.tsx
Exposed agentInboxOpen state and setAgentInboxOpen handler via useModalActions, passed onOpenAgentInbox callback to AppModals component, integrated setAgentInboxOpen into keyboard handler surface, gated by encore feature flag.
Component Interfaces
src/renderer/components/AppModals.tsx
Added onOpenAgentInbox?: () => void prop to AppModalsProps and AppUtilityModalsProps interfaces, propagated callback through component composition tree.
UI Components & User Interactions
src/renderer/components/QuickActionsModal.tsx, src/renderer/components/SettingsModal.tsx
Added "Unified Inbox" quick action entry triggered by onOpenAgentInbox prop in QuickActionsModal; added two new feature cards in SettingsModal for Unified Inbox and Tab Descriptions with visual toggles and icon updates (FlaskConical β†’ Sparkles, added Inbox and FileText icons).
Input & Configuration
src/renderer/constants/shortcuts.ts, src/renderer/hooks/keyboard/useMainKeyboardHandler.ts
Defined new keyboard shortcut agentInbox with keys ['Alt', 'i'] and label "Unified Inbox"; added shortcut handler in useMainKeyboardHandler that triggers setAgentInboxOpen when unifiedInbox feature flag is enabled.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Keyboard as Keyboard Handler
    participant UI as QuickActionsModal/<br/>SettingsModal
    participant App as App.tsx
    participant Store as Modal Store
    participant Modal as Agent Inbox<br/>Modal

    rect rgba(100, 150, 255, 0.5)
    Note over User,Modal: Keyboard Shortcut Path (Alt+i)
    User->>Keyboard: Press Alt+i
    Keyboard->>Keyboard: Check unifiedInbox<br/>feature flag
    Keyboard->>App: Call setAgentInboxOpen(true)
    App->>Store: updateModal('agentInbox', true)
    Store->>Modal: Re-render with open state
    Modal->>User: Display Agent Inbox
    end

    rect rgba(150, 200, 100, 0.5)
    Note over User,Modal: UI Click Path (Quick Actions)
    User->>UI: Click "Unified Inbox"
    UI->>App: Call onOpenAgentInbox()
    App->>Store: updateModal('agentInbox', true)
    Store->>Modal: Re-render with open state
    Modal->>User: Display Agent Inbox
    end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

πŸš₯ Pre-merge checks | βœ… 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (2 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title accurately captures the main objective of the PR: introducing an Encore feature system with gating infrastructure for controlling feature enablement.

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

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Feb 27 '26 14:02 coderabbitai[bot]

Greptile Summary

Adds Encore Feature infrastructure for Unified Inbox and Tab Descriptions with proper feature gating

  • Added unifiedInbox and tabDescription flags to EncoreFeatureFlags type system
  • Integrated Zustand settings store with persistence via window.maestro.settings
  • Added feature toggle UI cards in Settings Modal Encore tab with role="switch" and aria-checked attributes
  • Gated Unified Inbox keyboard shortcut (Alt+I) behind encoreFeatures.unifiedInbox check
  • Gated AgentInbox modal rendering and handler props with conditional rendering pattern
  • All encore features default to false following opt-in convention
  • Changed Encore tab icon from FlaskConical to Sparkles for better visual consistency
  • tabDescription is infrastructure-only (no implementation gating yet)

The implementation follows the established Director's Notes pattern from CLAUDE-PATTERNS.md with proper gating across keyboard shortcuts, command palette, and modal rendering.

Confidence Score: 5/5

  • This PR is safe to merge with no risk - purely additive infrastructure with proper feature gating
  • Score reflects excellent implementation quality: follows established patterns from CLAUDE-PATTERNS.md, properly gates all access points, uses type-safe defaults, includes accessibility attributes (role/aria-checked), and maintains backward compatibility. No breaking changes, no logic bugs, and comprehensive feature gating.
  • No files require special attention - all changes follow established patterns

Important Files Changed

Filename Overview
src/renderer/types/index.ts Added unifiedInbox and tabDescription flags to EncoreFeatureFlags interface
src/renderer/stores/settingsStore.ts Set default values to false for both new encore features (opt-in convention)
src/renderer/hooks/keyboard/useMainKeyboardHandler.ts Added keyboard handler for agentInbox, properly gated by encoreFeatures.unifiedInbox check
src/renderer/components/SettingsModal.tsx Added feature toggle cards for Unified Inbox and Tab Descriptions, changed Encore tab icon from FlaskConical to Sparkles
src/renderer/App.tsx Added feature-gated callback for Unified Inbox and commented-out modal placeholder (component TBD)

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Start([User Action]) --> CheckFeature{Feature Enabled?}
    
    CheckFeature -->|Yes| AllowAccess[Allow Access]
    CheckFeature -->|No| BlockAccess[Block Access]
    
    AllowAccess --> KB[Keyboard Shortcut Alt+I]
    AllowAccess --> CP[Command Palette Entry]
    AllowAccess --> Modal[Modal Rendering]
    
    BlockAccess --> NoKB[No Keyboard Handler]
    BlockAccess --> NoCP[No Command Palette Entry]
    BlockAccess --> NoModal[No Modal]
    
    subgraph Settings["Settings Store (settingsStore.ts)"]
        SF[encoreFeatures.unifiedInbox: false]
        SF2[encoreFeatures.tabDescription: false]
    end
    
    subgraph UI["Settings Modal UI"]
        Toggle[Toggle Switch]
        Toggle --> Update[Update encoreFeatures]
        Update --> Persist[window.maestro.settings.set]
    end
    
    subgraph Gating["Feature Gates"]
        KB --> Gate1{encoreFeatures?.unifiedInbox}
        CP --> Gate2{onOpenAgentInbox !== undefined}
        Modal --> Gate3{encoreFeatures.unifiedInbox && agentInboxOpen}
    end
    
    Settings --> CheckFeature
    UI --> Settings

Last reviewed commit: 060ba44

greptile-apps avatar Feb 27 '26 14:02 greptile-apps

πŸ“ Walkthrough

Walkthrough

This change adds support for two new encore features: Unified Inbox and Tab Descriptions. A new Agent Inbox modal is introduced with state management through the modal store, wired through the component hierarchy, accessible via keyboard shortcut (Alt+I) and Quick Actions menu, with UI toggles in Settings.

Changes

Cohort / File(s) Summary
Modal Infrastructure
src/renderer/stores/modalStore.ts
Added agentInbox modal state to ModalId union and ModalDataMap; introduced setAgentInboxOpen action and agentInboxOpen selector for managing Agent Inbox modal lifecycle.
Type Definitions
src/renderer/types/index.ts, src/renderer/stores/settingsStore.ts
Extended EncoreFeatureFlags with two new boolean flags: unifiedInbox and tabDescription, both defaulting to false.
Component Hierarchy Wiring
src/renderer/App.tsx, src/renderer/components/AppModals.tsx, src/renderer/components/QuickActionsModal.tsx
Established prop passing chain from App β†’ AppModals β†’ AppUtilityModals β†’ QuickActionsModal for onOpenAgentInbox callback; destructured setAgentInboxOpen and agentInboxOpen from modal store in App.
Feature UI
src/renderer/components/SettingsModal.tsx
Added feature toggle cards for Unified Inbox and Tab Descriptions in Encore Features section; updated Encore tab icon from FlaskConical to Sparkles; imported Inbox and FileText icons.
Quick Actions Integration
src/renderer/components/QuickActionsModal.tsx
Added new main action item with id agentInbox, label "Unified Inbox", keyboard shortcut binding, and execution logic to call onOpenAgentInbox() and close the modal.
Keyboard Input Handling
src/renderer/constants/shortcuts.ts, src/renderer/hooks/keyboard/useMainKeyboardHandler.ts
Added agentInbox shortcut with keys Alt+I to DEFAULT_SHORTCUTS; added keyboard handler branch for agentInbox shortcut that opens modal when unifiedInbox feature flag is enabled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • RunMaestro/Maestro#470: Relates to modal store infrastructure and state management wiring that this PR extends with the new Agent Inbox modal.
πŸš₯ Pre-merge checks | βœ… 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (2 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title 'feat: Encore Feature system with gating infrastructure' accurately describes the main change: introducing an Encore feature system with feature flags and feature-gated functionality across the codebase.

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

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Feb 27 '26 14:02 coderabbitai[bot]

@felipeggv please run the following on your machine for this PR so it can move toward acceptance.

Here is the prompt you should run:

You are responsible for getting this PR in RunMaestro/Maestro to an accept-ready state.

PR: https://github.com/RunMaestro/Maestro/pull/473
Branch/Head: inspect the PR branch locally before making changes.

Goal:
Drive this PR to zero unresolved CodeRabbit and Greptile review threads.

Process:
1. Fetch the PR locally and work from a clean git worktree on the PR branch.
2. List all unresolved CodeRabbit and Greptile review threads for this PR.
3. For each unresolved bot thread:
   - verify whether the issue is still real on the current PR head
   - if it is already fixed or the thread is outdated, resolve the GitHub review thread immediately
   - if it is real, implement the smallest correct fix on the PR branch
4. After each fix batch:
   - run the relevant validation commands locally
   - push the branch
   - re-poll the PR’s unresolved CodeRabbit/Greptile threads
   - resolve any newly stale/fixed bot threads
5. Repeat until this PR has zero unresolved CodeRabbit and Greptile threads.

Rules:
- Resolve bot threads only when the current branch state actually fixes them.
- Do not resolve human review threads unless explicitly asked.
- Be surgical. Do not broaden scope beyond the review findings.
- If local validation differs from CI because of environment issues, state the exact failing test/check and the exact missing dependency/file/path.
- If a bot comment is a design tradeoff rather than a bug, explain why and leave it unresolved only if it truly still applies.

Definition of done:
- zero unresolved CodeRabbit threads
- zero unresolved Greptile threads
- branch pushed
- latest validation/check status re-polled
- concise summary written with:
  - PR URL
  - commits pushed
  - threads resolved
  - any remaining blockers

Keep looping until the PR is clean.

jeffscottward avatar Mar 14 '26 17:03 jeffscottward

Thanks for the contribution @felipeggv! Appreciate the clean gating structure and the encore tab UI. A few things to address before this can merge:

1. Merge conflicts β€” the branch is currently in a conflicting state against main. Could you rebase onto main and resolve the conflicts for a clean merge?

2. unifiedInbox feature is non-functional (per CodeRabbit's review). In src/renderer/App.tsx:

  • Line ~3715 wires onOpenAgentInbox to setAgentInboxOpen(true)
  • Lines ~4108-4118 have the AgentInboxModal render block fully commented out with a component TBD note
  • AgentInboxModal isn't defined/exported anywhere in the codebase

Toggling the flag on, the keyboard shortcut (Alt+I), and the Quick Actions entry will all call into a handler that opens nothing. Either:

  • a) Implement a minimal AgentInboxModal component and uncomment the render block, or
  • b) Drop the unifiedInbox flag/shortcut/handler/UI toggle from this PR and land it alongside the actual modal in a follow-up

Landing unfinished scaffolding that a user can toggle but that does nothing creates a confusing beta surface.

3. tabDescription flag has no consumers. I couldn't find any code that reads encoreFeatures.tabDescription β€” the toggle exists purely as UI. Same ask as above: either wire it to something, or defer the flag until the consuming feature lands.

4. CodeRabbit nitpick (optional but reasonable): the two toggle cards in SettingsModal.tsx (lines ~3644-3772) duplicate the same structure β€” worth extracting a small EncoreFeatureToggle component given this pattern will repeat for every future encore feature.

Happy to re-review once the rebase is done and the dead-code toggles are either wired up or pulled. Thanks again!

pedramamini avatar Apr 22 '26 03:04 pedramamini

Hi @felipeggv β€” thanks again for the contribution and patience on this one.

Following up on the April 22 review β€” the PR is still in a conflicting state against main, and no new commits have landed since. Could you:

  1. Rebase onto main and resolve the conflicts so we have a clean merge.
  2. Address the outstanding items from the prior review β€” primarily the non-functional unifiedInbox wiring (the commented-out AgentInboxModal render block / missing component) and the unused tabDescription flag. Either wire them up, or trim them from this PR and land them with the consuming feature in a follow-up.

Happy to re-review as soon as it's rebased. Thanks!

pedramamini avatar May 26 '26 16:05 pedramamini