4806209761
Whiteboard: zoom bar and dot grid, layers panel, appear motion, sound cues, focus rings and AccessKit labels; .draw files with legacy .excalidraw still readable; notescraft-cli export whiteboard. Security: export.pdf and file.export_whiteboard_svg accept vault-relative out paths only (they are reachable by the assistant and the control channel). The CLI places absolute --out files itself via the new notescraft_engine::render_pdf; the UI export worker renders and the live session writes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
28 lines
973 B
Rust
28 lines
973 B
Rust
//! Typed file and virtual tab dispatch.
|
|
use notescraft_ui_egui::tabs::{GRAPH_PATH, SETTINGS_PATH, TabKind, Tabs};
|
|
|
|
#[test]
|
|
fn extensions_select_views_and_virtual_tabs_deduplicate() {
|
|
for (path, kind) in [
|
|
("a.md", TabKind::Note),
|
|
("a.CANVAS", TabKind::Canvas),
|
|
("a.draw", TabKind::Whiteboard),
|
|
("a.excalidraw", TabKind::Whiteboard),
|
|
("a.mmd", TabKind::Diagram),
|
|
("a.mermaid", TabKind::Diagram),
|
|
(GRAPH_PATH, TabKind::Graph),
|
|
(SETTINGS_PATH, TabKind::Settings),
|
|
] {
|
|
assert_eq!(TabKind::of(path), kind);
|
|
}
|
|
let mut tabs = Tabs::new();
|
|
tabs.open(GRAPH_PATH);
|
|
tabs.open(SETTINGS_PATH);
|
|
tabs.open(GRAPH_PATH);
|
|
assert_eq!(tabs.open.len(), 2);
|
|
assert_eq!(tabs.active_kind(), Some(TabKind::Graph));
|
|
assert_eq!(TabKind::Graph.title(GRAPH_PATH), "Graph view");
|
|
assert_eq!(TabKind::Settings.title(SETTINGS_PATH), "Settings");
|
|
assert!(!TabKind::Graph.is_file());
|
|
}
|