Skip to content

feat(channels): starter prompt suggestions on the new-task screen#2789

Merged
raquelmsmith merged 4 commits into
mainfrom
posthog-code/channel-task-suggestions
Jun 20, 2026
Merged

feat(channels): starter prompt suggestions on the new-task screen#2789
raquelmsmith merged 4 commits into
mainfrom
posthog-code/channel-task-suggestions

Conversation

@raquelmsmith

@raquelmsmith raquelmsmith commented Jun 19, 2026

Copy link
Copy Markdown
Member

What

image

Adds a 2×4 grid of starter-prompt cards below the input on the project-bluebird channels new-task screen. Channels-only — the /code new-task screen is unchanged.

Each card mirrors the existing 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 the user completes before sending, e.g.:

Help me debug an issue a specific user is hitting. ...

User input:
- Describe the user issue:
- User identifier (distinct ID, email address, etc):

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

  • New CHANNEL_TASK_SUGGESTIONS data + SuggestedPromptCard component.
  • TaskInput gets an optional suggestions prop, wired only at the two channels render sites (/website/new, WebsiteNewTask). It renders the channel suggestions or SuggestedTasksPanel, never both — so the codebase-discovery / SDK-health cards don't appear on channels.
  • The centered input block is raised (top: 50% → 38%) when suggestions are present so the longer list isn't squished; extra gap above the suggestions.
  • Cards fill the composer via setPendingContent (the same path initialPrompt uses) so the multi-line template keeps its line breaks — setContent parses the string as HTML and would collapse them.

Also fixes

A pre-existing draft bug on the channels path: editor.clear() ran after onTaskCreated navigated 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/web typecheck 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

  • Enable project-bluebird, open Channels → new task (/website/new and /website/$channelId/new): 8 cards render in a 2×4 grid below the input.
  • Clicking a card fills the composer with the template (line breaks intact, User input: block present) and the cards hide.
  • Type a prompt, start the task, open a new task again → input is empty (no stale draft).
  • /code new-task screen is unchanged (still shows discovery suggestions, no cards).

Created with PostHog Code

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
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 58595d6.

@raquelmsmith raquelmsmith requested a review from adamleithp June 19, 2026 22:00
@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix 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%",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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
@raquelmsmith raquelmsmith merged commit 261fa3f into main Jun 20, 2026
23 checks passed
@raquelmsmith raquelmsmith deleted the posthog-code/channel-task-suggestions branch June 20, 2026 00:38
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