-
Notifications
You must be signed in to change notification settings - Fork 117
feat: support ai writer #69
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
Conversation
🥷 Ninja i18n – 🛎️ Translations need to be updatedProject
|
| lint rule | new reports | level | link |
|---|---|---|---|
| Missing translation | 504 | warning | contribute (via Fink 🐦) |
6a9aa6c to
12aa3f2
Compare
12aa3f2 to
a3a81ad
Compare
80a22e5 to
0bc9a4b
Compare
64e2335 to
62dc3b9
Compare
355e369 to
97efa9f
Compare
97efa9f to
4235493
Compare
Reviewer's Guide by SourceryThis pull request introduces AI writing assistance features, improves the selection toolbar's visibility logic and positioning, adds functionality to duplicate pages, and fixes a bug where blocks could not be found. Sequence diagram for AI Writer: Ask AI AnythingsequenceDiagram
participant User
participant SlashPanel
participant Editor
participant AIWriter
User->>SlashPanel: Types '/' and selects 'Ask AI Anything'
activate SlashPanel
SlashPanel->>Editor: getBeforeContent()
activate Editor
Editor-->>SlashPanel: Returns content before cursor
deactivate Editor
SlashPanel->>AIWriter: askAIAnything(content)
deactivate SlashPanel
activate AIWriter
AIWriter->>AIWriter: Processes content and generates response
AIWriter-->>Editor: Inserts AI-generated content into Editor
deactivate AIWriter
Sequence diagram for AI Writer: Continue WritingsequenceDiagram
participant User
participant SlashPanel
participant Editor
participant AIWriter
User->>SlashPanel: Types '/' and selects 'Continue Writing'
activate SlashPanel
SlashPanel->>Editor: getBeforeContent()
activate Editor
Editor-->>SlashPanel: Returns content before cursor
deactivate Editor
SlashPanel->>AIWriter: continueWriting(content)
deactivate SlashPanel
activate AIWriter
AIWriter->>AIWriter: Processes content and generates response
AIWriter-->>Editor: Inserts AI-generated content into Editor
deactivate AIWriter
Updated class diagram for EditorOverlayclassDiagram
class EditorOverlay{
-viewId: string
-workspaceId: string
-writerRequest: WriterRequest
-handleInsertBelow(data: EditorData): void
-handleReplaceSelection(data: EditorData): void
-handleExit(): void
-container: HTMLDivElement | null
-scrollerContainer: HTMLDivElement | null
-absoluteHeight: number
}
class WriterRequest{
-workspaceId: string
-viewId: string
-requestInstance: any
+WriterRequest(workspaceId: string, viewId: string, requestInstance: any)
}
EditorOverlay --|> AIAssistantProvider : uses
EditorOverlay ..> WriterRequest : creates
AIAssistantProvider ..> EditorData : handles
note for EditorOverlay "This class integrates the AI Assistant Provider into the editor overlay."
Updated class diagram for SlashPanelclassDiagram
class SlashPanel{
-searchText: string
-removeContent(): void
-addPage(parentId: string, payload: CreatePagePayload): Promise<string>
-openPageModal(pageId: string): void
-viewId: string
-loadViewMeta(viewId: string): Promise<View>
-viewName: string
-setViewName(name: string): void
-editor: YjsEditor
-t: UseTranslation
-optionsRef: useRef
-selectedOption: string | null
-transformOrigin: PopoverOrigin | undefined
-selectedOptionRef: useRef
-openPopover(anchorEl: HTMLElement): void
-closePopover(): void
-openPanel(panelType: PanelType): void
-askAIAnything(content: string): void
-continueWriting(content: string): Promise<void>
-getBeforeContent(): string
-chars: number
}
SlashPanel --|> usePanelContext : uses
SlashPanel --|> useEditorContext : uses
SlashPanel --|> useTranslation : uses
SlashPanel --|> useSlateStatic : uses
SlashPanel --|> useAIWriter : uses
note for SlashPanel "This class integrates AI writing actions into the slash panel."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
We encountered an error and are unable to review this PR. We have been notified and are working to fix it.
You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.
211e88a to
289cf4c
Compare
289cf4c to
5693542
Compare
* feat: support ai writer * feat: support duplicate page * feat: support upgrade AI Max
Description
Checklist
General
Testing
Feature-Specific
Summary by Sourcery
Add AI writer support to the AppFlowy web editor, including AI assistant features, slash menu AI options, and infrastructure for AI-powered writing tools
New Features:
Enhancements: