Skip to content

refactor: extract composables from UI for testability#36

Merged
rprabhat merged 4 commits intomainfrom
shelled-rubidium
Apr 7, 2026
Merged

refactor: extract composables from UI for testability#36
rprabhat merged 4 commits intomainfrom
shelled-rubidium

Conversation

@rprabhat
Copy link
Copy Markdown
Collaborator

@rprabhat rprabhat commented Apr 7, 2026

Refactor 3 UI components to enable testing:

Changes

  • Extract useCodeMirror from SensibleQLEditor (CodeMirror wrapper)
  • Extract useGraphData + useForceSimulation from GraphView
  • Extract useAppInit + useKeyboardShortcuts from App
  • Extract useReportGenerator from ReportView
  • Add 21 new tests for composables

New Composables (src/lib/)

  • useCodeMirror.ts - CodeMirror editor wrapper
  • useGraph.ts - Graph data + force simulation
  • useReportGenerator.ts - Report generation logic
  • useAppInit.ts - App initialization + keyboard shortcuts

Test Results

  • 297 tests passing
  • lib/ coverage: 67% (up from ~40%)
  • Overall: 41% (up from 39%)

This enables testing of business logic separated from UI rendering.

rprabhat added 3 commits April 7, 2026 10:03
- Add Ollama client for on-device LLM inference (qwen2.5-coder, nomic-embed-text)
- Add NL-to-SQL translation for natural language queries
- Add document ingestion pipeline (CSV/MD/JSON/TXT chunking)
- Add ModelSettings component for model management
- Add 263 Vitest tests with 46% coverage (app, api, nl-to-sensibleql, components)
- Fix jsdom ESM compatibility by switching to happy-dom
- Extract useCodeMirror from SensibleQLEditor (CodeMirror wrapper)
- Extract useGraphData + useForceSimulation from GraphView
- Extract useAppInit + useKeyboardShortcuts from App
- Extract useReportGenerator from ReportView
- Add tests for all new composables

297 tests passing, 41% coverage, lib/ now at 67%
@rprabhat rprabhat enabled auto-merge (squash) April 7, 2026 04:04
@rprabhat rprabhat merged commit b805288 into main Apr 7, 2026
7 of 8 checks passed
@rprabhat rprabhat deleted the shelled-rubidium branch April 7, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant