Skip to content

feat(canvas): add welcome greeting to channel home template#2875

Draft
raquelmsmith wants to merge 1 commit into
mainfrom
posthog-code/channel-home-welcome-greeting
Draft

feat(canvas): add welcome greeting to channel home template#2875
raquelmsmith wants to merge 1 commit into
mainfrom
posthog-code/channel-home-welcome-greeting

Conversation

@raquelmsmith

Copy link
Copy Markdown
Member

Problem

A project-bluebird channel's home page (a freeform canvas) jumped straight into the Canvases / Inbox / Tasks cards with no introductory copy, so a new channel didn't explain what the space is for or that the page itself is editable.

Why: Give new channels a friendlier, self-explanatory landing that tells people what Canvases and Tasks are for and hints that the home page is itself an editable canvas.

Changes

Added a welcome header to the seeded channel home template (buildHomeCanvasCode in packages/core/src/canvas/dashboardsService.ts), rendered above the existing cards:

  • Welcome to #channel-name. — the channel name is resolved at runtime from the baked-in channel id (reusing resolveChannelPath + lastSegment), so renames stay correct; falls back to "Welcome to your channel." before it resolves.
  • A line explaining the space: Canvases for dashboards & apps, Tasks for putting agents to work.
  • A muted hint that the page is itself a canvas — "just click edit…".

Colors use the existing theme CSS variables, so it follows light/dark.

Note: existing channels are not retroactively updated — the template only seeds new channels and re-applies on "Reset to default".

How did you test this?

  • pnpm --filter @posthog/core test dashboardsService → 9/9 pass.
  • biome lint / biome check on the changed file → clean.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Seed the channel home canvas with an intro header above the
Canvases / Inbox / Tasks cards: a "Welcome to #channel-name."
heading, a line explaining the space (Canvases for dashboards/apps,
Tasks for agents), and a hint that the page is itself an editable
canvas. The channel name is resolved at runtime from the channel id
so renames stay correct.

Generated-By: PostHog Code
Task-Id: de6d1634-3f96-4c84-9916-a9ff49e4aa83
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 4134508.

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(canvas): add welcome greeting to ch..." | Re-trigger Greptile

Comment on lines +443 to +445
void resolveChannelPath().then((path) => {
if (alive && path) setName(lastSegment(path));
});

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.

P1 useChannelName uses void promise.then(...) without a .catch(), so if ph.query throws (e.g., the system table isn't yet available), a silent unhandled promise rejection fires. useChannelRows — the existing peer hook that calls the same resolveChannelPath — wraps the entire async block in a try/catch. The missing guard is inconsistent and can emit noise or trigger unhandledrejection listeners in the sandbox.

Suggested change
void resolveChannelPath().then((path) => {
if (alive && path) setName(lastSegment(path));
});
void resolveChannelPath().then((path) => {
if (alive && path) setName(lastSegment(path));
}).catch(() => {
// ph.query unavailable; name stays empty, showing the fallback.
});

Comment on lines +439 to +451
function useChannelName(): string {
const [name, setName] = useState("");
useEffect(() => {
let alive = true;
void resolveChannelPath().then((path) => {
if (alive && path) setName(lastSegment(path));
});
return () => {
alive = false;
};
}, []);
return name;
}

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 Redundant channel-path query on load

useChannelName issues its own resolveChannelPath() call independently of useChannelRows, so on page load the canvas fires three separate SELECT path FROM system.file_system WHERE id = ... queries: one from useChannelName, one from CanvasesSection, and one from TasksSection. Since useChannelRows already resolves the path and holds it in a pathRef, a shared singleton resolver (e.g., a module-level let resolvedPath: Promise<string> | null) would collapse these into a single round-trip.

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!

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