fmt(js): npm run fix on merge (#94176)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
85a55e2b30
commit
b9eb37e5eb
@@ -18,12 +18,7 @@ import { reachablePreviewUrl } from '@/lib/preview-reach'
|
||||
import { rafCoalesce } from '@/lib/raf-coalesce'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { notify, notifyError } from '@/store/notifications'
|
||||
import {
|
||||
$previewServerRestart,
|
||||
failPreviewServerRestart,
|
||||
noteBrowserPage,
|
||||
type PreviewTarget
|
||||
} from '@/store/preview'
|
||||
import { $previewServerRestart, failPreviewServerRestart, noteBrowserPage, type PreviewTarget } from '@/store/preview'
|
||||
|
||||
import { ArtifactPreview } from './preview-artifact'
|
||||
import { PreviewBrowserBar } from './preview-browser-bar'
|
||||
|
||||
@@ -92,7 +92,11 @@ const RUNTIME_SESSION_ID = 'rt-new-001'
|
||||
|
||||
type HarnessHandle = Pick<
|
||||
ReturnType<typeof useSessionActions>,
|
||||
'createBackendSessionForSend' | 'openNewSessionTile' | 'removeSession' | 'selectSidebarItem' | 'startFreshSessionDraft'
|
||||
| 'createBackendSessionForSend'
|
||||
| 'openNewSessionTile'
|
||||
| 'removeSession'
|
||||
| 'selectSidebarItem'
|
||||
| 'startFreshSessionDraft'
|
||||
>
|
||||
|
||||
function storedSession(overrides: Partial<SessionInfo> = {}): SessionInfo {
|
||||
@@ -2827,6 +2831,7 @@ describe('openNewSessionTile workspace target', () => {
|
||||
])
|
||||
|
||||
let createParams: Record<string, unknown> | undefined
|
||||
|
||||
const requestGateway = vi.fn(async (method: string, params?: Record<string, unknown>) => {
|
||||
if (method === 'session.create') {
|
||||
createParams = params
|
||||
|
||||
@@ -624,17 +624,15 @@ export function useSessionActions({
|
||||
// occupied (openTab path for "New session in Home").
|
||||
const capturedRoute = options?.route === undefined ? $newChatRoute.get() : options.route
|
||||
const workspaceScope = options?.workspaceScope ?? { workspaceMode: 'sessions' }
|
||||
|
||||
const cwd =
|
||||
options?.cwd === null
|
||||
? ''
|
||||
: typeof options?.cwd === 'string'
|
||||
? options.cwd.trim()
|
||||
: resolveNewSessionCwd()
|
||||
options?.cwd === null ? '' : typeof options?.cwd === 'string' ? options.cwd.trim() : resolveNewSessionCwd()
|
||||
|
||||
const params = {
|
||||
...(await desktopSessionCreateParams(cwd, capturedRoute)),
|
||||
...(workspaceScope.workspaceMode === 'bots' ? { hidden: true } : {})
|
||||
}
|
||||
|
||||
const created = capturedRoute
|
||||
? await requestGatewayForAgent<SessionCreateResponse>(
|
||||
capturedRoute.connectionId,
|
||||
|
||||
@@ -89,6 +89,7 @@ describe('startWorkspaceSession', () => {
|
||||
|
||||
const requestGateway = vi.fn()
|
||||
const activeSessionIdRef = { current: null }
|
||||
|
||||
const startFreshSessionDraft = vi.fn((options?: { workspaceTarget: NewChatWorkspaceTarget }) => {
|
||||
setNewChatWorkspaceTarget(options?.workspaceTarget)
|
||||
setCurrentCwd(options?.workspaceTarget || '')
|
||||
|
||||
@@ -42,6 +42,7 @@ export function startWorkspaceSession({
|
||||
const target = explicitTarget || resolveNewSessionCwd()
|
||||
|
||||
startFreshSessionDraft(target ? { workspaceTarget: target } : undefined)
|
||||
|
||||
if (!target) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user