mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 18:47:40 +00:00
Merge remote-tracking branch 'origin/feat/mobile-remote-files-git-review' into feat/mobile-server-ssh-repos
This commit is contained in:
@@ -17,7 +17,7 @@ import { reviewSheetKey, type ReviewSheet } from '../session/mobile-diff-review-
|
||||
import type { useMobileDiffReviewController } from '../session/use-mobile-diff-review-controller'
|
||||
import { mobileDiffReviewStyles as styles } from './mobile-diff-review-screen-styles'
|
||||
import { hostOs } from '../platform/host-os'
|
||||
import { useWorkspaceHostOpensEditorTabs } from '../navigation/workspace-execution-host'
|
||||
import { useWorkspaceOnPairedHost } from '../navigation/workspace-execution-host'
|
||||
|
||||
type Props = {
|
||||
controller: ReturnType<typeof useMobileDiffReviewController>
|
||||
@@ -133,7 +133,7 @@ function useSendActions(
|
||||
}
|
||||
|
||||
function useOverflowActions(controller: ReturnType<typeof useMobileDiffReviewController>) {
|
||||
const sessionTabsAvailable = useWorkspaceHostOpensEditorTabs()
|
||||
const sessionTabsAvailable = useWorkspaceOnPairedHost()
|
||||
return useMemo<ActionSheetAction[]>(
|
||||
() => [
|
||||
{
|
||||
|
||||
@@ -9,8 +9,12 @@ export function useWorkspaceExecutionHost(): ExecutionHostId | undefined {
|
||||
return useContext(WorkspaceExecutionHostContext)
|
||||
}
|
||||
|
||||
/** Whether this workspace's host can open a desktop editor tab (Open in Session, New Note). */
|
||||
export function useWorkspaceHostOpensEditorTabs(): boolean {
|
||||
/**
|
||||
* Whether this workspace runs on the paired desktop itself. Gates actions whose only result is an
|
||||
* editor tab; for everything else the host's reply decides where it goes.
|
||||
* A phone paired directly with a headless host still reads true, matching main's behaviour there.
|
||||
*/
|
||||
export function useWorkspaceOnPairedHost(): boolean {
|
||||
// Why the route, not a host signal: no host advertises a desktop window, and a server workspace's calls go to its own host.
|
||||
return useWorkspaceExecutionHost() === undefined
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ describe('the New Tab sheet', () => {
|
||||
|
||||
it('leaves out Markdown Note for a server workspace, whose host opens no editor tabs', async () => {
|
||||
const labels = await newTabLabels('runtime:vm')
|
||||
expect(labels).not.toContain('Markdown Note')
|
||||
expect(labels).toEqual(['Terminal', 'Browser'])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ import { TextInputModal } from '../components/TextInputModal'
|
||||
import { ConfirmModal } from '../components/ConfirmModal'
|
||||
import { CustomKeyModal } from '../components/CustomKeyModal'
|
||||
import { MobileDictationSetupSheet } from '../components/MobileDictationSetupSheet'
|
||||
import { useWorkspaceHostOpensEditorTabs } from '../navigation/workspace-execution-host'
|
||||
import { useWorkspaceOnPairedHost } from '../navigation/workspace-execution-host'
|
||||
import { MobileBrowserTabActionSheet } from './MobileBrowserTabActionSheet'
|
||||
import { getMobileTerminalActionSheetActions } from './mobile-terminal-action-sheet-actions'
|
||||
import {
|
||||
@@ -92,7 +92,7 @@ export function MobileSessionSheets({ controller }: { controller: MobileSessionC
|
||||
showChecksAction
|
||||
} = controller
|
||||
const clipboard = useClipboardWriter()
|
||||
const hostOpensEditorTabs = useWorkspaceHostOpensEditorTabs()
|
||||
const onPairedHost = useWorkspaceOnPairedHost()
|
||||
return (
|
||||
<>
|
||||
<MobileSessionHeaderMoreActionsSheet
|
||||
@@ -146,7 +146,7 @@ export function MobileSessionSheets({ controller }: { controller: MobileSessionC
|
||||
setShowCreateBrowserModal(true)
|
||||
}
|
||||
},
|
||||
...(hostOpensEditorTabs
|
||||
...(onPairedHost
|
||||
? [
|
||||
{
|
||||
label: 'Markdown Note',
|
||||
|
||||
@@ -184,9 +184,10 @@ async function openMobileFileTapAsync<T extends FileTapSessionTab>(
|
||||
// Why: a host with no desktop window opens no editor tabs; the preview route reads the file through files.read.
|
||||
if (isRendererUnavailableReply(openResponse)) {
|
||||
// Not a failure: the user moved off the source tab during the call.
|
||||
if (shouldActivateOpenedMobileSessionTab(options.getActivationState(false))) {
|
||||
pushWorktreePreview()
|
||||
if (!shouldActivateOpenedMobileSessionTab(options.getActivationState(false))) {
|
||||
return
|
||||
}
|
||||
pushWorktreePreview()
|
||||
return
|
||||
}
|
||||
const opened = fileTapOpenRun.interpret(openResponse)
|
||||
|
||||
Reference in New Issue
Block a user