Enable iterative chart modifications via conversation history#12
Enable iterative chart modifications via conversation history#12
Conversation
Co-authored-by: evcatalyst <8740078+evcatalyst@users.noreply.github.com>
Co-authored-by: evcatalyst <8740078+evcatalyst@users.noreply.github.com>
…ogging Co-authored-by: evcatalyst <8740078+evcatalyst@users.noreply.github.com>
Co-authored-by: evcatalyst <8740078+evcatalyst@users.noreply.github.com>
|
@copilot Addendum: Vanilla static + browser-local requirements (paste into Update) Vanilla static site only: No React / Vue / Svelte / Next. Prefer zero build step (plain HTML/CSS/JS). Use ES modules (type="module") and keep dependencies minimal. If any dependencies are used, they must be either: vendored into /vendor/ in the repo, or loaded via stable CDNs with pinned versions. Local-first: App must work fully in-browser, including dataset storage and layout state. Persist state using: IndexedDB for datasets / large blobs (CSV, parsed tables, cached samples) localStorage for lightweight settings (UI prefs, selected model, sampling preset, last layout) Optional: Service worker for offline + caching static assets (no server required). UI implementation approach Use native Web Components (Custom Elements) for modularity instead of framework components: , , , , , etc. Keep styling with CSS variables + shadow DOM where useful (or light DOM if easier to theme globally). Use a vanilla-compatible grid/drag/resize library (pick one and justify): Grid/tile system candidates (must be framework-agnostic): Gridstack.js (drag + resize dashboard tiles, widely used) Muuri (great for draggable grids; pair with resize handling if needed) Interact.js (low-level drag/resize; build custom grid behavior if needed) Use a vanilla splitter for resizable chat drawer: Split.js (simple resizable panes) or equivalent. Chat drawer requirements (vanilla) Chat is a toggleable, resizable side drawer: Drawer open/close state persisted in localStorage Drawer width persisted Keyboard accessible (Esc closes, focus trap while open optional) Chat messages can create/update tiles in the grid: “Spawn chart tile”, “Spawn text tile”, “Update tile #n” Natural language settings UI (vanilla) Implement “natural language form” style controls as a lightweight custom element: Inline sentence with editable tokens/selects Styling inspired by Tympanus NaturalLanguageForm interaction pattern, but implemented without heavy dependencies. Sampling control should be an LED/retro segmented UI: Presets: 1%, 5%, 10%, 20%, 50%, 100% Shows estimated token impact and warning states Persist preset + last custom value in localStorage Deliverables expected (vanilla-specific) Provide: Folder structure for a static site (/components, /styles, /vendor, /data, etc.) State model for IndexedDB/localStorage (schema + keys) Recommended grid library choice + rationale for vanilla use Migration plan from current layout to the new workbench without rewriting the core ChartSpec engine |
Users cannot iterate on charts with follow-up requests like "update the revenue axis to start at 4k" because the LLM receives no conversation context—each request is processed in isolation.
Changes
llmRouter.js
chatHistoryparameter togetUpdatedChartSpec()to pass full conversation context to LLMcurrentSpecwhen history unavailable (backward compatible)main.js
state.chatHistorytogetUpdatedChartSpec()Example Flow
The implementation handles edge cases (null values, arrays, circular references) and maintains the existing chat history structure in
state.chatHistory.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.