- ${renderWelcomeHero({
- assistantName: identity?.name ?? agent?.name ?? agent?.id ?? "",
- assistantAvatar: identity?.avatar ?? identity?.emoji ?? null,
- assistantAvatarUrl: identity?.avatarUrl ?? null,
- hint: t("newSession.hint"),
- })}
+
+ ${this.renderTargetBar()} ${this.renderBrowser()}
+ ${worktreeNameInvalid
+ ? html`
${t("newSession.worktreeNameInvalid")}
`
+ : nothing}
+ ${this.error ? html`
${this.error}
` : nothing}
+ ${this.renderComposer()}
`;
}
- /** Recent chats to jump back into, or the canned starters when none exist. */
- private renderRecents() {
+ /** Same welcome block as the empty-chat start screen, keyed to the draft's agent. */
+ private renderWelcome() {
+ const agent = this.selectedAgent();
+ const identity = agent?.identity;
const gateway = this.context?.gateway.snapshot;
- const recents = selectWelcomeRecentSessions({
+ return renderWelcomeState({
+ assistantName: identity?.name ?? agent?.name ?? agent?.id ?? "",
+ assistantAvatar: identity?.avatar ?? identity?.emoji ?? null,
+ assistantAvatarUrl: identity?.avatarUrl ?? null,
+ hint: t("newSession.hint"),
+ composer: this.renderDraftBlock(),
sessions: this.context?.sessions.state.result,
sessionKey: buildAgentMainSessionKey({
agentId: this.agentId || "main",
@@ -741,37 +746,22 @@ class NewSessionPage extends OpenClawLightDomElement {
agentsList: this.context?.agents.state.agentsList ?? null,
hello: gateway?.hello ?? null,
},
- });
- if (recents.length > 0) {
- return renderWelcomeRecentSessions(recents, (sessionKey) => {
- this.context?.gateway.setSessionKey(sessionKey);
- this.context?.navigate("chat", { search: searchForSession(sessionKey) });
- });
- }
- return renderWelcomeSuggestions({
onDraftChange: (next) => {
this.message = next;
},
onSend: () => void this.submit(),
+ onOpenSession: (sessionKey) => {
+ this.context?.gateway.setSessionKey(sessionKey);
+ this.context?.navigate("chat", { search: searchForSession(sessionKey) });
+ },
});
}
override render() {
- const worktreeNameInvalid =
- this.worktree &&
- this.worktreeName.trim() !== "" &&
- !WORKTREE_NAME_PATTERN.test(this.worktreeName.trim());
return html`
-
- ${this.renderHero()} ${this.renderTargetBar()} ${this.renderBrowser()}
- ${worktreeNameInvalid
- ? html`
- ${t("newSession.worktreeNameInvalid")}
-
`
- : nothing}
- ${this.error ? html`
${this.error}
` : nothing}
- ${this.renderComposer()} ${this.renderRecents()}
+
+ ${this.renderWelcome()}
`;
@@ -801,7 +791,7 @@ class NewSessionPage extends OpenClawLightDomElement {