Skip to content

Update dependencies and refactor editor components; replace RichTextE… - #136

Merged
carhartlewis merged 2 commits into
mainfrom
lewis/policy-editor
Mar 15, 2025
Merged

carhartlewis merged 2 commits into
mainfrom
lewis/policy-editor

Conversation

@carhartlewis

@carhartlewis carhartlewis commented Mar 15, 2025 •

Copy link
Copy Markdown
Contributor

…ditor with AdvancedEditor, implement new selectors for color, link, and math, and enhance AI functionality with new commands and icons.

Summary by CodeRabbit

  • Chores
    • Upgraded core dependencies to boost performance and stability.
  • New Features
    • Launched an enhanced rich text editor with integrated AI-driven commands and interactive tools for formatting, color selection, linking, math formatting, and quick command suggestions.
    • Introduced new animated icons and loading indicators for a more engaging user experience.
  • Refactor/Style
    • Simplified component structures and refined typography and layout for a cleaner, polished interface.

…ditor with AdvancedEditor, implement new selectors for color, link, and math, and enhance AI functionality with new commands and icons.
@vercel

vercel Bot commented Mar 15, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 15, 2025 8:10pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
comp-portal ⬜️ Skipped (Inspect) Mar 15, 2025 8:10pm

@coderabbitai

coderabbitai Bot commented Mar 15, 2025 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

This PR updates various dependencies in the package configuration and refactors several editor components by removing deprecated logic, reformatting code, and introducing new AI-driven features. It removes some legacy components and configuration files, particularly in integrations and UI, while adding new components for advanced editing and AI-assisted commands. Additionally, minor CSS adjustments and middleware import modifications have been applied.

Changes

File(s) Change Summary
apps/app/package.json Updated numerous dependency versions (e.g., @ai-sdk/openai, bun, next, etc.) and added a new pnpm.overrides entry for tiptap-extension-global-drag-handle.
apps/app/src/app/[locale]/(app)/(dashboard)/policies/.../update-policy.ts Reformatting of the code for consistent indentation and spacing without altering functionality.
apps/app/src/app/[locale]/(app)/(dashboard)/policies/.../PolicyDetails.tsx Removed state variables and logic for managing save status; CSS import added for @bubba/ui/editor.css.
apps/app/src/app/[locale]/(app)/(dashboard)/policies/all/[policyId]/layout.tsx Removed unused import of the Title component.
apps/app/src/app/api/chat/route.ts Removed exports for runtime and maxDuration and adjusted indentation from two spaces to tabs.
apps/app/src/app/api/generate/route.ts Changed from two-space to tab-based indentation; code reformatting without altering the underlying logic.
Editor Components (various files under apps/app/src/components/editor/) New Components: Introduced AdvancedEditor, AICompletionCommands, AISelectorCommands, AISelector, GenerativeMenuSwitch, ColorSelector, LinkSelector, MathSelector, NodeSelector, TextButtons, and slash command suggestions.
Modifications: Refactored extensions.ts; updated policy-editor.tsx to use AdvancedEditor and removed policyId; removed rich-text-editor.tsx and header status.tsx.
Editor Icons (files under .../icons/) Added several new icon components: CrazySpinner, FontDefault, FontMono, FontSerif, LoadingCircle, and Magic; updated index.tsx to export the new icons.
apps/app/src/middleware.ts Removed NextResponse from the import statement, now only importing NextRequest.
Integrations (files under packages/integrations/src/github/ and .../gusto/) Removed configuration and logo files for GitHub and Gusto integrations.
packages/integrations/src/index.ts Updated the integrations export by removing GitHub and Gusto, now only including Aws and Deel.
CSS Files (packages/ui/src/editor.css and .../globals.css) In editor.css: Removed various margin and scrollbar properties; reintroduced table styles with adjustments.
In globals.css: Fixed a syntax error by adding a missing closing brace in a CSS rule.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant AE as AdvancedEditor
    participant GMS as GenerativeMenuSwitch
    participant AS as AISelector
    participant ASC as AISelectorCommands

    U->>AE: Interacts with advanced editor UI
    AE->>GMS: Toggle AI menu (open/close)
    GMS->>AS: Display AI selector interface
    U->>AS: Enter command/input
    AS->>ASC: Delegate command processing
    ASC->>AE: Execute formatting/update command
    AE-->>U: Update editor content
