Skip to content

Comments

feat(web): introduce SQL Notebook feature#59

Draft
wibus-wee wants to merge 147 commits intomainfrom
wibus/notebook-feat-1
Draft

feat(web): introduce SQL Notebook feature#59
wibus-wee wants to merge 147 commits intomainfrom
wibus/notebook-feat-1

Conversation

@wibus-wee
Copy link
Contributor

@wibus-wee wibus-wee commented Sep 16, 2025

🧪 Working in Progress

Progress: SQL Notebook CRDT capabilities have been completed and are now generally usable.

What's Changed

This Pull Request introduces a foundational and extensive new feature: Real-time Collaborative Notebooks. It replaces the previous, local-only SQL Console with a modern, multi-user, stateful notebook environment built on a robust CRDT-based architecture.

The changes are substantial and touch upon state management, component architecture, and backend communication.

Recommendation for Reviewers

It is highly recommended to start by reading the developer-guide.md to understand the architecture.

BREAKING CHANGES

  • Bump Nextjs version to 16.0.8
  • Bump React version to 19.2.1 - useEffctEvent hook is needed

…ata fields

Signed-off-by: wibus-wee <1596355173@qq.com>
… introducing modular action and cell types

Signed-off-by: wibus-wee <1596355173@qq.com>
…and actions

- Introduced core storage atoms for notebooks and active notebook ID.
- Added derived atoms for active notebook and notebook count.
- Implemented a notebook service atom to handle various notebook operations (create, update, delete, add cell, etc.).
- Updated action types to include new actions for cell execution and output management.
- Simplified cell output type to a string array for better handling.

This commit enhances the notebook functionality and state management in the application.

Signed-off-by: wibus-wee <1596355173@qq.com>
- Integrated react-scan to enhance development experience by monitoring component renders.
- Updated package.json to include react-scan as a dependency.
- Modified layout.tsx to conditionally start react-scan in development mode.

This commit improves the development workflow by providing insights into component performance.
Signed-off-by: wibus-wee <1596355173@qq.com>
Signed-off-by: wibus-wee <1596355173@qq.com>
…e for notebook count

Signed-off-by: wibus-wee <1596355173@qq.com>
Signed-off-by: wibus-wee <1596355173@qq.com>
…oolbar

Signed-off-by: wibus-wee <1596355173@qq.com>
…put types

Signed-off-by: wibus-wee <1596355173@qq.com>
… validation and query execution

Signed-off-by: wibus-wee <1596355173@qq.com>
…and output rendering

Signed-off-by: wibus-wee <1596355173@qq.com>
Signed-off-by: wibus-wee <1596355173@qq.com>
…eight options

Signed-off-by: wibus-wee <1596355173@qq.com>
…handling

Signed-off-by: wibus-wee <1596355173@qq.com>
…tion

- Updated the notebook service to initialize cells as an empty array.
- Enhanced the ADD_CELL action to generate a unique ID for new cells.
- Integrated functionality to set the new cell to editor mode upon addition.

Signed-off-by: wibus-wee <1596355173@qq.com>
Signed-off-by: wibus-wee <1596355173@qq.com>
…ents

- Removed the original Cell component and replaced it with a modular structure consisting of CellContainer, CellContent, CellOutput, CellToolbar, and their respective toolbar implementations for SQL and Markdown.
- Improved code organization and readability by separating concerns into distinct components.
- Maintained existing functionality while enhancing maintainability and scalability of the notebook cell feature.

Signed-off-by: wibus-wee <1596355173@qq.com>

Signed-off-by: wibus-wee <1596355173@qq.com>
- Added @tailwindcss/typography to enhance text styling capabilities.
- Updated EditableTitle component to use larger font size for better visibility.
- Modified MarkdownRenderer to apply typography styles for improved content presentation.
- Adjusted NotebookEditor to change padding for the EditableTitle component.

Signed-off-by: wibus-wee <1596355173@qq.com>

Signed-off-by: wibus-wee <1596355173@qq.com>
- Integrated Shiki for syntax highlighting in MarkdownRenderer.
- Replaced ReactMarkdown with a unified processor for improved Markdown handling.
- Added options for themes, line numbers, and inline code highlighting.
- Implemented loading state while processing Markdown content

Signed-off-by: wibus-wee <1596355173@qq.com>
…I consistency

Signed-off-by: wibus-wee <1596355173@qq.com>
…proved user experience

- Added useResizable hook to enable dynamic width adjustment of the NotebookSidebar.
- Updated sidebar styling to reflect the new width and included a resize handle for user interaction.

Signed-off-by: wibus-wee <1596355173@qq.com>
Signed-off-by: wibus-wee <1596355173@qq.com>
Signed-off-by: wibus-wee <1596355173@qq.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…structure

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…om handler

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…unnecessary sync handling

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…ding for text synchronization

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
… handling

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…support

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…rsistence logic

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…hdog for cell management

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
- Add SchemaTreeNode component for rendering schema nodes with expandable functionality.
- Create SchemaBrowser component to display database schemas and handle loading states.
- Introduce SchemaSearch for searching schemas within the SchemaBrowser.
- Define types for schema nodes and schema tree props.
- Implement SidebarTabs for navigating between notebooks and schema views.
- Update NotebookSidebar to integrate new SchemaBrowser and SidebarTabs components.
- Add useSchemaCompletion hook for providing schema-aware SQL completions in the Monaco editor.

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…nce tasks (#71)

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
…adings

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
… data

Signed-off-by: wibus-wee <62133302+wibus-wee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant