-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: draft hero landing on the index route #4055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
juliusmarminge
merged 14 commits into
pingdotgg:main
from
TrogonStack:yordis/feat-draft-hero-landing-upstream
Jul 18, 2026
Merged
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7b7119e
feat: draft hero landing on the index route
yordis d91b635
fix(web): make the index auto-draft wait for shell bootstrap and reco…
yordis 3609691
fix(web): treat an unloaded environment catalog as not bootstrapped
yordis e69bab6
fix(web): keep disconnected environments from blocking the index landing
yordis 17fbd15
fix(web): keep retrying environments gating the landing through their…
yordis e0fc27c
Merge branch 'main' into yordis/feat-draft-hero-landing-upstream
juliusmarminge a07c32d
Animate draft hero handoff before navigating to thread
juliusmarminge 9274d0f
Polish draft hero landing and mobile composer transition
juliusmarminge dc4b6e5
Merge branch 'main' into yordis/feat-draft-hero-landing-upstream
juliusmarminge fd9ea31
Fix draft hero transition review issues
juliusmarminge 7158599
fix(web): show the live server thread while the draft route is still …
yordis a64789e
fix(web): keep failed draft send errors visible after thread promotion
yordis 8a58461
fix(web): let a pending draft error replace a stale promoted-thread e…
yordis 71bb907
fix(web): order local thread errors so the latest write survives prom…
yordis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| import type { ScopedProjectRef } from "@t3tools/contracts"; | ||
| import { scopedProjectKey, scopeProjectRef } from "@t3tools/client-runtime/environment"; | ||
| import { FolderPlusIcon } from "lucide-react"; | ||
| import { useMemo } from "react"; | ||
|
|
||
| import { useOpenAddProjectCommandPalette } from "~/commandPaletteContext"; | ||
| import { useNewThreadHandler } from "~/hooks/useHandleNewThread"; | ||
| import { useProjects, useThreadShells } from "~/state/entities"; | ||
| import { sortProjectsForSidebar } from "../Sidebar.logic"; | ||
| import { | ||
| Menu, | ||
| MenuItem, | ||
| MenuPopup, | ||
| MenuRadioGroup, | ||
| MenuRadioItem, | ||
| MenuSeparator, | ||
| MenuTrigger, | ||
| } from "../ui/menu"; | ||
|
|
||
| interface DraftHeroHeadlineProps { | ||
| readonly activeProjectRef: ScopedProjectRef | null; | ||
| readonly activeProjectTitle: string | null; | ||
| } | ||
|
|
||
| export function DraftHeroHeadline({ | ||
| activeProjectRef, | ||
| activeProjectTitle, | ||
| }: DraftHeroHeadlineProps) { | ||
| const projects = useProjects(); | ||
| const threads = useThreadShells(); | ||
| const handleNewThread = useNewThreadHandler(); | ||
| const openAddProject = useOpenAddProjectCommandPalette(); | ||
|
|
||
| const orderedProjects = useMemo( | ||
| () => sortProjectsForSidebar(projects, threads, "updated_at"), | ||
| [projects, threads], | ||
| ); | ||
| const projectByKey = useMemo( | ||
| () => | ||
| new Map( | ||
| orderedProjects.map( | ||
| (project) => | ||
| [ | ||
| scopedProjectKey(scopeProjectRef(project.environmentId, project.id)), | ||
| project, | ||
| ] as const, | ||
| ), | ||
| ), | ||
| [orderedProjects], | ||
| ); | ||
| const activeProjectKey = activeProjectRef === null ? "" : scopedProjectKey(activeProjectRef); | ||
| const hasResolvedProject = activeProjectTitle !== null; | ||
| const canChooseProject = orderedProjects.length > 0; | ||
| const shouldShowProjectMenu = canChooseProject; | ||
|
|
||
| const projectSelector = shouldShowProjectMenu ? ( | ||
| <Menu> | ||
| <MenuTrigger | ||
| aria-label={hasResolvedProject ? "Change project" : "Choose a project"} | ||
| className="pointer-events-auto inline cursor-pointer border-current border-b border-dotted text-foreground underline-offset-8 transition-opacity hover:opacity-75 focus-visible:rounded-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring" | ||
| > | ||
| {activeProjectTitle ?? "Choose a project"} | ||
| </MenuTrigger> | ||
| <MenuPopup align="center" className="max-h-80 w-64 overflow-y-auto"> | ||
| <MenuRadioGroup | ||
| value={activeProjectKey} | ||
| onValueChange={(value) => { | ||
| const project = projectByKey.get(value as string); | ||
| if (!project || value === activeProjectKey) { | ||
| return; | ||
| } | ||
| void handleNewThread(scopeProjectRef(project.environmentId, project.id), { | ||
| replace: true, | ||
| }); | ||
| }} | ||
| > | ||
| {orderedProjects.map((project) => { | ||
| const key = scopedProjectKey(scopeProjectRef(project.environmentId, project.id)); | ||
| return ( | ||
| <MenuRadioItem key={key} value={key} closeOnClick> | ||
| <span className="min-w-0 truncate">{project.title}</span> | ||
| </MenuRadioItem> | ||
| ); | ||
| })} | ||
| </MenuRadioGroup> | ||
| <MenuSeparator /> | ||
| <MenuItem onClick={openAddProject}> | ||
| <FolderPlusIcon /> | ||
| New project | ||
| </MenuItem> | ||
| </MenuPopup> | ||
| </Menu> | ||
| ) : ( | ||
| <span className="text-muted-foreground/60">{activeProjectTitle ?? "Add a project"}</span> | ||
| ); | ||
|
macroscopeapp[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| return ( | ||
| <h1 className="mx-auto w-full max-w-5xl text-center font-normal text-3xl text-foreground tracking-tight sm:text-5xl"> | ||
| {hasResolvedProject ? ( | ||
| <>What should we build in {projectSelector}?</> | ||
| ) : canChooseProject ? ( | ||
| <>{projectSelector} to start</> | ||
| ) : ( | ||
| <>Add a project to start</> | ||
| )} | ||
| </h1> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.