-
Notifications
You must be signed in to change notification settings - Fork 439
Feat/sheet update api #4967
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
Open
fangsmile
wants to merge
6
commits into
develop
Choose a base branch
from
feat/sheet-update-api
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/sheet update api #4967
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Summary - Add IVTableSheetUpdateOptions type for partial spreadsheet updates - Implement WorkSheet.updateSheetOption to map common sheet options to VTable granular APIs - Implement VTableSheet.updateOption as the unified entry for full and incremental updates - Integrate FormulaManager.rebuildFormulas to keep formulas and dependencies consistent after sheet structure changes # Details - Extend ts-types to support partial update options with JSDoc, including theme, default sizes, header visibility, frozen rows/columns, filter config and state, sort state, and row/column size configs - Enhance FormulaManager with rebuildFormulas helper to rebuild internal sheet/formula state from ISheetDefine list after structural updates - Add WorkSheet.updateSheetOption to apply per-sheet incremental changes via existing VTable APIs such as setRowHeight, setColWidth, updateTheme, updateOption, and Filter plugin setFilterState - Add VTableSheet.updateOption as the top-level API to: - Diff sheets for added/removed/updated cases - Reuse existing WorkSheet instances for updated sheets and delegate to updateSheetOption - Keep SheetManager definitions in sync and re-activate the correct sheet - Trigger FormulaManager to rebuild formulas and dependencies after structural changes # References - Aligns with plan.md Stage 2 for spreadsheet update API implementation in @visactor/vtable-sheet - Reuses existing VTable APIs (updateOption, setRowHeight, setColWidth, updateTheme, filter plugin APIs, etc.) for minimal-risk incremental updates Co-Authored-By: Aime <aime@bytedance.com> Change-Id: I16be04ec75981bb10495ad3f8f93c09018533888
# Summary - Add unit tests for the new spreadsheet update APIs in @visactor/vtable-sheet # Details - Cover VTableSheet.updateOption behavior in multi-sheet scenarios, including: - Full replacement of the sheets list with added, removed, and updated sheets - Reuse of existing WorkSheet instances for updated sheets - Correct activation of the target active sheet after full update - Cover WorkSheet.updateSheetOption incremental behavior in single-sheet scenarios, including: - Column width and row height updates via columnWidthConfig/rowHeightConfig - Header visibility (showHeader) and frozen rows/columns configuration - Filter on/off and filterState propagation - SortState updates and basic theme updates # References - Validates the feature implementation from commit "feat(vtable-sheet): add sheet update apis" and ensures API contracts for Stage 2 are guarded by tests Co-Authored-By: Aime <aime@bytedance.com> Change-Id: I0de161197898525080343900ae92eeeebe3dbfe9
## Summary - Fix lint issues reported for `vtable-sheet` update API implementation. - Clean up unused imports and parameters. - Replace non-null assertions, loose equality checks, and self-assignments with safer patterns. ## Details - Removed unused `IStyle` type import from `ts-types/index.ts`. - Updated `FormulaManager` catch blocks to avoid unused error variables, while keeping error handling behavior unchanged. - Removed no-op self-assignment in `WorkSheet._generateTableOptions` and added an explicit guard for `addressFromCoord` to avoid non-null assertion on `row`. - In `VTableSheet`: - Renamed unused callback parameter in `createSheetTabItem`. - Replaced non-null assertions on `workSheetInstances.get(...)` with explicit guards and clearer error messages. - Made the `saveToConfig` sort state mapping use explicit `null/undefined` checks instead of loose equality. - Re-ran `standard-lint` against the modified files to ensure they pass the configured rule set. ## Affected Files - `packages/vtable-sheet/src/ts-types/index.ts` - `packages/vtable-sheet/src/managers/formula-manager.ts` - `packages/vtable-sheet/src/core/WorkSheet.ts` - `packages/vtable-sheet/src/components/vtable-sheet.ts` ## Testing - `standard-lint` (scoped to the modified files) now reports all checks passing: - `packages/vtable-sheet/src/ts-types/index.ts` - `packages/vtable-sheet/src/index.ts` - `packages/vtable-sheet/src/managers/formula-manager.ts` - `packages/vtable-sheet/src/core/WorkSheet.ts` - `packages/vtable-sheet/src/components/vtable-sheet.ts` - `packages/vtable-sheet/__tests__/sheet-update-api.test.ts` > Note: Broader TypeScript checks and Jest test runs are still subject to the repository's Node/Rush version constraints and should be executed in an environment that satisfies `nodeSupportedVersionRange` in `rush.json`. Co-Authored-By: Aime <aime@bytedance.com> Change-Id: I58e98d79364d20a9b1e48bedc2c7ac0e87a1c947
Aime/1769517639 sheet update api
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough