g1t/apps/web/app/components/ask-composer.tsx
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 1 | import { ArrowUp, AtSign, BookMarked, ChevronDown, MessageSquare, Plus, Sparkles } from "lucide-react"; |
| 2 | import type { ReactNode } from "react"; | |
| 3 | ||
| 4 | import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip"; | |
| 5 | ||
| 6 | /** | |
| 7 | * Mission control's place to ask g1t for anything: a question, a plan it | |
| 8 | * splits into issues for agents, or work started straight away. Shown so | |
| 9 | * it is clear where this will be, and not usable yet: nothing here sends, | |
| 10 | * and every control says so. Until then the actions under it do the work. | |
| 11 | */ | |
| 12 | export function AskComposer({ children }: { children?: ReactNode }) { | |
| 13 | return ( | |
| Previews build from any branch; Agent in place of Ask AI; pin from the sidebar | 14 | <section aria-label="Agent" className="space-y-3"> |
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 15 | <div aria-disabled="true" className="rounded-xl border border-line bg-surface opacity-80"> |
| Previews build from any branch; Agent in place of Ask AI; pin from the sidebar | 16 | <p className="flex items-center gap-2 px-4 pt-3 text-sm font-medium text-fg"> |
| Merge branch 'worktree-agent-ad7c6d88d93adc817' | 17 | <Sparkles size={14} className="text-accent" aria-hidden="true" /> |
| Previews build from any branch; Agent in place of Ask AI; pin from the sidebar | 18 | Agent |
| 19 | <span className="rounded-full border border-line px-1.5 text-[0.6875rem] font-normal text-muted">Coming later</span> | |
| 20 | </p> | |
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 21 | <label htmlFor="ask-g1t" className="sr-only"> |
| Previews build from any branch; Agent in place of Ask AI; pin from the sidebar | 22 | Ask the agent (coming later) |
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 23 | </label> |
| 24 | <textarea | |
| 25 | id="ask-g1t" | |
| 26 | disabled | |
| 27 | rows={2} | |
| 28 | placeholder="Ask anything, plan something out, or describe work to start. Type @ to add context." | |
| 29 | className="block w-full cursor-not-allowed resize-none bg-transparent px-4 pt-3.5 pb-2 text-sm text-fg placeholder:text-muted focus:outline-none" | |
| 30 | /> | |
| 31 | <div className="flex flex-wrap items-center gap-2 px-3 pb-3"> | |
| 32 | <Soon label="Mode"> | |
| 33 | <MessageSquare size={14} /> Ask <ChevronDown size={13} className="text-faint" /> | |
| 34 | </Soon> | |
| 35 | <Soon label="Scope"> | |
| 36 | <BookMarked size={14} /> All repositories <ChevronDown size={13} className="text-faint" /> | |
| 37 | </Soon> | |
| 38 | <Soon label="Add context" icon> | |
| 39 | <Plus size={15} /> | |
| 40 | </Soon> | |
| 41 | <Soon label="Mention" icon> | |
| 42 | <AtSign size={14} /> | |
| 43 | </Soon> | |
| Previews build from any branch; Agent in place of Ask AI; pin from the sidebar | 44 | <span className="ml-auto" /> |
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 45 | <Soon label="Send" icon> |
| 46 | <ArrowUp size={15} /> | |
| 47 | </Soon> | |
| 48 | </div> | |
| 49 | </div> | |
| 50 | {children && <div className="flex flex-wrap items-center gap-2">{children}</div>} | |
| 51 | </section> | |
| 52 | ); | |
| 53 | } | |
| 54 | ||
| 55 | /** One of the composer's controls: there, disabled, with a tooltip saying why. */ | |
| 56 | function Soon({ label, icon, children }: { label: string; icon?: boolean; children: ReactNode }) { | |
| 57 | return ( | |
| 58 | <Tooltip> | |
| 59 | <TooltipTrigger asChild> | |
| 60 | <span tabIndex={0} className="inline-flex rounded-md outline-none focus-visible:ring-2 focus-visible:ring-accent"> | |
| 61 | <button | |
| 62 | type="button" | |
| 63 | disabled | |
| 64 | aria-label={`${label} (coming later)`} | |
| 65 | className={`pointer-events-none inline-flex h-8 items-center gap-1.5 rounded-md border border-line text-sm text-muted ${icon ? "w-8 justify-center" : "px-2.5"}`} | |
| 66 | > | |
| 67 | {children} | |
| 68 | </button> | |
| 69 | </span> | |
| 70 | </TooltipTrigger> | |
| Previews build from any branch; Agent in place of Ask AI; pin from the sidebar | 71 | <TooltipContent>Agent is coming later</TooltipContent> |
| Mission control: a place to ask g1t, shown and not on yet, with the actions under it | 72 | </Tooltip> |
| 73 | ); | |
| 74 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.