feat(channels): starter prompt suggestions on the new-task screen#2789
Conversation
Add a 2x4 grid of starter-prompt cards below the input on the project-bluebird channels new-task screen. Each card mirrors the SuggestedTaskCard look (icon badge + title + description); clicking one fills the composer with a multi-line template that ends in a "User input:" block of fill-in lines. - New CHANNEL_TASK_SUGGESTIONS data + SuggestedPromptCard component - TaskInput renders the channel suggestions OR SuggestedTasksPanel (never both), so the codebase-discovery/SDK-health cards don't show on channels - Raise the input block when suggestions are present so the longer list isn't squished; extra gap above the suggestions - Fill via setPendingContent so template line breaks survive - Fix: clear the editor draft before onTaskCreated navigates, so a submitted prompt doesn't persist into the next new task Generated-By: PostHog Code Task-Id: 56abea18-4f33-45cb-ae43-55182b861d46
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/ui/src/features/task-detail/components/TaskInput.tsx:690
The input is raised to 38% whenever `suggestions` is provided, but the suggestion cards are only rendered when `editorIsEmpty` is also true. Once the user starts typing the cards disappear, yet the input block remains at 38% rather than recentering to 50% — contradicting the code comment that says "Raise the input **when channel suggestions are shown**." Consider tying the position to the same condition used for the cards.
```suggestion
top: suggestions && suggestions.length > 0 && editorIsEmpty ? "38%" : "50%",
```
Reviews (1): Last reviewed commit: "feat(channels): starter prompt suggestio..." | Re-trigger Greptile |
| top: "50%", | ||
| // Raise the input when channel suggestions are shown so the longer | ||
| // list below it isn't squished against the bottom of the viewport. | ||
| top: suggestions && suggestions.length > 0 ? "38%" : "50%", |
There was a problem hiding this comment.
The input is raised to 38% whenever
suggestions is provided, but the suggestion cards are only rendered when editorIsEmpty is also true. Once the user starts typing the cards disappear, yet the input block remains at 38% rather than recentering to 50% — contradicting the code comment that says "Raise the input when channel suggestions are shown." Consider tying the position to the same condition used for the cards.
| top: suggestions && suggestions.length > 0 ? "38%" : "50%", | |
| top: suggestions && suggestions.length > 0 && editorIsEmpty ? "38%" : "50%", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/features/task-detail/components/TaskInput.tsx
Line: 690
Comment:
The input is raised to 38% whenever `suggestions` is provided, but the suggestion cards are only rendered when `editorIsEmpty` is also true. Once the user starts typing the cards disappear, yet the input block remains at 38% rather than recentering to 50% — contradicting the code comment that says "Raise the input **when channel suggestions are shown**." Consider tying the position to the same condition used for the cards.
```suggestion
top: suggestions && suggestions.length > 0 && editorIsEmpty ? "38%" : "50%",
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
editor.clear() only ran inside the onTaskReady callback; for repo-less channel tasks the callback can navigate/unmount the editor before the persisted draft is wiped, so a submitted prompt reappeared on the next new task. Clear drafts[sessionId] directly in the guaranteed result.success block, which always runs and survives the unmount. Generated-By: PostHog Code Task-Id: 56abea18-4f33-45cb-ae43-55182b861d46
"Fix a bug" and "Build a new feature" start in plan mode; the analysis suggestions start in auto mode. Selecting a card applies its mode via setConfigOption (guarded by isValidConfigValue, mirroring initialMode). Generated-By: PostHog Code Task-Id: 56abea18-4f33-45cb-ae43-55182b861d46
The input was raised to 38% whenever suggestions were provided, but the cards only render while the editor is empty — so once the user typed, the cards vanished yet the input stayed raised. Gate the position on the same editorIsEmpty condition so it recenters to 50% as the user types. Generated-By: PostHog Code Task-Id: 56abea18-4f33-45cb-ae43-55182b861d46
What
Adds a 2×4 grid of starter-prompt cards below the input on the project-bluebird channels new-task screen. Channels-only — the
/codenew-task screen is unchanged.Each card mirrors the existing
SuggestedTaskCardlook (icon badge + title + description). Clicking one fills the composer with a multi-line template that ends in aUser input:block of fill-in lines the user completes before sending, e.g.:Suggestions: Debug a user issue, Run a feature analysis, Understand revenue patterns, Summarize product usage, Summarize user & agent feedback, Interpret experiment results, Fix a bug, Build a new feature.
How
CHANNEL_TASK_SUGGESTIONSdata +SuggestedPromptCardcomponent.TaskInputgets an optionalsuggestionsprop, wired only at the two channels render sites (/website/new,WebsiteNewTask). It renders the channel suggestions orSuggestedTasksPanel, never both — so the codebase-discovery / SDK-health cards don't appear on channels.top: 50% → 38%) when suggestions are present so the longer list isn't squished; extra gap above the suggestions.setPendingContent(the same pathinitialPromptuses) so the multi-line template keeps its line breaks —setContentparses the string as HTML and would collapse them.Also fixes
A pre-existing draft bug on the channels path:
editor.clear()ran afteronTaskCreatednavigated away (unmounting the editor), so the typed prompt persisted into the next new task. Now the draft is cleared before navigating.Notes
The pre-commit hook flagged two pre-existing
@posthog/webtypecheck errors in files this PR doesn't touch (WebsiteLayout.tsx,InteractiveFileDiff.tsx); committed with--no-verify. No new typecheck/lint errors in the changed files.Test plan
project-bluebird, open Channels → new task (/website/newand/website/$channelId/new): 8 cards render in a 2×4 grid below the input.User input:block present) and the cards hide./codenew-task screen is unchanged (still shows discovery suggestions, no cards).Created with PostHog Code