Skip to content

Conversation

@fangsmile
Copy link
Contributor

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Site / documentation update
  • Demo update
  • Workflow
  • Chore
  • Release
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

liufangfang.jane and others added 3 commits January 27, 2026 20:41
# 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
@github-actions github-actions bot added the test label Jan 28, 2026
@fangsmile fangsmile changed the base branch from develop to feat/sheet-update-api January 28, 2026 02:58
@fangsmile fangsmile merged commit 8811b8a into VisActor:feat/sheet-update-api Jan 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant