Skip to content

feat(ai): complete Phase 4-5 — AI command execution + plugin bridge#150

Merged
github-actions[bot] merged 9 commits into
developfrom
feature/phase-4-5-completion
Mar 13, 2026
Merged

feat(ai): complete Phase 4-5 — AI command execution + plugin bridge#150
github-actions[bot] merged 9 commits into
developfrom
feature/phase-4-5-completion

Conversation

@tomymaritano

@tomymaritano tomymaritano commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Phase 4 (AI Knowledge): Wire ai:summarize, ai:rewrite, ai:tweet commands with real Claude prompts and output routing (replace selection, insert at cursor, or show in panel)
  • Phase 5 (Extensibility): Bridge plugin AI command store → command palette so plugin-registered AI commands are discoverable and executable

Changes

Phase 4

  • Add built-in prompt templates (SUMMARIZE, REWRITE, TWEET) to packages/ai-assistant
  • AiPanel supports initialCommand prop for auto-execution
  • Output target routing: replace swaps editor selection, insert adds at cursor, panel shows in chat
  • Handler wiring in App.tsx → useRegisterAiCommands

Phase 5

  • New useRegisterPluginAiCommands hook subscribes to aiCommandStore and syncs to CommandRegistry
  • Plugin AI commands auto-appear in command palette with AI: prefix
  • Template resolution with editor context ({{selection}}, {{note}}, {{title}})
  • Automatic cleanup on plugin unload

Test plan

  • Open command palette → verify Summarize/Rewrite/Tweet commands appear
  • Select text → invoke Summarize → AI panel shows summary
  • Select text → invoke Rewrite → selection replaced in editor
  • Select text → invoke Tweet → AI panel shows tweet version
  • Cmd+K opens AI panel in chat mode
  • Cmd+Shift+K opens AI panel in ask-notes mode

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • AI commands: summarize, rewrite, and tweet integrated into the AI panel.
    • New automated GitFlow release process and version bump to 0.9.0.
    • Violet-centric design system and theme tokens.
  • Bug Fixes

    • Safer auth token encoding and improved sync retry/abort behavior.
    • Various stability and request-retry improvements.
  • Documentation

    • Added roadmap and updated changelog.

tomymaritano and others added 8 commits March 13, 2026 15:04
Prepare release/0.9.0 with version bumps in root and desktop
package.json files, and update CHANGELOG with all changes since 0.1.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Phases 6-12 strategic roadmap covering workspace enhancement,
command palette evolution, AI workflows, knowledge retrieval,
and developer workflows. Remove tracked ._* resource fork files
from exFAT volume.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configure Vercel to build apps/web from the monorepo root
using pnpm workspaces.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Critical:
- Guard apiClient post-refresh retry to prevent infinite 401 loop

Major:
- Treat transient refresh errors as retryable, not logout-worthy
- Use ApiError.statusCode for auth-expiry detection in syncService
- Handle intentional sync abort gracefully (no false error status)
- Use product-config facade labels for pricing display
- Fix FaqAccordion accessibility (ARIA roles, tab semantics)
- Fix Testimonials semantic HTML (figcaption, star rating aria)
- Add aria-labelledby to WhyLocal section
- Fix animated-grid-pattern memory leak (mount guard, cleanup)
- Fix hero-video-dialog keyboard handling (Escape via useEffect)

Minor:
- Guard LoginModal reset against rapid reopen race condition
- Fix fallback color to match teal accent scheme
- URL-encode auth verify token in deep links
- Fix import order in docs layout
- Suppress transitions in prefers-reduced-motion
- Stabilize animated-beam random duration with useMemo
- Add focus management to hero-video-dialog

Nitpick:
- Rename LoginModal → EnableSyncModal to match export name
- Extract CSS color tokens for ai-panel and global styles
- Improve Footer, dot-pattern, and docs page component quality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename confusing `useSettingsStore` variable to `hasSettingsKey` in AiPanel
- Add loading="lazy" to hero video thumbnail image

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a release/* PR merges to main:
1. Creates git tag vX.Y.Z from package.json version
2. Merges main back to develop (Git Flow sync)

This triggers the existing release.yml workflow which builds
distributables and creates the GitHub Release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add validate job to release.yml: fails if tag doesn't match package.json
- Document SemVer convention (v* prefix) and tag protection rules
- Tags created only by GitHub Actions via auto-tag.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 4 (AI Knowledge):
- Wire ai:summarize, ai:rewrite, ai:tweet with real Claude prompts
- Add built-in prompt templates (summarize, rewrite, tweet)
- AiPanel auto-executes pre-filled commands with output routing
- Support replace-selection, insert-at-cursor, and panel output targets

Phase 5 (Extensibility):
- Create useRegisterPluginAiCommands hook bridging aiCommandStore → CommandRegistry
- Plugin AI commands auto-appear in command palette
- Template resolution with editor context (selection, note, title)
- Dynamic registration/cleanup on plugin load/unload

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
readide Ready Ready Preview, Comment Mar 13, 2026 7:31pm

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file ci app:web app:desktop labels Mar 13, 2026
@github-actions github-actions Bot enabled auto-merge (squash) March 13, 2026 19:24
@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 488d8aff-01ac-47e5-9c13-ea52eaac05e6

📥 Commits

Reviewing files that changed from the base of the PR and between 8ddc2ad and a7261ee.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/App.tsx
  • apps/desktop/src/renderer/components/ai/AiPanel.tsx

📝 Walkthrough

Walkthrough

Automated GitHub Actions release flow added; v0.9.0 version bump and changelog; new AI commands (summarize, rewrite, tweet) with plugin bridge and AiPanel auto-execution; improved auth refresh/retry and sync abort handling; major web theming and accessibility updates; various UI and style adjustments.

Changes

Cohort / File(s) Summary
Release Automation & Docs
​.github/workflows/auto-tag.yml, ​.github/workflows/release.yml, ​.github/RELEASE.md, CHANGELOG.md, ROADMAP.md, vercel.json
Add auto-tagging workflow, tag validation on release workflow, Git Flow release docs, changelog and roadmap additions, and Vercel deployment config.
Version Bumps
package.json, apps/desktop/package.json
Bumped package versions to v0.9.0.
Desktop AI — UI & Integration
apps/desktop/src/renderer/App.tsx, apps/desktop/src/renderer/components/ai/AiPanel.tsx, apps/desktop/src/renderer/styles/ai-panel.css, apps/desktop/src/renderer/hooks/useRegisterAiCommands.ts, apps/desktop/src/renderer/hooks/useRegisterPluginAiCommands.ts, packages/ai-assistant/src/prompts.ts, packages/ai-assistant/src/index.ts
Add built-in AI prompts and exports; introduce AiInitialCommand and auto-execution in AiPanel; connect built-in and plugin AI commands; small styling tweaks for AI badge.
Desktop Auth & Sync Services
apps/desktop/src/main/services/apiClient.ts, apps/desktop/src/main/services/syncService.ts
Introduce guarded token-refresh retry, deduplicate in-flight refreshes, richer RefreshResult states, and explicit sync-abort handling; use ApiError for auth checks.
Desktop Sync UI & Exports
apps/desktop/src/renderer/components/sync/EnableSyncModal.tsx, apps/desktop/src/renderer/components/sync/index.ts, apps/desktop/src/renderer/components/sidebar/Sidebar.tsx
Guarded state reset on modal close, corrected re-export source for EnableSyncModal, added CSS classes to sync prompt buttons.
Desktop Styling / Tokens
apps/desktop/src/renderer/styles/tokens.css, apps/desktop/src/renderer/styles/global.css
Add --accent-subtle token and switch sync prompt selectors to class-based rules; update focus color.
Web Theming & Globals
apps/web/app/globals.css, apps/web/src/...
Introduce violet-centric design tokens (--rd-*) and remap many color tokens to the new palette across components and utilities.
Web Components & Accessibility
apps/web/components/FaqAccordion.tsx, apps/web/components/Footer.tsx, apps/web/components/landing/Testimonials.tsx, apps/web/components/landing/WhyLocal.tsx
Add ARIA roles/semantic markup for tabs, improve accessibility, simplify Footer, update testimonial semantics.
Magic UI & Interaction Safety
apps/web/components/magicui/animated-beam.tsx, animated-grid-pattern.tsx, dot-pattern.tsx, hero-video-dialog.tsx
Add memoization and lifecycle guards (useMemo/useCallback/mountedRef), improve focus/keyboard handling, lazy load thumbnail, and unify close behavior.
Web Pages & MDX
apps/web/app/(marketing)/auth/verify/AuthVerifyContent.tsx, apps/web/app/(marketing)/pricing/page.tsx, apps/web/app/docs/[[...slug]]/page.tsx, apps/web/app/docs/layout.tsx
Encode tokens in URLs, replace hard-coded colors with semantic tokens, remove NumberTicker in pricing, and switch MDX components injection to hook-based approach.
Ignore Rules
.gitignore, apps/web/.gitignore
Added .vercel to gitignore files.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant App as Desktop App
    participant AiPanel
    participant Template as Template Engine
    participant API as AI Service
    participant Editor

    User->>App: Trigger AI command (summarize/rewrite/tweet)
    App->>Editor: Read selection / context
    App->>AiPanel: Open with initialCommand (system, user, outputTarget)
    AiPanel->>Template: resolveTemplate(userPrompt + selection)
    Template-->>AiPanel: Resolved prompt
    AiPanel->>API: Query AI (system + user)
    API-->>AiPanel: Response
    alt outputTarget = 'replace'
        AiPanel->>Editor: replaceSelection(text)
        Editor-->>User: Selection replaced
    else outputTarget = 'insert'
        AiPanel->>Editor: insertAtCursor(text)
        Editor-->>User: Text inserted
    else outputTarget = 'panel'
        AiPanel-->>User: Show response in panel
    end
    AiPanel->>App: onCommandExecuted()
    App->>App: Clear pending AI command
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% 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 summarizes the main changes: completing Phase 4-5 with AI command execution and plugin bridge support, which aligns with the substantial feature work across multiple files.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/phase-4-5-completion
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Remove eslint-disable comment for non-existent react-hooks/exhaustive-deps
rule definition, and reorder @readied/ai-assistant imports before relative
imports per import-x/order rule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot merged commit 4ccab57 into develop Mar 13, 2026
14 checks passed
@tomymaritano tomymaritano mentioned this pull request Mar 14, 2026
5 tasks
github-actions Bot pushed a commit that referenced this pull request Mar 14, 2026
## Release v0.9.0

### Highlights

- **Auth → Payment → Sync flow**: License-gated sync with smart step
routing in EnableSyncModal
- **Stripe checkout**: Monthly (€2/mo) and annual (€20/year) plan
selection
- **Sidebar drag-and-drop**: Grip handle, circular reference prevention,
child depth propagation
- **CI/CD**: Auto-deploy API — develop → staging, main → production
- **Design tokens**: SyncStatusIndicator uses CSS variables instead of
hardcoded colors
- **AI features**: Command execution, plugin bridge, knowledge system
(Phase 4-5)
- **UI cleanup**: Tailwind v4 canonical classes, removed dead
design-system package

### Changes since v0.8.0

- feat(sync): connect auth → payment → sync flow with license gating
(#154)
- chore: Tailwind v4 canonical classes + tsconfig cleanup (#151)
- feat(ai): complete Phase 4-5 — AI command execution + plugin bridge
(#150)
- feat(ai,plugins): complete Phase 4-5 — AI knowledge & extensibility
- feat(desktop,api): complete Phase 1-3 roadmap implementation

### Checklist

- [x] `pnpm typecheck` passes
- [x] `pnpm test` passes
- [x] `package.json` version is `0.9.0`
- [x] All features merged to develop first
- [x] API production secrets configured (Stripe, Resend)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

# Release Notes

* **New Features**
* Added AI-powered text commands (summarize, rewrite, tweet) with plugin
integration.
* Introduced drag-and-drop notebook reordering with automatic circular
reference protection.
  * Enhanced sync onboarding with license-based feature gating.
  * Improved magic link authentication with automatic verification.

* **Bug Fixes**
  * Fixed token refresh infinite loop handling.
  * Added URL encoding for verification links.
  * Improved cleanup for animated UI components.

* **Improvements**
  * Enhanced error handling for authentication and sync failures.
  * Added accessibility attributes (ARIA labels, semantic HTML).
  * Updated visual styling with new token-driven design system.

* **Refactor**
  * Migrated from design-system package to plugin-api package.
  * Consolidated design tokens and theme system.

* **Chores**
  * Updated GitHub Actions release automation.
  * Refreshed project documentation and contribution guidelines.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:desktop app:web ci dependencies Pull requests that update a dependency file size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant