Skip to content

AI Assists#700

Merged
feruzm merged 7 commits into
developfrom
assist
Mar 10, 2026
Merged

AI Assists#700
feruzm merged 7 commits into
developfrom
assist

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Mar 10, 2026

Summary by CodeRabbit

  • New Features

    • AI Writing Assistant in Publish toolbar with actions (improve, check grammar, summarize, generate title, suggest tags) and dialog workflows that apply results to content, title, or tags.
    • AI Summarize action in entry listen view to generate and display summaries.
  • UX / UI

    • Points-based pricing, per-action costs, free-usage quotas, and balance/cost feedback in UI.
    • Thumbnails now show a subtle blur placeholder while images load.
    • Site fonts switched to Google-hosted Inter and Lora.
  • Localization

    • Complete en-US strings added for the AI Assist experience.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 10, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Adds an AI Assist feature: UI components and dialog, SDK hooks/queries/types for pricing and assist calls, config and locale entries, publish-toolbar and entry UI integration, plus i18n lazy-loading and several unrelated UI/devtools/layout tweaks.

Changes

Cohort / File(s) Summary
Toolbar & Entry UI
apps/web/src/app/publish/_components/publish-editor-toolbar.tsx, apps/web/src/app/(dynamicPages)/entry/.../_components/entry-page-listen.tsx
Integrates AiAssist dialog/button into publish toolbar and adds AI-assisted summarize flow into entry listen UI; manages dialog visibility, onApply handling, auth/points gating, and feature-flag conditional rendering.
AiAssist UI Components
apps/web/src/features/shared/ai-assist/ai-assist.tsx, apps/web/src/features/shared/ai-assist/ai-assist-dialog.tsx, apps/web/src/features/shared/ai-assist/index.ts
Adds AiAssist component (actions, pricing, submit flow, result UI, error handling) and AiAssistDialog wrapper; provides barrel export.
Config & Localization
apps/web/src/config/config.template.ts, apps/web/src/config/config.ts, apps/web/src/features/i18n/locales/en-US.json
Adds visionFeatures.aiAssist flag and a full ai-assist i18n namespace (UI strings, actions, errors, labels).
SDK: Mutations, Queries & Types
packages/sdk/src/modules/ai/mutations/use-ai-assist.ts, packages/sdk/src/modules/ai/mutations/index.ts, packages/sdk/src/modules/ai/queries/get-ai-assist-price-query-options.ts, packages/sdk/src/modules/ai/queries/index.ts, packages/sdk/src/modules/ai/types/index.ts, packages/sdk/src/modules/core/query-keys.ts
Implements useAiAssist mutation (POST /private-api/ai-assist), assist pricing query, new AiAssistPrice/AiAssistResponse types, query key assistPrices, and re-exports these APIs.
i18n Loading & Global Store
apps/web/src/features/i18n/index.ts, apps/web/src/core/global-store/modules/global-module.ts
Switches to lazy locale loading with loadLocale(lang) and ensures locales are loaded before applying language changes.
Client Providers & Layout
apps/web/src/app/client-providers.tsx, apps/web/src/app/layout.tsx, apps/web/next.config.js
Dynamic import for ReactQueryDevtools, swap to Google fonts, and disable production browser source maps.
Entry List Thumbnails
apps/web/src/features/shared/entry-list-item/entry-list-item-thumbnail.tsx
Adds blur-placeholder logic and unified image handling for thumbnails with smoother transitions.
Emoji & Firebase Adjustments
apps/web/src/features/chat/emoji-utils.ts, apps/web/src/api/firebase.ts
Makes emoji data lazy-loaded with helper APIs; removes Firebase Analytics initialization/exports.
Misc SDK index updates
packages/sdk/src/modules/ai/mutations/index.ts, packages/sdk/src/modules/ai/queries/index.ts
Re-exports newly added ai-assist mutation and assist price query options.
Dev/Tooling
apps/web/src/app/client-providers.tsx
Dynamically loads devtools component and conditionally renders in dev vs prod.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Toolbar as Publish Toolbar
    participant Dialog as AiAssistDialog
    participant Assist as AiAssist
    participant SDK as useAiAssist / pricing queries
    participant API as Private AI Assist API
    participant Cache as Query Cache

    User->>Toolbar: Click "AI Assist"
    Toolbar->>Dialog: setShow(true)
    Dialog->>Assist: mount(initialText)
    Assist->>SDK: fetch points & assist prices
    SDK-->>Assist: points + prices
    User->>Assist: choose action + submit text
    Assist->>SDK: mutate POST /private-api/ai-assist(action,text,code)
    SDK->>API: HTTP POST (private API)
    alt Success
        API-->>SDK: AiAssistResponse(output,cost)
        SDK->>Cache: invalidate points (if cost>0)
        SDK->>Cache: invalidate assistPrices
        SDK-->>Assist: response
        Assist->>Dialog: onApply(output, action)
        Dialog->>Toolbar: apply output -> update editor/state
        Toolbar->>Dialog: setShow(false)
    else Error (402/422/429/other)
        API-->>SDK: error
        SDK-->>Assist: propagate structured error
        Assist->>User: show error / allow retry
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested labels

patch

🐰✍️ I nibble lines and polish prose with care,
Titles, tags, grammar — I hop everywhere,
A tiny whiskered helper for your editor's gleam,
I sprinkle clearer words and tidy up the dream.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'AI Assists' is vague and generic, lacking specificity about the scope and nature of the changes despite the PR introducing comprehensive AI assistant features. Consider a more specific title such as 'Add AI writing assistant feature with toolbar integration' or 'Introduce AiAssist component with pricing and content actions' to better convey the main changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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
  • Commit unit tests in branch assist

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.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR label Mar 10, 2026
@feruzm feruzm merged commit 0858972 into develop Mar 10, 2026
1 check passed
@feruzm feruzm deleted the assist branch March 10, 2026 21:49
@coderabbitai coderabbitai Bot mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant