Fix draft table to show user message preview when title is blank #768
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.
What problem(s) was I solving?
Fixed ENG-2293 - Draft sessions in the table view showed empty cells when no title was set, making it impossible for users to identify their drafts.
The root cause was that draft sessions store prompt text in the
editorStatefield as TipTap JSON (rich editor format) rather than in thequeryfield. Thequeryfield only gets populated when a draft is launched, meaning unlaunch drafts always had an emptyqueryfield and would display as blank in the table.What user-facing changes did I ship?
The drafts table now shows content with this priority:
How I implemented it
Added text extraction utility (
humanlayer-wui/src/utils/formatting.ts)extractTextFromEditorState()function that parses TipTap JSON and extracts plaintextUpdated SessionTable display logic (
humanlayer-wui/src/components/internal/SessionTable.tsx)extractTextFromEditorStateto the import listThe implementation follows existing patterns in the codebase (similar to
getSessionNotificationText) and requires no backend changes since theeditorStatefield is already returned by the ListSessions API.How to verify it
Automated Testing
make -C humanlayer-wui checkmake -C humanlayer-wui lintmake -C humanlayer-wui testManual Testing
Test draft with prompt but no title:
Test existing behavior is preserved:
Test truncation:
Description for the changelog
Fixed draft sessions showing as blank in the drafts table when no title was set. The table now displays a preview of the draft's prompt text, making it easy to identify drafts at a glance.