GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(desktop): browser profiles for the preview browser by juliusmarminge · Pull Request #7254 · pingdotgg/t3code

feat(desktop): browser profiles for the preview browser #7254

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.

Sign up for GitHub

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

Merged
juliusmarminge merged 35 commits into main from browser-profiles
Sep 2, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat(desktop): browser profiles for the preview browser #7254

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3503088
feat(desktop): partition preview browsers by profile
juliusmarminge Aug 16, 2026
bd3f910
feat(web): manage browser profiles from Settings → Integrations
juliusmarminge Aug 16, 2026
b5435d2
feat(web): open browser tabs in a chosen profile
juliusmarminge Aug 16, 2026
bd58fab
fix(web): repair the Browser surface card and collapse the profile me…
juliusmarminge Aug 16, 2026
2fbfa0e
fix(web): give menu submenu triggers the same cursor as menu items
juliusmarminge Aug 16, 2026
0a9e51f
feat(web): show which profile a browser tab is running in
juliusmarminge Aug 16, 2026
fa3e6b5
fix(web): clear the profile the menu names, and only that profile
juliusmarminge Aug 16, 2026
040e929
fix(web): keep the profile chrome from crowding its neighbours
juliusmarminge Aug 16, 2026
a1568c0
fix(web): give the profile badge a real ellipsis
juliusmarminge Aug 17, 2026
5cd1e0c
fix(web): dim the profile list with the rest of the desktop-only block
juliusmarminge Aug 17, 2026
56b0482
fix(web): dim only the row content that has no disabled state of its own
juliusmarminge Aug 17, 2026
904f7bd
fix(web): keep profile names from stretching the menus
juliusmarminge Aug 17, 2026
1baec7e
fix(web): make each profile its own row, and truncate the menu heading
juliusmarminge Aug 17, 2026
bccf188
fix(web): clear the partition a legacy tab actually runs in
juliusmarminge Aug 17, 2026
e190ae5
fix(desktop): avoid browser partition scope collisions
juliusmarminge Aug 29, 2026
52548a2
fix(web): theme profile badge tooltip
juliusmarminge Aug 29, 2026
59cc0ff
style(web): format hosted browser webview
juliusmarminge Aug 29, 2026
ccff475
fix(web): hydrate preview open defaults
juliusmarminge Aug 29, 2026
ac3c431
fix(web): show browser panel shortcut
juliusmarminge Aug 29, 2026
944d63d
fix(web): open browser profiles on touch
juliusmarminge Aug 29, 2026
efd9522
fix(web): keep profiles when cleanup fails
juliusmarminge Aug 29, 2026
2a74df7
fix(web): clear profiles from every environment
juliusmarminge Aug 29, 2026
3239ee8
fix(web): update browser profiles from current settings
juliusmarminge Aug 29, 2026
d642f4b
fix(web): identify tabs from removed profiles
juliusmarminge Aug 29, 2026
3cd048f
fix(desktop): isolate browser profile partitions
juliusmarminge Aug 29, 2026
cf5f060
fix(web): group browser submenu affordances
juliusmarminge Aug 29, 2026
3c8ad20
fix(web): disable cancel during profile removal
juliusmarminge Aug 29, 2026
989e2ed
fix(web): disable unavailable profile removal
juliusmarminge Aug 29, 2026
69b6cfb
fix(desktop): encode browser profile scopes safely
juliusmarminge Aug 29, 2026
a6c5b56
fix(web): expose unavailable profile removal reason
juliusmarminge Aug 29, 2026
b1c6b4a
fix(web): wait for settings before profile writes
juliusmarminge Aug 29, 2026
81742f8
fix(web): keep long profile names from stretching the default-profile…
juliusmarminge Sep 2, 2026
32e789f
fix(web): actually truncate long names in the default-profile picker
juliusmarminge Sep 2, 2026
fe5a26f
fix(web): keep the default-profile popup at least as wide as its trigger
juliusmarminge Sep 2, 2026
1a5aa85
fix(desktop): keep lone-surrogate scopes in distinct browser partitions
juliusmarminge Sep 2, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(web): hydrate preview open defaults
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge committed Sep 2, 2026
commit ccff475200bb21c09ddd9558bf6363f0cd66c040

There are no files selected for viewing

11 changes: 8 additions & 3 deletions 11 apps/web/src/browser/openFileInPreview.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import {
} from "~/previewStateStore";
import { useRightPanelStore } from "~/rightPanelStore";

import { browserDefaultOpenProfileId, browserDefaultOpenViewport } from "./browserDefaults";
import {
browserDefaultOpenProfileId,
browserDefaultOpenViewport,
resolveBrowserDefaults,
} from "./browserDefaults";

export const isBrowserPreviewFile = (path: string): boolean =>
/\.(?:html?|pdf)$/i.test(path.split(/[?#]/, 1)[0] ?? "");
Expand All @@ -44,6 +48,7 @@ export async function openUrlInPreview<E>(input: {
readonly url: string;
readonly openPreview: OpenPreviewMutation<E>;
}): Promise<AtomCommandResult<void, E>> {
const defaults = await resolveBrowserDefaults();
const result = await input.openPreview({
environmentId: input.threadRef.environmentId,
input: {
Expand All @@ -52,8 +57,8 @@ export async function openUrlInPreview<E>(input: {
// Built here rather than via `openPreviewSession` because this path
// maps the result differently, so the configured defaults have to be
// applied explicitly or file/link opens would ignore them.
viewport: browserDefaultOpenViewport(),
profileId: browserDefaultOpenProfileId(),
viewport: browserDefaultOpenViewport(defaults),
profileId: browserDefaultOpenProfileId(defaults),
},
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

});
return mapAtomCommandResult(result, (snapshot) => {
Expand Down
60 changes: 59 additions & 1 deletion 60 apps/web/src/components/preview/openTerminalLinkInPreview.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { LocalApi, PreviewSessionSnapshot, ScopedThreadRef } from "@t3tools/contracts";
import * as Cause from "effect/Cause";
import { AsyncResult } from "effect/unstable/reactivity";
import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";

import {
openTerminalLinkInPreview,
Expand All @@ -20,6 +20,21 @@ vi.mock("~/rightPanelStore", () => ({
},
}));

const browserDefaultsMocks = vi.hoisted(() => ({
resolve: vi.fn(),
}));

vi.mock("~/browser/browserDefaults", () => ({
resolveBrowserDefaults: browserDefaultsMocks.resolve,
browserDefaultOpenViewport: (defaults: { viewport: unknown }) => defaults.viewport,
browserDefaultOpenProfileId: (defaults: { profileId: string }) => defaults.profileId,
}));

const hydratedDefaults = {
viewport: { _tag: "fixed", width: 1280, height: 720 } as const,
profileId: "work",
};

const threadRef = {
environmentId: "local" as ScopedThreadRef["environmentId"],
threadId: "thread-1" as ScopedThreadRef["threadId"],
Expand All @@ -34,11 +49,54 @@ const snapshot: PreviewSessionSnapshot = {
updatedAt: "2026-06-20T00:00:00.000Z",
};

beforeEach(() => {
browserDefaultsMocks.resolve.mockResolvedValue(hydratedDefaults);
});

afterEach(() => {
vi.restoreAllMocks();
});

describe("openTerminalLinkInPreview", () => {
it("waits for hydrated viewport and profile defaults before opening", async () => {
let hydrate: ((defaults: typeof hydratedDefaults) => void) | undefined;
browserDefaultsMocks.resolve.mockImplementationOnce(
() =>
new Promise<typeof hydratedDefaults>((resolve) => {
hydrate = resolve;
}),
);
const openPreview = vi.fn(async () => AsyncResult.success(snapshot));

const opening = openTerminalLinkInPreview({
url: "http://localhost:3000/",
position: { x: 12, y: 34 },
threadRef,
openPreview,
localApi: {
contextMenu: {
show: vi.fn(async () => "open-in-preview"),
},
} as unknown as LocalApi,
fallbackToBrowser: vi.fn(),
});

await vi.waitFor(() => expect(browserDefaultsMocks.resolve).toHaveBeenCalledOnce());
expect(openPreview).not.toHaveBeenCalled();
hydrate?.(hydratedDefaults);
await opening;

expect(openPreview).toHaveBeenCalledWith({
environmentId: "local",
input: {
threadId: "thread-1",
url: "http://localhost:3000/",
viewport: hydratedDefaults.viewport,
profileId: hydratedDefaults.profileId,
},
});
});

it("preserves context-menu failures with terminal link context before falling back", async () => {
const cause = new Error("menu unavailable");
const fallbackToBrowser = vi.fn();
Expand Down
11 changes: 8 additions & 3 deletions 11 apps/web/src/components/preview/openTerminalLinkInPreview.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { isAtomCommandInterrupted } from "@t3tools/client-runtime/state/runtime"
import { isPreviewableUrl } from "@t3tools/shared/preview";
import * as Schema from "effect/Schema";

import { browserDefaultOpenProfileId, browserDefaultOpenViewport } from "~/browser/browserDefaults";
import {
browserDefaultOpenProfileId,
browserDefaultOpenViewport,
resolveBrowserDefaults,
} from "~/browser/browserDefaults";
import type { OpenPreviewMutation } from "~/browser/openFileInPreview";
import { recordVisitForThread } from "~/browserHistoryStore";
import { applyPreviewServerSnapshot, isPreviewSupportedInRuntime } from "~/previewStateStore";
Expand Down Expand Up @@ -83,15 +87,16 @@ export async function openTerminalLinkInPreview<E>(
}

if (choice === "open-in-preview") {
const defaults = await resolveBrowserDefaults();
const result = await input.openPreview({
environmentId: input.threadRef.environmentId,
input: {
threadId: input.threadRef.threadId,
url: input.url,
// Same reason as `openUrlInPreview`: this path handles its own result
// mapping, so the configured defaults are applied explicitly.
viewport: browserDefaultOpenViewport(),
profileId: browserDefaultOpenProfileId(),
viewport: browserDefaultOpenViewport(defaults),
profileId: browserDefaultOpenProfileId(defaults),
},
});
if (result._tag === "Failure") {
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.