Add external editor/file picker, update theme
Introduce file/application pickers and external-editor integration, plus a visual refresh. Frontend: add UI for selecting/rescanning installed IDEs, custom editor input, "Open in File Explorer" and "Open in Code Editor" actions, clone destination browse, helper utilities, new icons, and many CSS theme/UX improvements (variables, shadows, scrollbars, selection, refined component styles). State: track installedIdes and scan status. Tauri API: expose browseDirectory, browseApplication and scanInstalledIdes, and wire UI handlers to call them. Backend: add InstalledIde struct and update tauri Cargo manifest and capabilities to allow dialogs. Overall improves editor/workflow integrations and modernizes the app styling.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const invoke = window.__TAURI__?.core?.invoke;
|
||||
const dialog = window.__TAURI__?.dialog;
|
||||
|
||||
function ensureInvoke() {
|
||||
if (!invoke) {
|
||||
@@ -6,6 +7,33 @@ function ensureInvoke() {
|
||||
}
|
||||
}
|
||||
|
||||
function ensureDialog() {
|
||||
if (!dialog?.open) {
|
||||
throw new Error("Tauri dialog API is not available.");
|
||||
}
|
||||
}
|
||||
|
||||
export async function browseDirectory(defaultPath = "") {
|
||||
ensureDialog();
|
||||
return dialog.open({
|
||||
directory: true,
|
||||
multiple: false,
|
||||
defaultPath: defaultPath || undefined,
|
||||
});
|
||||
}
|
||||
|
||||
export async function browseApplication(defaultPath = "") {
|
||||
ensureDialog();
|
||||
return dialog.open({
|
||||
directory: false,
|
||||
multiple: false,
|
||||
defaultPath: defaultPath || undefined,
|
||||
filters: [
|
||||
{ name: "Applications", extensions: ["exe", "cmd", "bat", "app"] },
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
export async function runGitClone(repoUrl, destinationPath, gitPath) {
|
||||
ensureInvoke();
|
||||
return invoke("git_clone", {
|
||||
@@ -131,6 +159,11 @@ export async function openInExternalEditor(repoPath, editorPath) {
|
||||
return invoke("open_in_external_editor", { repoPath, editorPath });
|
||||
}
|
||||
|
||||
export async function scanInstalledIdes() {
|
||||
ensureInvoke();
|
||||
return invoke("scan_installed_ides");
|
||||
}
|
||||
|
||||
export async function scanLocalRepos(roots = [], allowedRemoteUrls = [], gitPath = "", maxDepth = 4, maxResults = 200) {
|
||||
ensureInvoke();
|
||||
return invoke("scan_local_repos", {
|
||||
|
||||
Reference in New Issue
Block a user