Skip to content

AI-native design editor. Open-source Figma alternative.

Merge remote-tracking branch 'source/master' into victorwads/fast-pages-open-recent

Victor Wads51f8464621d0
diff --cc CHANGELOG.md
index a30bfdb9d,535654c75..97e63e940
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -8,8 -8,11 +8,12 @@@
### Added
+- Open to a unified home with recent and configured storage documents, including grid or list layouts.
+ - Snap vector points, moved layers, and resized edges to nearby geometry, sibling layer bounds, canvas and frame layout guides, and whole-pixel coordinates with visible alignment guides, fractional-coordinate preservation when pixel snapping is off, and persistent geometry, object, and pixel-grid controls in General settings and the Preferences menu.
+ - Run Pi through AI SDK HarnessAgent as a configurable desktop provider with multiple saved model profiles, secure credentials, existing MCP design tools, and per-profile thinking and permission settings.
- Open multiple selected design files in separate tabs.
+ - Let Figma API scripts and automation combine components into variant sets.
+ - Add deterministic two-browser collaboration coverage for bidirectional edits, awareness, departure cleanup, partitioned-peer convergence, and reconnect synchronization without public network dependencies. (#530)
- Import, render, edit, resize, select, and export Figma text-on-path layers while preserving their curved glyph layout.
- Show Figma-style temporary distance measurements between selected and Option/Alt-hovered layers. (#491)
- Add a single CodeMirror editor for live Design JSX and HTML/CSS canvas previews, with Tailwind JSX viewing, completion, diagnostics, line numbers, bounded execution, and session-level undo. (#130)
@@@ -59,7 -61,8 +63,9 @@@
### Fixed
+- Generate and cache recent-file previews from the conventional `Cover` page after opening a `.fig`, without modifying the source file.
+ - Preserve app-created component properties and instance-swap targets across `.fig` save and reload cycles. (#548)
+ - Reconnect desktop automation to an already-running MCP server by allowing access to its discovery file. (#546)
- Keep text-editing carets, hit testing, and selection highlights aligned with vertically centered or bottom-aligned text. (#539)
- Match AI chat code-block syntax colors and backgrounds to the active light or dark theme. (#537)
- Let desktop users select and copy AI chat text without replacing it with the selected canvas layers. (#538)
diff --cc desktop/src/lib.rs
index 0de23f00f,b6ef5f650..fadb1d037
--- a/desktop/src/lib.rs
+++ b/desktop/src/lib.rs
@@@ -150,7 -145,8 +150,9 @@@ pub fn run()
list_system_fonts,
load_system_font,
proxy_http_request,
+ set_recent_files,
+ native_menu_checked,
+ set_native_menu_checked,
take_pending_open
])
.plugin(tauri_plugin_opener::init())
diff --cc desktop/src/menu.rs
index d05f909c7,02343991c..c79b56e7d
--- a/desktop/src/menu.rs
+++ b/desktop/src/menu.rs
@@@ -1,6 -1,7 +1,8 @@@
use serde::Deserialize;
+use std::path::Path;
- use tauri::menu::{MenuBuilder, MenuItemBuilder, Submenu, SubmenuBuilder};
+ use tauri::menu::{
+ CheckMenuItemBuilder, MenuBuilder, MenuItemBuilder, MenuItemKind, Submenu, SubmenuBuilder,
+ };
#[cfg(any(target_os = "macos", target_os = "windows"))]
use tauri::menu::PredefinedMenuItem;
@@@ -135,10 -106,59 +151,62 @@@ fn build_schema_menus<R: tauri::Runtime
.collect()
}
+ fn find_menu_item<R: tauri::Runtime>(
+ items: Vec<MenuItemKind<R>>,
+ id: &str,
+ ) -> Option<MenuItemKind<R>> {
+ for item in items {
+ if item.id().0 == id {
+ return Some(item);
+ }
+ if let MenuItemKind::Submenu(submenu) = &item {
+ if let Ok(children) = submenu.items() {
+ if let Some(found) = find_menu_item(children, id) {
+ return Some(found);
+ }
+ }
+ }
+ }
+ None
+ }
+
+ #[tauri::command]
+ pub fn native_menu_checked<R: tauri::Runtime>(
+ app: tauri::AppHandle<R>,
+ id: String,
+ ) -> Result<bool, String> {
+ let menu = app
+ .menu()
+ .ok_or_else(|| "Application menu is unavailable".to_string())?;
+ let item = find_menu_item(menu.items().map_err(|error| error.to_string())?, &id)
+ .ok_or_else(|| format!("Menu item not found: {id}"))?;
+ match item {
+ MenuItemKind::Check(item) => item.is_checked().map_err(|error| error.to_string()),
+ _ => Err(format!("Menu item is not checkable: {id}")),
+ }
+ }
+
+ #[tauri::command]
+ pub fn set_native_menu_checked<R: tauri::Runtime>(
+ app: tauri::AppHandle<R>,
+ id: String,
+ checked: bool,
+ ) -> Result<(), String> {
+ let menu = app
+ .menu()
+ .ok_or_else(|| "Application menu is unavailable".to_string())?;
+ let item = find_menu_item(menu.items().map_err(|error| error.to_string())?, &id)
+ .ok_or_else(|| format!("Menu item not found: {id}"))?;
+ match item {
+ MenuItemKind::Check(item) => item.set_checked(checked).map_err(|error| error.to_string()),
+ _ => Err(format!("Menu item is not checkable: {id}")),
+ }
+ }
+
-pub fn install_app_menu<R: tauri::Runtime>(app: &mut tauri::App<R>) -> tauri::Result<()> {
+pub fn install_app_menu<R: tauri::Runtime>(
+ app: &tauri::AppHandle<R>,
+ recent_files: &[String],
+) -> tauri::Result<()> {
#[cfg(target_os = "macos")]
let app_menu = SubmenuBuilder::new(app, "OpenPencil")
.item(&PredefinedMenuItem::about(
diff --cc src/app/tabs/index.ts
index 76ff2f53a,f12303545..2c23803ca
--- a/src/app/tabs/index.ts
+++ b/src/app/tabs/index.ts
@@@ -90,24 -78,11 +90,28 @@@ export function createTab(store?: Edito
return tab
}
+export function leaveHome(tabId: string): void {
+ const tabIndex = tabsRef.value.findIndex((candidate) => candidate.id === tabId)
+ if (tabIndex === -1) return
+ const tab = tabsRef.value[tabIndex]
+ if (!tab.showHome) return
+ tabsRef.value = tabsRef.value.with(tabIndex, { ...tab, showHome: false })
+}
+
+export function showRecentFiles(): void {
+ const homeTab = tabsRef.value.find((tab) => tab.showHome)
+ if (homeTab) {
+ switchTab(homeTab.id)
+ return
+ }
+ createTab(undefined, undefined, true)
+}
+
function activateTab(tab: Tab) {
+ const previous = tabsRef.value.find((candidate) => candidate.id === activeTabId.value)
+ previous?.store.setSnapGuides([])
+ previous?.store.setLayoutInsertIndicator(null)
+ previous?.store.setDropTarget(null)
activeTabId.value = tab.id
setActiveEditorStore(tab.store)
triggerRef(tabsRef)