fix: autofocus composer prompt and make "Use" open composer directly
- Add native autoFocus on the prompt textarea so opening the composer (full page or Cmd+J modal) lands the cursor in the prompt field instead of the workspace-name input that renders above it. - Make the "Use" pill in each GitHub work-item row a real button that opens the composer modal directly, skipping the read-only drawer. Clicking anywhere else on the row still opens the drawer preview.
This commit is contained in:
@@ -160,6 +160,13 @@ function PromptPrefixTextarea({
|
||||
</span>
|
||||
<textarea
|
||||
ref={setRefs}
|
||||
// Why: native autoFocus reliably focuses the prompt on initial mount
|
||||
// — used by both the full-page composer and the Cmd+J modal so the
|
||||
// user can start typing immediately without an extra tab. Running
|
||||
// during React's mount means it beats Radix Dialog's FocusScope,
|
||||
// which would otherwise land focus on the first focusable child
|
||||
// (the "Workspace name" input that renders above this textarea).
|
||||
autoFocus
|
||||
value={value}
|
||||
onChange={(event) => onChange(event.target.value)}
|
||||
onKeyDown={onKeyDown}
|
||||
|
||||
@@ -702,10 +702,22 @@ export default function NewWorkspacePage(): React.JSX.Element {
|
||||
</Tooltip>
|
||||
|
||||
<div className="flex items-center justify-start gap-1 lg:justify-end">
|
||||
<span className="inline-flex items-center gap-1 rounded-xl border border-border/50 bg-background/50 backdrop-blur-md px-3 py-1.5 text-sm text-foreground supports-[backdrop-filter]:bg-background/50">
|
||||
{/* Why: "Use" is the primary CTA — it should open
|
||||
the composer directly, skipping the read-only
|
||||
drawer that the row-click opens for previewing.
|
||||
Stop propagation so the row-level button that
|
||||
owns this grid doesn't also toggle the drawer. */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
handleSelectWorkItem(item)
|
||||
}}
|
||||
className="inline-flex items-center gap-1 rounded-xl border border-border/50 bg-background/50 backdrop-blur-md px-3 py-1.5 text-sm text-foreground transition hover:bg-muted/60 supports-[backdrop-filter]:bg-background/50"
|
||||
>
|
||||
Use
|
||||
<ArrowRight className="size-4" />
|
||||
</span>
|
||||
</button>
|
||||
<DropdownMenu modal={false}>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user