mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-07 00:07:29 +00:00
Projects now open with a user-owned trust decision. The prompt offers Preview in Restricted Mode, Don't Open and Trust Project, with an optional trusted parent folder; preview is the default focus so Enter never grants trust. Restricted projects keep browsing, editing, saving, search and highlighting. Project-controlled execution is denied by default in the backend: run, debug, build, tools, language servers, plugins and Git commands that could honour repository configuration. Trusting a project enables those paths without reopening it, and decisions can be revoked in Settings. Terminals stay available when the user opens one, without project shell settings, environment or virtualenv activation. A shell prompt that runs git in the folder can still honour the repository's core.fsmonitor. Fixes #462
17 lines
629 B
TypeScript
17 lines
629 B
TypeScript
/**
|
|
* Plain-browser development aid (`pnpm dev` without Tauri): injects a fake
|
|
* project so the workbench and features render for visual review. Features
|
|
* fall back to in-memory backends in this mode. Never loaded under Tauri or
|
|
* in production builds (except `--mode perf`, used by the performance harness).
|
|
*/
|
|
import { useProject } from "@/platform/project";
|
|
|
|
export function registerDevSamples(): () => void {
|
|
if (!useProject.getState().project) {
|
|
useProject.setState({
|
|
project: { root: "/dev/acme-api", name: "acme-api", trusted: true, isGit: true, settings: {} as never },
|
|
});
|
|
}
|
|
return () => {};
|
|
}
|