-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: branching clean #2767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: branching clean #2767
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Caution Review failedThe pull request is closed. WalkthroughLarge refactor and API alignment: replace WebFrame/WebFrameView with Frame/FrameView across client/editor; rename many DB mappers to fromDb*/toDb*; add branch domain (models, schema, mappers, router, client BranchManager); add canvas/frame/chat/deployment DB schemas and related API changes; move project tags into metadata. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as Client UI (Editor)
participant BM as BranchManager
participant API as tRPC branchRouter
participant DB as Database
User->>UI: Select/switch branch
UI->>BM: switchToBranch(branchId)
BM->>BM: set currentBranch (if changed)
alt starting sandbox
UI->>BM: startCurrentBranchSandbox()
BM->>API: getByProjectId(projectId)
API->>DB: SELECT branches WHERE projectId
DB-->>API: Branch[]
API-->>BM: fromDbBranch[] (mapped)
BM->>BM: getCurrentSandbox().start()
end
sequenceDiagram
autonumber
participant Client as Client (Frame create/update)
participant Store as FramesManager
participant API as frameRouter
participant DB as Database
Client->>Store: create/update Frame (Frame object)
Store->>API: create/update(input: frameInsert/UpdateSchema with id)
API->>DB: INSERT/UPDATE frames USING payload (uses id when updating)
DB-->>API: returning row
API-->>Store: fromDbFrame(dbRow)
Store->>Client: updated Frame
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (61)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| await ctx.db.insert(branches).values(input); | ||
| return true; | ||
| } catch (error) { | ||
| console.error('Error creating frame', error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical error: The error message says 'Error creating frame', but given the context it should probably be 'Error creating branch'.
| console.error('Error creating frame', error); | |
| console.error('Error creating branch', error); |
| ); | ||
| return true; | ||
| } catch (error) { | ||
| console.error('Error updating frame', error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical error: 'Error updating frame' should likely be 'Error updating branch'.
| console.error('Error updating frame', error); | |
| console.error('Error updating branch', error); |
| await ctx.db.delete(branches).where(eq(branches.id, input.branchId)); | ||
| return true; | ||
| } catch (error) { | ||
| console.error('Error deleting frame', error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical error: 'Error deleting frame' should likely be 'Error deleting branch'.
| console.error('Error deleting frame', error); | |
| console.error('Error deleting branch', error); |
| import { createInsertSchema, createUpdateSchema } from "drizzle-zod"; | ||
| import { z } from "zod"; | ||
| import { projects } from "../project"; | ||
| import { CONVERSATION_MESSAGe_RELATION_NAME, messages } from "./message"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical issue: The import name 'CONVERSATION_MESSAGe_RELATION_NAME' has an inconsistent casing. Likely, it should be 'CONVERSATION_MESSAGE_RELATION_NAME' with an uppercase 'E' to maintain consistency.
| import { CONVERSATION_MESSAGe_RELATION_NAME, messages } from "./message"; | |
| import { CONVERSATION_MESSAGE_RELATION_NAME, messages } from "./message"; |
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Important
Refactor codebase to introduce branch management, update models and mappers, refactor components, and enhance API routers.
BranchManagerclass inmanager.tsfor handling branch operations.Frame,Canvas,Branch, andProjectmodels inmodels/src/project.mappers/projectandmappers/chatto use new model structures.GestureScreen,FrameView,PageSelector,TopBar, andFrameComponentto use updated models.SelectProjectandSettingscomponents to handle new project metadata structure.branchRouterto handle branch-related API requests.conversationRouter,messageRouter,frameRouter, andprojectRouterto use new mappers.schema/canvas,schema/chat, andschema/project.defaults/frame.ts.This description was created by
for fbc13e6. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit