24 lines · 882 B · TypeScript
RawDownload
import {  mapAtomCommandResult,  type AtomCommandResult,} from "@t3tools/client-runtime/state/runtime";import type { ScopedThreadRef } from "@t3tools/contracts"; import type { OpenPreviewMutation } from "~/browser/openFileInPreview";import { useRightPanelStore } from "~/rightPanelStore"; import { openPreviewSession } from "./openPreviewSession"; /** Creates a new browser tab. Reopening an existing tab is a separate UI action. */export async function addBrowserSurface<E>(input: {  readonly threadRef: ScopedThreadRef;  readonly openPreview: OpenPreviewMutation<E>;}): Promise<AtomCommandResult<void, E>> {  const result = await openPreviewSession({    openPreview: input.openPreview,    threadRef: input.threadRef,  });  return mapAtomCommandResult(result, (snapshot) => {    useRightPanelStore.getState().openBrowser(input.threadRef, snapshot.tabId);  });}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t