Repository navigation
feat(web): add configurable "Review this PR" pull request action #9099
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
Changes from all commits
5fb60b8
3ab47b0
b02fa20
58a8bf4
c5c7da9
400dab8
b94b726
04dbd74
6f2f235
7fbae9d
87c83ca
13dfa7e
0298776
3e062f7
e6950d7
a4028d1
065f461
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { DEFAULT_UNIFIED_SETTINGS } from "@t3tools/contracts/settings"; | ||
|
|
||
| import { usePrimarySettings, useUpdatePrimarySettings } from "../../hooks/useSettings"; | ||
| import { Textarea } from "../ui/textarea"; | ||
| import { SettingResetButton, SettingsRow, SettingsSection } from "./settingsLayout"; | ||
| import { searchableSetting } from "./settingsSearch"; | ||
|
|
||
| export function PullRequestReviewSettingsSection() { | ||
| const settings = usePrimarySettings(); | ||
| const updateSettings = useUpdatePrimarySettings(); | ||
|
Comment on lines
+9
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Store the checklist in client settings. These hooks read and write the primary-environment settings. The review action reads Read and update 🤖 Prompt for AI Agents |
||
| const instructions = settings.pullRequestReviewInstructions; | ||
| const defaultInstructions = DEFAULT_UNIFIED_SETTINGS.pullRequestReviewInstructions; | ||
|
|
||
| return ( | ||
| <SettingsSection title="Pull requests"> | ||
| <SettingsRow | ||
| {...searchableSetting("pull-request-review-instructions")} | ||
| description='The checklist the "Review this PR" action hands the agent, alongside the pull request itself.' | ||
| resetAction={ | ||
| instructions !== defaultInstructions ? ( | ||
| <SettingResetButton | ||
| label="review checklist" | ||
| onClick={() => updateSettings({ pullRequestReviewInstructions: defaultInstructions })} | ||
| /> | ||
| ) : null | ||
| } | ||
| > | ||
| <div className="mt-3 max-w-2xl pb-3.5"> | ||
| <Textarea | ||
| key={instructions} | ||
| defaultValue={instructions} | ||
| onBlur={(event) => { | ||
| const next = event.target.value.trim(); | ||
| if (next !== instructions) { | ||
| updateSettings({ pullRequestReviewInstructions: next }); | ||
| } | ||
|
cursor[bot] marked this conversation as resolved.
Resolved
|
||
| }} | ||
|
macroscopeapp[bot] marked this conversation as resolved.
Resolved
|
||
| rows={4} | ||
| placeholder={defaultInstructions} | ||
| aria-label="Pull request review checklist" | ||
| /> | ||
| </div> | ||
| </SettingsRow> | ||
| </SettingsSection> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ import { useSettingsScope } from "./SettingsScopeContext"; | |||||
| import { ProjectDefaultsSettings } from "./ProjectDefaultsSettings"; | ||||||
| import { cn } from "../../lib/utils"; | ||||||
| import { useEnvironmentQuery } from "../../state/query"; | ||||||
| import { usePrimaryEnvironmentId } from "../../state/environments"; | ||||||
| import { sourceControlEnvironment } from "../../state/sourceControl"; | ||||||
| import { Badge } from "../ui/badge"; | ||||||
| import { Button } from "../ui/button"; | ||||||
|
|
@@ -56,6 +57,7 @@ import { | |||||
| JujutsuIcon, | ||||||
| type Icon, | ||||||
| } from "../Icons"; | ||||||
| import { PullRequestReviewSettingsSection } from "./PullRequestReviewSettings"; | ||||||
| import { BitbucketCredentialsSettings } from "./BitbucketCredentialsSettings"; | ||||||
| import { RedactedSensitiveText } from "./RedactedSensitiveText"; | ||||||
| import { SourceControlWritingSettingsSection } from "./SourceControlWritingSettings"; | ||||||
|
|
@@ -508,6 +510,8 @@ function EmptySourceControlDiscovery({ | |||||
|
|
||||||
| export function SourceControlSettingsPanel() { | ||||||
| const { scope, environment, connectedEnvironments } = useSettingsScope(); | ||||||
| const primaryEnvironmentId = usePrimaryEnvironmentId(); | ||||||
| const isPrimaryEnvironment = environment?.environmentId === primaryEnvironmentId; | ||||||
| // Discovery scans one machine's tools, so it shows the representative | ||||||
| // environment (named in the section title when several are selected); | ||||||
| // the settings rows above it fan out like everywhere else. | ||||||
|
|
@@ -618,6 +622,7 @@ export function SourceControlSettingsPanel() { | |||||
| )} | ||||||
|
|
||||||
| <SourceControlWritingSettingsSection /> | ||||||
| {isPrimaryEnvironment ? <PullRequestReviewSettingsSection /> : null} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggest rendering it unconditionally, and dropping
Suggested change
Posted via Macroscope — UI Consistency |
||||||
| </SettingsPageContainer> | ||||||
| ); | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Link the thread when it starts, not only during a 15-minute wait.
Line 890 ends the wait if the user edits the composer for more than 15 minutes before sending. The server thread then starts without
updateThreadMetadata, so it remains unlinked and loses pull-request-aware behavior. Trigger the link from the confirmed thread-start lifecycle, with cleanup when the draft is discarded.🤖 Prompt for AI Agents