Add preferred Pi model settings and pickers #2211
Closedjlmcmich(GitHub profile, opens in a new tab)wants to merge 47 commits into
main fromrefs/pull/2211/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- @@ -59,3 +59,14 @@5959 });60606161 export const serverEnvironmentRouteLayer = HttpRouter.add(62+ "GET",63+ "/.well-known/workbench/environment",64+ Effect.gen(function* () {65+ const descriptor = yield* Effect.service(ServerEnvironment).pipe(66+ Effect.flatMap((serverEnvironment) => serverEnvironment.getDescriptor),67+ );68+ return HttpServerResponse.jsonUnsafe(descriptor, { status: 200 });69+ }),70+);71+72+export const legacyServerEnvironmentRouteLayer = HttpRouter.add(
jlmcmich(GitHub profile, opens in a new tab) closed this
- @@ -0,0 +94,21 @@94+95+ let current = root;96+ for (let index = 0; index < segments.length - 1; index += 1) {97+ const segment = segments[index]!;98+ const path = segments.slice(0, index + 1).join("/");99+ let next = current.directories.get(segment);100+ if (!next) {101+ next = {102+ kind: "directory",103+ name: segment,104+ path,105+ changed: false,106+ directories: new Map(),107+ files: [],108+ };109+ current.directories.set(segment, next);110+ }111+ current = next;112+ }113+114+ const changed = changedPaths.has(entry.path);@@ -57,2 +58,21 @@5758 const COMPOSER_PERSIST_DEBOUNCE_MS = 300;585960+const composerBaseStorage = (() => {61+ if (typeof localStorage === "undefined") return createMemoryStorage();62+ // back-compat read for migration; remove in next major.63+ return {64+ getItem: (name: string) => {65+ const fresh = localStorage.getItem(name);66+ if (fresh !== null) return fresh;67+ if (name === COMPOSER_DRAFT_STORAGE_KEY) {68+ return localStorage.getItem(LEGACY_COMPOSER_DRAFT_STORAGE_KEY);69+ }70+ return fresh;71+ },72+ setItem: (name: string, value: string) => {73+ localStorage.setItem(name, value);74+ },75+ removeItem: (name: string) => {76+ localStorage.removeItem(name);77+ },78+ };@@ -0,0 +26,21 @@26+ readonly args: ReadonlyArray<string>;27+}): Promise<PiCommandResult> {28+ const child = spawn(input.binaryPath, [...input.args], {29+ stdio: ["ignore", "pipe", "pipe"],30+ shell: process.platform === "win32",31+ env: process.env,32+ });33+34+ child.stdout?.setEncoding("utf8");35+ child.stderr?.setEncoding("utf8");36+37+ const stdoutChunks: Array<string> = [];38+ const stderrChunks: Array<string> = [];39+40+ child.stdout?.on("data", (chunk: string) => stdoutChunks.push(chunk));41+ child.stderr?.on("data", (chunk: string) => stderrChunks.push(chunk));42+43+ const code = await new Promise<number>((resolve, reject) => {44+ child.once("error", reject);45+ child.once("exit", (exitCode) => resolve(exitCode ?? 0));46+ });@@ -0,0 +418,21 @@418+ await vi.waitFor(() => {419+ expect(document.querySelector('button[title="Quick edit this file inline"]')).not.toBeNull();420+ });421+ });422+423+ it("clicking Quick edit reveals the textarea + Save and Cancel buttons", async () => {424+ mockReadFileResponse = {425+ contents: "# Original\n\nBefore the edit.",426+ relativePath: "some/file.md",427+ truncated: false,428+ };429+ await using _ = await mountRail({430+ workspaceRoot: "/Users/jlm/proj",431+ focusedPath: "/Users/jlm/proj/some/file.md",432+ });433+ await page.getByTitle("Quick edit this file inline").click();434+ await vi.waitFor(() => {435+ expect(page.getByLabelText("Edit file contents")).toBeDefined();436+ expect(document.body.textContent ?? "").toContain("Save");437+ expect(document.body.textContent ?? "").toContain("Cancel");438+ });@@ -4,0 +154,21 @@154+ }));155+ }156+157+ return [...providers].toSorted(158+ (left, right) => PROVIDER_MENU_ORDER[left.provider] - PROVIDER_MENU_ORDER[right.provider],159+ );160+}161+162+function LandingPillButton(props: React.ComponentProps<typeof Button>) {163+ return (164+ <Button165+ size="sm"166+ variant="ghost"167+ className={cn(168+ "h-10 rounded-full border border-border/60 bg-background/84 px-4 text-[15px] text-foreground shadow-[0_10px_30px_-24px_rgba(0,0,0,0.55)] backdrop-blur hover:bg-background/96",169+ props.className,170+ )}171+ {...props}172+ />173+ );174+}
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
c31ce3e0-d5ae-4074-8155-af0cd921ca7cYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share