Pull uncommitted work: quick project thread button (worktree 27a5341b)
Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
e899698f2f
commit
6f5dd37c93
2 files changed
+30
No files matched your search
@@ -102,6 +102,16 @@ export default function HomeRouteScreen() {
|
||||
onAddConnection={() => router.push("/connections/new")}
|
||||
onArchiveThread={archiveThread}
|
||||
onDeleteThread={confirmDeleteThread}
|
||||
onNewThreadInProject={(project) => {
|
||||
router.push({
|
||||
pathname: "/new/draft",
|
||||
params: {
|
||||
environmentId: project.environmentId,
|
||||
projectId: project.id,
|
||||
title: project.title,
|
||||
},
|
||||
});
|
||||
}}
|
||||
onOpenEnvironments={() => router.push("/settings/environments")}
|
||||
onSelectThread={(thread) => {
|
||||
router.push(buildThreadRoutePath(thread));
|
||||
|
||||
@@ -55,6 +55,7 @@ interface HomeScreenProps {
|
||||
readonly onSelectThread: (thread: EnvironmentThreadShell) => void;
|
||||
readonly onArchiveThread: (thread: EnvironmentThreadShell) => void;
|
||||
readonly onDeleteThread: (thread: EnvironmentThreadShell) => void;
|
||||
readonly onNewThreadInProject: (project: EnvironmentProject) => void;
|
||||
}
|
||||
|
||||
/* ─── Status indicator colors ────────────────────────────────────────── */
|
||||
@@ -174,8 +175,10 @@ function ProjectGroupLabel(props: {
|
||||
readonly totalThreadCount: number;
|
||||
readonly isExpanded: boolean;
|
||||
readonly onToggleExpand: () => void;
|
||||
readonly onNewThread: () => void;
|
||||
}) {
|
||||
const hiddenCount = props.totalThreadCount - COLLAPSED_THREAD_LIMIT;
|
||||
const iconMutedColor = useThemeColor("--color-icon-muted");
|
||||
|
||||
return (
|
||||
<View className="flex-row items-center gap-2.5 px-1 pb-2">
|
||||
@@ -193,6 +196,22 @@ function ProjectGroupLabel(props: {
|
||||
{props.title}
|
||||
</Text>
|
||||
|
||||
<Pressable
|
||||
accessibilityLabel={`Create new thread in ${props.title}`}
|
||||
accessibilityRole="button"
|
||||
hitSlop={8}
|
||||
onPress={props.onNewThread}
|
||||
style={({ pressed }) => ({ opacity: pressed ? 0.5 : 1 })}
|
||||
>
|
||||
<SymbolView
|
||||
name="square.and.pencil"
|
||||
size={15}
|
||||
tintColor={iconMutedColor}
|
||||
type="monochrome"
|
||||
weight="medium"
|
||||
/>
|
||||
</Pressable>
|
||||
|
||||
{hiddenCount > 0 ? (
|
||||
<Pressable onPress={props.onToggleExpand} hitSlop={8}>
|
||||
<Text
|
||||
@@ -563,6 +582,7 @@ export function HomeScreen(props: HomeScreenProps) {
|
||||
>
|
||||
<ProjectGroupLabel
|
||||
isExpanded={isExpanded}
|
||||
onNewThread={() => props.onNewThreadInProject(group.representative)}
|
||||
onToggleExpand={() => toggleExpanded(group.key)}
|
||||
project={group.representative}
|
||||
title={group.title}
|
||||
|
||||
Reference in new issue
Block a user