• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive-studio / 24716472404
70%

Build:
DEFAULT BRANCH: main
Ran 21 Apr 2026 10:09AM UTC
Jobs 1
Files 467
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Apr 2026 10:05AM UTC coverage: 65.909% (+0.1%) from 65.778%
24716472404

push

github

web-flow
feat(playground): persist composer drafts per thread across route changes (#2048)

* feat(playground): add useThreadDraft hook for per-thread composer drafts

Adds a small hook that persists the Playground composer text to localStorage under toolhive.playground.draft.<threadId>, plus a clearThreadDraft helper for external cleanup.

The hook expects the consuming component to be keyed by threadId, so a thread switch remounts and the lazy useState initializer re-reads the stored draft — no useEffect needed. Writes go through a useCallback that removes the key when the draft is cleared to empty.

Tests cover empty-state, existing-draft load, persist-on-update, clear-on-empty, undefined-threadId fallback, remount-with-different-threadId, and clearThreadDraft behavior.

* feat(playground): persist composer drafts across route and thread changes

The Playground composer text lived only in component state, so navigating away from /playground/chat/$threadId (or switching thread) discarded any unsent draft. This wires ChatInputPrompt to the useThreadDraft hook so drafts survive both.

- Add a threadId prop to ChatInputPrompt and replace useState('') with useThreadDraft(threadId)

- Key both ChatInputPrompt instances by threadId in ChatInterface so a thread switch remounts the composer — the lazy initializer re-reads the right draft, and as a bonus the internal PromptInput attachments reset too (previously they bled across threads)

- Call clearThreadDraft inside handleDeleteThread so removing a thread doesn't leave an orphan localStorage key

* refactor: adjust types

* fix(playground): keep draft and current thread when delete fails

deleteThread previously returned null both when the IPC call failed and when the last thread was successfully deleted, so callers could not distinguish the two. The route's delete handler treated any null as success and unconditionally wiped the stored draft via clearThreadDraft, even when the thread still existed.

- Change dele... (continued)

3743 of 6183 branches covered (60.54%)

40 of 43 new or added lines in 4 files covered. (93.02%)

5860 of 8891 relevant lines covered (65.91%)

119.38 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
0.0
0.0% renderer/src/features/chat/components/chat-input-prompt.tsx
1
88.51
0.0% renderer/src/features/chat/hooks/use-playground-threads.ts
1
97.06
renderer/src/features/chat/hooks/use-thread-draft.ts
Jobs
ID Job ID Ran Files Coverage
1 24716472404.1 21 Apr 2026 10:09AM UTC 467
65.91
GitHub Action Run
Source Files on build 24716472404
  • Tree
  • List 467
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #24716472404
  • 4ba9d587 on github
  • Prev Build on main (#24716287781)
  • Next Build on main (#24717388327)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc