GeezerVison is showing github.com — Merge branch 'main' into fix/web-question-answer-caret · pingdotgg/t3code@cac90ee
File treeExpand file treeCollapse file tree Open diff view settings thread_rollback_after_stop
provider-opencode/src/server source-control-bitbucket/src/server
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .coderabbit.config.ts +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { defineConfig, type CodeRabbitContext } from "@coderabbitai/config"; | 2 | 2 |
| 3 | | -// Org members and collaborators merge their own pull requests. On anyone else's, CodeRabbit | 4 | | -// requests changes until its comments are resolved, then approves. | | 3 | +// Org members and collaborators can approve their own pull requests. | 5 | 4 | const UNGATED_AUTHORS = new Set(["OWNER", "MEMBER", "COLLABORATOR"]); | 6 | 5 | const isGated = ({ pr }: CodeRabbitContext) => !UNGATED_AUTHORS.has(pr?.authorAssociation ?? ""); | 7 | 6 |
| 8 | 7 | export default defineConfig((ctx) => ({ | 9 | 8 | reviews: { | 10 | 9 | high_level_summary: false, | 11 | 10 | review_status: false, | 12 | | - request_changes_workflow: isGated(ctx), | | 11 | + request_changes_workflow: false, | 13 | 12 | allow_author_approval: !isGated(ctx), | 14 | 13 | auto_review: { | 15 | 14 | enabled: true, | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/cursor-hygiene-webhook.yml +20-6Lines changed: 20 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 28 | 28 | echo "Missing CURSOR_T3CODE_WEBHOOK_URL or CURSOR_T3CODE_WEBHOOK_AUTH — skipping." | 29 | 29 | exit 0 | 30 | 30 | fi | 31 | | - curl -fsS --max-time 60 -X POST "$URL" \ | 32 | | - -H "Authorization: $AUTH" \ | 33 | | - -H "Content-Type: application/json" \ | 34 | | - -H "X-GitHub-Event: ${{ github.event_name }}" \ | 35 | | - -H "X-GitHub-Delivery: ${{ github.run_id }}-${{ github.run_attempt }}" \ | 36 | | - --data-binary @"${{ github.event_path }}" | | 31 | + for attempt in 1 2 3; do | | 32 | + curl_status=0 | | 33 | + http_status=$(curl -fsS --max-time 60 -X POST "$URL" \ | | 34 | + --output /dev/null --write-out '%{http_code}' \ | | 35 | + -H "Authorization: $AUTH" \ | | 36 | + -H "Content-Type: application/json" \ | | 37 | + -H "X-GitHub-Event: ${{ github.event_name }}" \ | | 38 | + -H "X-GitHub-Delivery: ${{ github.run_id }}-${{ github.run_attempt }}" \ | | 39 | + --data-binary @"${{ github.event_path }}") || curl_status=$? | | 40 | + if [ "$curl_status" -eq 0 ]; then | | 41 | + exit 0 | | 42 | + fi | | 43 | + if [ "$GITHUB_REF" != "refs/heads/main" ] || \ | | 44 | + [ "$curl_status" -ne 22 ] || [ "$http_status" != "400" ] || \ | | 45 | + [ "$attempt" -eq 3 ]; then | | 46 | + exit "$curl_status" | | 47 | + fi | | 48 | + echo "Cursor webhook returned HTTP 400; retrying in 5 seconds ($attempt/2)." | | 49 | + sleep 5 | | 50 | + done |
Collapse file Copy file name to clipboardExpand all lines: apps/desktop/scripts/electron-launcher.mjs +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,7 @@ const APP_BUNDLE_ID = isDevelopment | 20 | 20 | ? `com.t3tools.t3code.dev.${devBundleIdSuffix || "local"}` | 21 | 21 | : "com.t3tools.t3code"; | 22 | 22 | const APP_PROTOCOL_SCHEMES = isDevelopment ? ["t3code-dev"] : ["t3code"]; | 23 | | -const LAUNCHER_VERSION = 19; | | 23 | +const LAUNCHER_VERSION = 20; | 24 | 24 | const developmentMacIconPngPath = NodePath.join( | 25 | 25 | repoRoot, | 26 | 26 | "assets", | @@ -280,6 +280,8 @@ function patchMainBundleInfoPlist(appBundlePath, iconPath, executableName) { | 280 | 280 | for (const [key, value] of Object.entries(resolveMacBundleInfoPlistStrings(executableName))) { | 281 | 281 | setPlistString(infoPlistPath, key, value); | 282 | 282 | } | | 283 | + // macOS 26 offers Messages/Mail codes in every text field unless opted out. | | 284 | + setPlistJson(infoPlistPath, "NSAutoFillRequiresTextContentTypeForOneTimeCodeOnMac", true); | 283 | 285 | setPlistJson(infoPlistPath, "CFBundleURLTypes", [ | 284 | 286 | { | 285 | 287 | CFBundleURLName: APP_BUNDLE_ID, | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -109,6 +109,7 @@ import { | 109 | 109 | import { PullRequestMergeControls } from "./PullRequestMergeControls"; | 110 | 110 | import { PullRequestStackCard } from "./PullRequestStackCard"; | 111 | 111 | import { usePullRequestStack, type PullRequestStackState } from "./usePullRequestStack"; | | 112 | +import { usePullRequestEnvironmentFallback } from "./usePullRequestEnvironmentFallback"; | 112 | 113 |
| 113 | 114 | const EMPTY_IDS: readonly string[] = []; | 114 | 115 |
| @@ -286,6 +287,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP | 286 | 287 | const insets = useSafeAreaInsets(); | 287 | 288 | const [toolbarHeight, setToolbarHeight] = usePullRequestToolbarHeight(insets.bottom); | 288 | 289 | const params = route.params; | | 290 | + usePullRequestEnvironmentFallback(params); | 289 | 291 | const connected = usePullRequestConnected(params.environmentId); | 290 | 292 | const [section, setSection] = useState<"overview" | "activity" | "guide">("overview"); | 291 | 293 | // Keep each tab's native list and measured rows alive when it is hidden. | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -142,6 +142,7 @@ export function PullRequestsScreen( | 142 | 142 | ); | 143 | 143 | const sidebar = props.sidebar === true || primaryColumn !== null; | 144 | 144 | const selectedKey = props.selectedPullRequestKey ?? primaryColumn?.selectedPullRequestKey; | | 145 | + const connectedKey = connectedTargets.map((target) => target.environmentId).join("\n"); | 145 | 146 | const entries = useMemo( | 146 | 147 | () => | 147 | 148 | filterPullRequestList( | @@ -150,8 +151,9 @@ export function PullRequestsScreen( | 150 | 151 | result.data?.viewers ?? {}, | 151 | 152 | query, | 152 | 153 | result.data.localSearchHosts, | | 154 | + new Set(connectedKey.split("\n")), | 153 | 155 | ), | 154 | | - [result.entries, controls, query, result.data], | | 156 | + [result.entries, controls, query, result.data, connectedKey], | 155 | 157 | ); | 156 | 158 | const facets = useMemo(() => pullRequestListFacets(result.entries), [result.entries]); | 157 | 159 | const [knownFacets, setKnownFacets] = useState({ environmentId, source: facets, ...facets }); | |
Collapse file Copy file name to clipboard +45Lines changed: 45 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { describe, expect, it } from "vite-plus/test"; | | 2 | +import type { EnvironmentProject } from "@t3tools/client-runtime/state/models"; | | 3 | +import { pullRequestFallbackEnvironment } from "./pullRequestEnvironmentFallback"; | | 4 | + | | 5 | +const project = (environmentId: string, id: string, canonicalKey: string) => | | 6 | + ({ | | 7 | + environmentId, | | 8 | + id, | | 9 | + repositoryIdentity: { canonicalKey }, | | 10 | + }) as unknown as EnvironmentProject; | | 11 | + | | 12 | +const projects = [ | | 13 | + project("laptop", "t3", "github.com/pingdotgg/t3code"), | | 14 | + project("desktop", "other", "github.com/pingdotgg/other"), | | 15 | + project("server", "t3-copy", "github.com/pingdotgg/t3code"), | | 16 | +]; | | 17 | +const target = { | | 18 | + environmentId: "laptop", | | 19 | + projectId: "t3", | | 20 | + repository: "pingdotgg/t3code", | | 21 | + host: "github.com", | | 22 | +}; | | 23 | + | | 24 | +describe("pullRequestFallbackEnvironment", () => { | | 25 | + it("moves to a connected copy of the repository when the original is down", () => { | | 26 | + expect( | | 27 | + pullRequestFallbackEnvironment(target, projects, new Set(["desktop", "server"])), | | 28 | + ).toEqual({ environmentId: "server", projectId: "t3-copy" }); | | 29 | + }); | | 30 | + | | 31 | + it("stays put while the original is connected or nothing else holds the repository", () => { | | 32 | + expect(pullRequestFallbackEnvironment(target, projects, new Set(["laptop", "server"]))).toBe( | | 33 | + null, | | 34 | + ); | | 35 | + expect(pullRequestFallbackEnvironment(target, projects, new Set(["desktop"]))).toBe(null); | | 36 | + }); | | 37 | + | | 38 | + it("derives the host from the original project when the route has none", () => { | | 39 | + const { host: _host, ...hostless } = target; | | 40 | + expect(pullRequestFallbackEnvironment(hostless, projects, new Set(["server"]))).toEqual({ | | 41 | + environmentId: "server", | | 42 | + projectId: "t3-copy", | | 43 | + }); | | 44 | + }); | | 45 | +}); |
Collapse file Copy file name to clipboard +33Lines changed: 33 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import type { EnvironmentProject } from "@t3tools/client-runtime/state/models"; | | 2 | + | | 3 | +export type PullRequestEnvironmentTarget = { | | 4 | + readonly environmentId: string; | | 5 | + readonly projectId: string; | | 6 | + readonly repository: string; | | 7 | + readonly host?: string; | | 8 | +}; | | 9 | + | | 10 | +/** | | 11 | + * Another connected environment holding the pull request's repository, for when the one it was | | 12 | + * opened in is unreachable. Null while the original is connected or no other copy exists. | | 13 | + */ | | 14 | +export function pullRequestFallbackEnvironment( | | 15 | + target: PullRequestEnvironmentTarget, | | 16 | + projects: ReadonlyArray<EnvironmentProject>, | | 17 | + connectedEnvironmentIds: ReadonlySet<string>, | | 18 | +) { | | 19 | + if (connectedEnvironmentIds.has(target.environmentId)) return null; | | 20 | + const own = projects.find( | | 21 | + (project) => project.environmentId === target.environmentId && project.id === target.projectId, | | 22 | + ); | | 23 | + const host = target.host ?? own?.repositoryIdentity?.canonicalKey.split("/")[0]; | | 24 | + if (!host) return null; | | 25 | + const key = `${host}/${target.repository}`.toLowerCase(); | | 26 | + const copy = projects.find( | | 27 | + (project) => | | 28 | + project.environmentId !== target.environmentId && | | 29 | + connectedEnvironmentIds.has(project.environmentId) && | | 30 | + project.repositoryIdentity?.canonicalKey.toLowerCase() === key, | | 31 | + ); | | 32 | + return copy ? { environmentId: String(copy.environmentId), projectId: String(copy.id) } : null; | | 33 | +} |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/pullRequestList.test.ts +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -333,6 +333,19 @@ describe("mobile PR scan and filters", () => { | 333 | 333 | ), | 334 | 334 | ).toHaveLength(0); | 335 | 335 | }); | | 336 | + it("lists a shared repository's row from a connected environment over an offline one", () => { | | 337 | + const rows = [ | | 338 | + { ...entry(1), environmentId: "laptop" }, | | 339 | + { ...entry(1), environmentId: "server" }, | | 340 | + ]; | | 341 | + const pick = (connected: ReadonlySet<string>) => | | 342 | + filterPullRequestList(rows, DEFAULT_PR_LIST_CONTROLS, {}, "", new Set(), connected).map( | | 343 | + (row) => row.environmentId, | | 344 | + ); | | 345 | + expect(pick(new Set(["server"]))).toEqual(["server"]); | | 346 | + expect(pick(new Set(["laptop", "server"]))).toEqual(["laptop"]); | | 347 | + expect(pick(new Set())).toEqual(["laptop"]); | | 348 | + }); | 336 | 349 | it("sorts loaded rows and builds unique author and label options", () => { | 337 | 350 | const rows = [ | 338 | 351 | entry(1, { labels: [{ name: "bug", color: null }] }), | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/pullRequestList.ts +8-2Lines changed: 8 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -171,6 +171,7 @@ export function filterPullRequestList< | 171 | 171 | viewers: PullRequestListResult["viewers"], | 172 | 172 | query: string, | 173 | 173 | localSearchHosts: ReadonlySet<string>, | | 174 | + connectedEnvironmentIds?: ReadonlySet<string>, | 174 | 175 | ) { | 175 | 176 | const normalize = (value: string) => value.toLowerCase(); | 176 | 177 | const words = query.toLowerCase().split(/\s+/).filter(Boolean); | @@ -210,11 +211,16 @@ export function filterPullRequestList< | 210 | 211 | } | 211 | 212 | return true; | 212 | 213 | }); | 213 | | - // The same repository can be available on multiple machines. Pick its first matching source. | | 214 | + // The same repository can be available on multiple machines. Pick its first matching source, | | 215 | + // unless that machine is unreachable and another one can answer: its rows may only be cached. | | 216 | + const reachable = (entry: Entry) => | | 217 | + !connectedEnvironmentIds || | | 218 | + (entry.environmentId !== undefined && connectedEnvironmentIds.has(entry.environmentId)); | 214 | 219 | const unique = new Map<string, Entry>(); | 215 | 220 | for (const entry of filtered) { | 216 | 221 | const key = pullRequestListKey(entry); | 217 | | - if (!unique.has(key)) unique.set(key, entry); | | 222 | + const held = unique.get(key); | | 223 | + if (!held || (!reachable(held) && reachable(entry))) unique.set(key, entry); | 218 | 224 | } | 219 | 225 | return [...unique.values()].sort((a, b) => | 220 | 226 | controls.sort === "created" | |
Collapse file Copy file name to clipboard +26Lines changed: 26 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { useNavigation } from "@react-navigation/native"; | | 2 | +import { useEffect, useMemo } from "react"; | | 3 | + | | 4 | +import { useProjects } from "../../state/entities"; | | 5 | +import { useWorkspaceEnvironments } from "../../state/workspace"; | | 6 | +import { | | 7 | + pullRequestFallbackEnvironment, | | 8 | + type PullRequestEnvironmentTarget, | | 9 | +} from "./pullRequestEnvironmentFallback"; | | 10 | + | | 11 | +/** Move a pull request route to a connected copy of its repository when its own is down. */ | | 12 | +export function usePullRequestEnvironmentFallback(params: PullRequestEnvironmentTarget) { | | 13 | + const navigation = useNavigation(); | | 14 | + const projects = useProjects(); | | 15 | + const connected = useWorkspaceEnvironments() | | 16 | + .filter((environment) => environment.connectionState === "connected") | | 17 | + .map((environment) => String(environment.environmentId)) | | 18 | + .join("\n"); | | 19 | + const fallback = useMemo( | | 20 | + () => pullRequestFallbackEnvironment(params, projects, new Set(connected.split("\n"))), | | 21 | + [params, projects, connected], | | 22 | + ); | | 23 | + useEffect(() => { | | 24 | + if (fallback) navigation.setParams(fallback); | | 25 | + }, [fallback, navigation]); | | 26 | +} |
|