fix(desktop): respect local-origin tauri shell for directory access (#391)
* feat: enable local-origin desktop features and copy in terminal support - Enable arbitrary web loads in desktop web content for TAURI apps. - Guard directory dialog access behind local-origin origin check. - Add copy-to-clipboard support for terminal selections via common shortcuts. * fix: improve initial directory resolution and persistence in directory store
This commit is contained in:
committed by
GitHub
parent
844562749d
commit
3afe0bb45d
@@ -22,7 +22,7 @@ import { useSessionStore } from '@/stores/useSessionStore';
|
||||
import { useDirectoryStore } from '@/stores/useDirectoryStore';
|
||||
import { useProjectsStore } from '@/stores/useProjectsStore';
|
||||
import { useFileSystemAccess } from '@/hooks/useFileSystemAccess';
|
||||
import { isTauriShell } from '@/lib/desktop';
|
||||
import { isDesktopLocalOriginActive, isTauriShell } from '@/lib/desktop';
|
||||
import { useDeviceInfo } from '@/lib/device';
|
||||
import { sessionEvents } from '@/lib/sessionEvents';
|
||||
|
||||
@@ -129,7 +129,7 @@ export const SessionDialogs: React.FC = () => {
|
||||
|
||||
setHasShownInitialDirectoryPrompt(true);
|
||||
|
||||
if (isTauriShell()) {
|
||||
if (isTauriShell() && isDesktopLocalOriginActive()) {
|
||||
requestAccess('')
|
||||
.then(async (result) => {
|
||||
if (!result.success || !result.path) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import type { Session } from '@opencode-ai/sdk/v2';
|
||||
import { toast } from '@/components/ui';
|
||||
import { isDesktopShell, isTauriShell } from '@/lib/desktop';
|
||||
import { isDesktopLocalOriginActive, isDesktopShell, isTauriShell } from '@/lib/desktop';
|
||||
import {
|
||||
DndContext,
|
||||
DragOverlay,
|
||||
@@ -1035,7 +1035,7 @@ export const SessionSidebar: React.FC<SessionSidebarProps> = ({
|
||||
);
|
||||
|
||||
const handleOpenDirectoryDialog = React.useCallback(() => {
|
||||
if (!tauriIpcAvailable) {
|
||||
if (!tauriIpcAvailable || !isDesktopLocalOriginActive()) {
|
||||
sessionEvents.requestDirectoryDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user