Loading

Possibly related PRs

Poem

I'm a rabbit with a joyful heart,
Hopping through code with a brand new art.
Dependencies updated, components reborn,
AI features shining like the light of dawn.
With every change, I dance and cheer,
A bunny's delight in the new code frontier!
🐇🚀 Happy hopping!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0925d75 and a3413f5.

⛔ Files ignored due to path filters (4)
  • bun.lock is excluded by !**/*.lock
  • packages/integrations/src/github/assets/image.png is excluded by !**/*.png
  • packages/integrations/src/gusto/assets/image.png is excluded by !**/*.png
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (36)
  • apps/app/package.json (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/policies/all/[policyId]/editor/actions/update-policy.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/policies/all/[policyId]/editor/components/PolicyDetails.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/policies/all/[policyId]/layout.tsx (0 hunks)
  • apps/app/src/app/api/chat/route.ts (1 hunks)
  • apps/app/src/app/api/generate/route.ts (1 hunks)
  • apps/app/src/components/editor/advanced-editor.tsx (1 hunks)
  • apps/app/src/components/editor/extensions.ts (1 hunks)
  • apps/app/src/components/editor/generative/ai-completion-command.tsx (1 hunks)
  • apps/app/src/components/editor/generative/ai-selector-commands.tsx (1 hunks)
  • apps/app/src/components/editor/generative/ai-selector.tsx (1 hunks)
  • apps/app/src/components/editor/generative/generative-menu-switch.tsx (1 hunks)
  • apps/app/src/components/editor/headers/status.tsx (0 hunks)
  • apps/app/src/components/editor/icons/crazy-spinner.tsx (1 hunks)
  • apps/app/src/components/editor/icons/font-default.tsx (1 hunks)
  • apps/app/src/components/editor/icons/font-mono.tsx (1 hunks)
  • apps/app/src/components/editor/icons/font-serif.tsx (1 hunks)
  • apps/app/src/components/editor/icons/index.tsx (1 hunks)
  • apps/app/src/components/editor/icons/loading-circle.tsx (1 hunks)
  • apps/app/src/components/editor/icons/magic.tsx (1 hunks)
  • apps/app/src/components/editor/policy-editor.tsx (2 hunks)
  • apps/app/src/components/editor/rich-text-editor.tsx (0 hunks)
  • apps/app/src/components/editor/selectors/color-selector.tsx (1 hunks)
  • apps/app/src/components/editor/selectors/link-selector.tsx (1 hunks)
  • apps/app/src/components/editor/selectors/math-selector.tsx (1 hunks)
  • apps/app/src/components/editor/selectors/node-selector.tsx (1 hunks)
  • apps/app/src/components/editor/selectors/text-buttons.tsx (1 hunks)
  • apps/app/src/components/editor/slash-command.tsx (1 hunks)
  • apps/app/src/middleware.ts (1 hunks)
  • packages/integrations/src/github/assets/logo.tsx (0 hunks)
  • packages/integrations/src/github/config.ts (0 hunks)
  • packages/integrations/src/gusto/assets/logo.tsx (0 hunks)
  • packages/integrations/src/gusto/config.ts (0 hunks)
  • packages/integrations/src/index.ts (1 hunks)
  • packages/ui/src/editor.css (2 hunks)
  • packages/ui/src/globals.css (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

…date middleware import for NextRequest type.

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – app — a3413f5d Deployed Mar 15, 2025 by vercel[bot]
Preview – comp-portal — a3413f5d Deployed Mar 15, 2025 by vercel[bot]
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