feat(vue): TV-style drawing template system in floating style toolbar - #264
Closed
EliteOtaku wants to merge 2 commits into
Closed
EliteOtaku wants to merge 2 commits into
EliteOtaku wants to merge 2 commits into
Conversation
Selected-drawing floating toolbar gains a template dropdown (filtered by the current drawing kind) plus a 'save as template' dialog: - KLineChart accepts an optional drawingTemplateStore prop; a localStorage-backed default store is used when not injected, so the mechanism stays host-agnostic (hosts can route to their own backend) - apply merges the template style into the selected drawings (may add keys updateBatch would reject via its field-intersection guard) - save captures the primary selected drawing's style under a name Depends on the selection-timing fix so the toolbar actually appears right after finishing a drawing.
5 tasks done
Owner
|
因为之前其实已经实现了模板系统,因此我们改为在仓库已有的模板基础设施上实现绘图模板系统,因此关闭本 PR:
替代实现见 #269。 |
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
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.
feat(vue): TV-style drawing template system in floating style toolbar
Summary
Adds save/apply drawing templates to the floating style toolbar (the toolbar that appears when a drawing is selected): hosts can inject a template store, saved templates appear as a "模板" dropdown on the toolbar (per drawing kind), and applying one merges the stored style into the selected drawings. Includes a save dialog and a
useDrawingTemplatescomposable with pluggable storage.Complements the existing
DrawingSettingsDialogper-kind template persistence (unchanged) with a quick-apply flow directly on the selection toolbar — matching the TV-style floating-toolbar UX.Changes
DrawingStyleToolbar.vue: optionaltemplatesprop +applyTemplate/saveTemplateevents + a templateDropdown(rendered only when templates exist for the current kind); includes anapplyTemplateToSelected-compatible merge path and a save action routed to a new dialogDrawingTemplateSaveDialog.vue: name-input dialog for saving the selected drawing's style as a template (busy/error states included)useDrawingTemplates.ts: composable owning the template list per kind; storage is pluggable via aDrawingTemplateStoreprop (list/load/save/remove), with a built-in localStorage implementation when the host doesn't inject oneKLineChart.vue: wires the toolbar, dialog and composable together; templates are filtered by the current drawing kind and applied viaupdateDrawingon each selected drawingTest plan
pnpm --filter @363045841yyt/klinechart test— 29 files / 162 tests PASSpnpm type-check— 0 errorspnpm exec biome check packages/vue— 0 errorstemplates/drawingTemplateStoresee the toolbar unchangedNotes
upstream/main(includes feat(core): future time axis (TV-style free scrolling with trading-calendar extrapolation) #259 future time axis and the drawing magnet toolbar work)DrawingInteractionControlleralready resets the tool beforecreateDrawing(which atomically selects the new drawing), so the "keep newly created drawing selected" behavior this feature expects works out of the box on current main