@@ -3,13 +3,12 @@ import { composerDraftHasUserContent, useComposerDraftStore } from "~/composerDr
33import { resolveEnvironmentMachineKind , type ScopedProjectRef } from "@t3tools/contracts" ;
44import { scopedProjectKey , scopeProjectRef } from "@t3tools/client-runtime/environment" ;
55import { isScratchProject } from "@t3tools/client-runtime/state/projects" ;
6- import { FolderPlusIcon , MessageSquareDashedIcon } from "lucide-react" ;
6+ import { FolderPlusIcon } from "lucide-react" ;
77import { useAtomValue } from "@effect/atom-react" ;
88import { useCallback , useEffect , useMemo , useRef , useState } from "react" ;
99
1010import { openCommandPalette } from "~/commandPaletteBus" ;
1111import { shortcutLabelForCommand } from "~/keybindings" ;
12- import { projectIconColorClassName } from "~/projectIconColors" ;
1312import { primaryServerKeybindingsAtom } from "~/state/server" ;
1413import { useNewThreadHandler } from "~/hooks/useHandleNewThread" ;
1514import { useScratchProject } from "~/hooks/useScratchProject" ;
@@ -43,9 +42,8 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
4342import { InlineButton } from "../ui/button" ;
4443import { resolveProjectSettings } from "@t3tools/shared/projectSettings" ;
4544
46- // Picker values for the non- project rows ; real entries are keyed by logical
45+ // Picker value for the "Add project" row ; real entries are keyed by logical
4746// project key.
48- const NO_PROJECT_VALUE = "no-project" ;
4947const ADD_PROJECT_VALUE = "add-project" ;
5048
5149interface PickerItem {
@@ -155,8 +153,8 @@ export function DraftHeroHeadline({
155153 const hasResolvedProject = activeProjectTitle !== null ;
156154 const canChooseProject = projectPickerEntries . length > 0 ;
157155 const shouldShowProjectMenu = canChooseProject ;
158- // The project that hosts threads without a project appears once, as the
159- // "No project" item, not as a project row .
156+ // The project that hosts threads without a project is not a row: the line
157+ // under the headline is the way into it .
160158 const menuEntries = useMemo (
161159 ( ) =>
162160 projectPickerEntries . filter (
@@ -185,11 +183,10 @@ export function DraftHeroHeadline({
185183 // a project, so it only trails the unfiltered list.
186184 const pickerItems = useMemo < readonly PickerItem [ ] > (
187185 ( ) => [
188- ...( scratchWorkspaceRoot === null ? [ ] : [ { value : NO_PROJECT_VALUE , label : "No project" } ] ) ,
189186 ...menuEntries . map ( ( { group } ) => ( { value : group . projectKey , label : group . displayName } ) ) ,
190187 { value : ADD_PROJECT_VALUE , label : "Add project" } ,
191188 ] ,
192- [ menuEntries , scratchWorkspaceRoot ] ,
189+ [ menuEntries ] ,
193190 ) ;
194191 const [ pickerOpen , setPickerOpen ] = useState ( false ) ;
195192 const [ pickerQuery , setPickerQuery ] = useState ( "" ) ;
@@ -203,8 +200,7 @@ export function DraftHeroHeadline({
203200 pickerFilter . contains ( item , query , ( candidate ) => candidate . label ) ,
204201 ) ;
205202 } , [ pickerFilter , pickerItems , pickerQuery ] ) ;
206- const selectedPickerValue = isScratchDraft ? NO_PROJECT_VALUE : activeProjectKey ;
207- const selectedPickerItem = pickerItems . find ( ( item ) => item . value === selectedPickerValue ) ?? null ;
203+ const selectedPickerItem = pickerItems . find ( ( item ) => item . value === activeProjectKey ) ?? null ;
208204
209205 // The picker can change the draft's target while the no-project home is
210206 // still being opened; a stale continuation must not retarget it again.
@@ -291,10 +287,6 @@ export function DraftHeroHeadline({
291287 openAddProject ( ) ;
292288 return ;
293289 }
294- if ( item . value === NO_PROJECT_VALUE ) {
295- void startScratch ( ) ;
296- return ;
297- }
298290 const entry = projectEntryByKey . get ( item . value ) ;
299291 if ( ! entry || item . value === activeProjectKey ) {
300292 return ;
@@ -339,14 +331,6 @@ export function DraftHeroHeadline({
339331 < ComboboxItem key = { item . value } hideIndicator value = { item } >
340332 { item . value === ADD_PROJECT_VALUE ? (
341333 < FolderPlusIcon className = "size-4 shrink-0" />
342- ) : item . value === NO_PROJECT_VALUE ? (
343- // Boxed like ProjectFavicon so the label lines up with project rows.
344- < span
345- aria-hidden = "true"
346- className = { `inline-flex size-4 shrink-0 ${ projectIconColorClassName ( "gray" ) } ` }
347- >
348- < MessageSquareDashedIcon className = "size-full" />
349- </ span >
350334 ) : entry ? (
351335 < ProjectFavicon project = { entry . group } className = "size-4 shrink-0" />
352336 ) : null }
0 commit comments