Skip to content

Univer Sheets v0#8902

Merged
eliandoran merged 16 commits intomainfrom
experiment/univer_sheets
Mar 3, 2026
Merged

Univer Sheets v0#8902
eliandoran merged 16 commits intomainfrom
experiment/univer_sheets

Conversation

@eliandoran
Copy link
Contributor

@eliandoran eliandoran commented Mar 3, 2026

Closes #1841.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the application's data management capabilities by introducing a new spreadsheet note type. This feature allows for the creation, editing, and storage of spreadsheet data, providing users with a powerful tool for organizing information. The integration leverages the Univer Sheets library, ensuring a rich and interactive user experience with support for dark mode and automatic data saving.

Highlights

  • New Spreadsheet Note Type: Introduced a new 'spreadsheet' note type, allowing users to create and manage tabular data directly within the application.
  • Univer Sheets Integration: Integrated the Univer Sheets library to provide robust spreadsheet functionality, including initialization, dark mode support, and data persistence.
  • UI/UX Enhancements: Added a dedicated icon for spreadsheets, ensured full-width display for spreadsheet notes, and included 'spreadsheet' in relevant UI contexts like note type menus and source views.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/client/package.json
    • Added new dependencies: @univerjs/preset-sheets-core and @univerjs/presets.
  • apps/client/src/entities/fnote.ts
    • Extended the NoteType union to include 'spreadsheet'.
  • apps/client/src/services/note_types.ts
    • Reordered import statements for consistency.
    • Added a new NoteTypeMapping for 'spreadsheet' with application/json mime type and a table icon.
    • Updated string concatenation for uiIcon to use template literals.
    • Removed redundant command assignments in getBlankNoteTypes, getUserTemplates, and getBuiltInTemplates.
    • Changed let rootNoteInfo to const rootNoteInfo for immutability.
    • Updated server.get call to use a template literal for templateNoteId.
    • Refactored isNewTemplate to remove an unnecessary else block.
  • apps/client/src/translations/en/translation.json
    • Added a new translation key for 'spreadsheet'.
  • apps/client/src/widgets/note_types.tsx
    • Registered a new spreadsheet entry in TYPE_MAPPINGS, linking it to the Spreadsheet widget, defining its class name, and setting it as printable and full height.
  • apps/client/src/widgets/note_wrapper.ts
    • Included 'spreadsheet' in the list of note types that should be displayed in full width.
    • Fixed a semicolon for COLLECTIONS_WITH_BACKGROUND_EFFECTS.
  • apps/client/src/widgets/ribbon/NoteActions.tsx
    • Added 'spreadsheet' to the list of note types considered to have a source.
  • apps/client/src/widgets/type_widgets/Spreadsheet.css
    • Added CSS rules to ensure the spreadsheet widget occupies 100% height within its container.
  • apps/client/src/widgets/type_widgets/Spreadsheet.tsx
    • Created a new Spreadsheet React component responsible for initializing and managing the Univer Sheets instance.
    • Implemented useInitializeSpreadsheet hook for setting up the Univer Sheets environment.
    • Implemented useDarkMode hook to toggle dark mode based on the application's color scheme.
    • Implemented usePersistence hook to handle saving and loading spreadsheet data to and from the note's content.
  • apps/server/src/services/note_types.ts
    • Added 'spreadsheet' to the list of recognized note types with a default MIME type of application/json.
  • packages/commons/src/lib/notes.ts
    • Mapped the 'spreadsheet' note type to a 'bx bx-table' icon.
  • packages/commons/src/lib/rows.ts
    • Extended the ALLOWED_NOTE_TYPES array to include 'spreadsheet'.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an initial “Spreadsheet” note type backed by Univer Sheets, wiring it through the shared note-type definitions, server defaults, and client UI/widget system.

Changes:

  • Add "spreadsheet" to the shared/client/server note type registries (including icons and defaults).
  • Introduce a new client type widget Spreadsheet.tsx (Univer Sheets) with basic persistence and dark-mode support.
  • Expose the new type in UI affordances (note type chooser, context menu “source”, full-width layout) and add an English translation key.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/commons/src/lib/rows.ts Adds spreadsheet to the allowed note type union.
packages/commons/src/lib/notes.ts Adds an icon mapping for spreadsheet.
apps/server/src/services/note_types.ts Registers spreadsheet with default mime application/json.
apps/client/src/widgets/type_widgets/Spreadsheet.tsx New Univer Sheets-based widget with persistence + dark mode.
apps/client/src/widgets/type_widgets/Spreadsheet.css Ensures the spreadsheet container fills height.
apps/client/src/widgets/ribbon/NoteActions.tsx Treats spreadsheets as having a “source” representation.
apps/client/src/widgets/note_wrapper.ts Treats spreadsheets as full-width notes.
apps/client/src/widgets/note_types.tsx Adds spreadsheet to client type widget mappings.
apps/client/src/translations/en/translation.json Adds note_types.spreadsheet translation.
apps/client/src/services/note_types.ts Adds spreadsheet to new-note menu options + minor refactors.
apps/client/src/services/in_app_help.ts Adds spreadsheet to the note-type help mapping.
apps/client/src/entities/fnote.ts Extends client-side NoteType union with spreadsheet.
apps/client/package.json Adds Univer Sheets dependencies.

Comment on lines +117 to +121
if (command.type !== CommandType.MUTATION) return;
spacedUpdate.scheduleUpdate();
});
return () => disposable.dispose();
}, [ apiRef, spacedUpdate, workbookLoaded ]);
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command listener is attached only once (gated by workbookLoaded) and won’t be re-attached if onContentChange() later disposes the active workbook and creates a new one (e.g. after sync updates). After such a reload, mutations in the new workbook won’t trigger spacedUpdate.scheduleUpdate(). Track the active workbook (e.g., workbook id / incrementing version state) in the effect dependencies or register the listener immediately after createWorkbook() and dispose the previous listener when replacing the workbook.

Copilot uses AI. Check for mistakes.
@eliandoran eliandoran added this to the v0.102.1 milestone Mar 3, 2026
@eliandoran eliandoran marked this pull request as ready for review March 3, 2026 18:42
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 3, 2026
@eliandoran eliandoran merged commit 2d00ac4 into main Mar 3, 2026
10 of 11 checks passed
@eliandoran eliandoran deleted the experiment/univer_sheets branch March 3, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Spreadsheets embedded in notes like notion

2 participants