Skip to content

Commit 745f93f

Browse files
authored
Merge branch 'master' into arrow-tool-features-improvement
2 parents 0c9306c + 2be7790 commit 745f93f

172 files changed

Lines changed: 2400 additions & 2089 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.branding

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
https://github.com/Keavon/graphite-branded-assets/archive/8cd7cf811d36228a2eb7ce741adc3c745632a6e7.tar.gz
2-
17a7cd32dda4afd893c65e1fb6757f1ecf760702217f647d1c680db8d92643ef
1+
https://github.com/Keavon/graphite-branded-assets/archive/f44aa2f362ae4fed8d634878b817a1d3948a7dcb.tar.gz
2+
dffe2b483e491979ef57c320d61446ada5400ef73ff26582976631d9c36efefc

.github/workflows/build-dev-and-ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ jobs:
113113
- name: 📃 Generate code documentation info for website
114114
if: github.ref == 'refs/heads/master'
115115
run: |
116-
cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree
116+
cd tools/editor-message-tree
117+
cargo run
118+
cd ../..
117119
mkdir -p artifacts-generated
118-
mv hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt
120+
mv website/generated/hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt
119121
120122
- name: 💿 Obtain cache of auto-generated code docs artifacts, to check if they've changed
121123
if: github.ref == 'refs/heads/master'

.github/workflows/website.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: 🕸 Install Zola
3838
uses: taiki-e/install-action@v2
3939
with:
40-
tool: zola@0.20.0
40+
tool: zola@0.22.0
4141

4242
- name: 🔍 Check if `website/other` directory changed
4343
uses: dorny/paths-filter@v3
@@ -67,19 +67,27 @@ jobs:
6767
rustup update stable
6868
echo "🦀 Latest updated version of Rust:"
6969
rustc --version
70-
cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree
70+
cd tools/editor-message-tree
71+
cargo run
72+
cd ../..
7173
mkdir artifacts
72-
mv hierarchical_message_system_tree.txt artifacts/hierarchical_message_system_tree.txt
74+
mv website/generated/hierarchical_message_system_tree.txt artifacts/hierarchical_message_system_tree.txt
7375
74-
- name: 🚚 Move `artifacts` contents to the project root
76+
- name: 🚚 Move `artifacts` contents to website/generated
7577
run: |
76-
mv artifacts/* .
78+
mkdir -p website/generated
79+
mv artifacts/* website/generated/
7780
7881
- name: 🔧 Build auto-generated code docs artifacts into HTML
7982
run: |
8083
cd website
8184
npm run generate-editor-structure
8285
86+
- name: 📃 Generate node catalog documentation
87+
run: |
88+
cd tools/node-docs
89+
cargo run
90+
8391
- name: 🌐 Build Graphite website with Zola
8492
env:
8593
MODE: prod

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ flamegraph.svg
1111
.idea/
1212
.direnv
1313
.DS_Store
14-
hierarchical_message_system_tree.txt
15-
hierarchical_message_system_tree.html

.nix/pkgs/graphite.nix

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,15 @@ let
4444
// {
4545
cargoArtifacts = deps.crane.lib.buildDepsOnly resourcesCommon;
4646

47-
# TODO: Remove the need for this hash by using individual package resolutions and hashes from package-lock.json
48-
npmDeps = pkgs.fetchNpmDeps {
49-
inherit (info) pname version;
50-
src = "${info.src}/frontend";
51-
hash = "sha256-WlwzWGoFi3hjRuM5ucrgavko/gg4iFAwMc6uMLjT/FI=";
47+
npmDeps = pkgs.importNpmLock {
48+
npmRoot = "${info.src}/frontend";
5249
};
5350

5451
npmRoot = "frontend";
5552
npmConfigScript = "setup";
5653
makeCacheWritable = true;
5754

58-
nativeBuildInputs = tools.frontend ++ [ pkgs.npmHooks.npmConfigHook ];
55+
nativeBuildInputs = tools.frontend ++ [ pkgs.importNpmLock.npmConfigHook ];
5956

6057
prePatch = ''
6158
mkdir branding

.vscode/settings.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
// Configured in `.prettierrc`
2727
"editor.defaultFormatter": "esbenp.prettier-vscode"
2828
},
29+
// Website: don't format Zola/Tera-templated HTML on save
30+
"[html]": {
31+
"editor.formatOnSave": false
32+
},
2933
// Handlebars: don't save on format
3034
// (`about.hbs` is used by Cargo About to encode license information)
3135
"[handlebars]": {
@@ -67,6 +71,9 @@
6771
"cSpell.language": "en-US",
6872
"cSpell.logLevel": "Information",
6973
"cSpell.allowCompoundWords": true,
74+
// Other extensions config
75+
"evenBetterToml.formatter.alignComments": false,
76+
"package-json-upgrade.ignorePatterns": ["source-sans-pro"],
7077
// VS Code config
7178
"html.format.wrapLineLength": 200,
7279
"files.eol": "\n",
@@ -75,6 +82,5 @@
7582
"*.graphite": "json"
7683
},
7784
"editor.renderWhitespace": "boundary",
78-
"editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+",
79-
"evenBetterToml.formatter.alignComments": false
85+
"editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+"
8086
}

Cargo.lock

Lines changed: 24 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ members = [
3939
"node-graph/node-macro",
4040
"node-graph/preprocessor",
4141
"proc-macros",
42-
"tools/crate-hierarchy-viz"
42+
"tools/crate-hierarchy-viz",
43+
"tools/editor-message-tree",
44+
"tools/node-docs",
4345
]
4446
default-members = [
4547
"editor",
@@ -137,6 +139,7 @@ log = "0.4"
137139
bitflags = { version = "2.4", features = ["serde"] }
138140
ctor = "0.2"
139141
convert_case = "0.8"
142+
indoc = "2.0.5"
140143
derivative = "2.2"
141144
thiserror = "2"
142145
anyhow = "1.0"
@@ -151,7 +154,7 @@ wgpu = { version = "27.0", features = [
151154
"spirv",
152155
"strict_asserts",
153156
] }
154-
once_cell = "1.13" # Remove when `core::cell::LazyCell` (<https://doc.rust-lang.org/core/cell/struct.LazyCell.html>) is stabilized in Rust 1.80 and we bump our MSRV
157+
once_cell = "1.13" # Remove and replace with `core::cell::LazyCell` (<https://doc.rust-lang.org/core/cell/struct.LazyCell.html>)
155158
wasm-bindgen = "=0.2.100" # NOTICE: ensure this stays in sync with the `wasm-bindgen-cli` version in `website/content/volunteer/guide/project-setup/_index.md`. We pin this version because wasm-bindgen upgrades may break various things.
156159
wasm-bindgen-futures = "0.4"
157160
js-sys = "=0.3.77"
@@ -177,10 +180,16 @@ winit = { git = "https://github.com/rust-windowing/winit.git" }
177180
keyboard-types = "0.8"
178181
url = "2.5"
179182
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt"] }
183+
# Linebender ecosystem (BEGIN)
184+
kurbo = { version = "0.12", features = ["serde"] }
180185
vello = { git = "https://github.com/linebender/vello" }
181186
vello_encoding = { git = "https://github.com/linebender/vello" }
182187
resvg = "0.45"
183188
usvg = "0.45"
189+
parley = "0.6"
190+
skrifa = "0.36"
191+
polycool = "0.4"
192+
# Linebender ecosystem (END)
184193
rand = { version = "0.9", default-features = false, features = ["std_rng"] }
185194
rand_chacha = "0.9"
186195
glam = { version = "0.29", default-features = false, features = [
@@ -194,8 +203,6 @@ image = { version = "0.25", default-features = false, features = [
194203
"jpeg",
195204
"bmp",
196205
] }
197-
parley = "0.6"
198-
skrifa = "0.36"
199206
pretty_assertions = "1.4"
200207
fern = { version = "0.7", features = ["colored"] }
201208
num_enum = { version = "0.7", default-features = false }
@@ -217,7 +224,6 @@ syn = { version = "2.0", default-features = false, features = [
217224
"extra-traits",
218225
"proc-macro",
219226
] }
220-
kurbo = { version = "0.12", features = ["serde"] }
221227
lyon_geom = "1.0"
222228
petgraph = { version = "0.7", default-features = false, features = ["graphmap"] }
223229
half = { version = "2.4", default-features = false, features = ["bytemuck"] }
@@ -234,7 +240,6 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
234240
tracing = "0.1"
235241
rfd = "0.15"
236242
open = "5.3"
237-
polycool = "0.4"
238243
spin = "0.10"
239244
clap = "4.5"
240245
spirv-std = { git = "https://github.com/Firestar99/rust-gpu-new", rev = "c12f216121820580731440ee79ebc7403d6ea04f", features = ["bytemuck"] }

desktop/src/app.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use rand::Rng;
12
use rfd::AsyncFileDialog;
23
use std::fs;
34
use std::path::PathBuf;
@@ -16,7 +17,7 @@ use crate::event::{AppEvent, AppEventScheduler};
1617
use crate::persist::PersistentData;
1718
use crate::render::{RenderError, RenderState};
1819
use crate::window::Window;
19-
use crate::wrapper::messages::{DesktopFrontendMessage, DesktopWrapperMessage, InputMessage, MouseKeys, MouseState, Platform};
20+
use crate::wrapper::messages::{DesktopFrontendMessage, DesktopWrapperMessage, InputMessage, MouseKeys, MouseState};
2021
use crate::wrapper::{DesktopWrapper, NodeGraphExecutionResult, WgpuContext, serialize_frontend_messages};
2122

2223
pub(crate) struct App {
@@ -78,6 +79,8 @@ impl App {
7879
let mut persistent_data = PersistentData::default();
7980
persistent_data.load_from_disk();
8081

82+
let desktop_wrapper = DesktopWrapper::new(rand::rng().random());
83+
8184
Self {
8285
render_state: None,
8386
wgpu_context,
@@ -91,7 +94,7 @@ impl App {
9194
ui_scale: 1.,
9295
app_event_receiver,
9396
app_event_scheduler,
94-
desktop_wrapper: DesktopWrapper::new(),
97+
desktop_wrapper,
9598
last_ui_update: Instant::now(),
9699
cef_context,
97100
cef_schedule: Some(Instant::now()),
@@ -177,7 +180,7 @@ impl App {
177180
if let Some(path) = futures::executor::block_on(show_dialog)
178181
&& let Ok(content) = fs::read(&path)
179182
{
180-
let message = DesktopWrapperMessage::OpenFileDialogResult { path, content, context };
183+
let message = DesktopWrapperMessage::FileDialogResult { path, content, context };
181184
app_event_scheduler.schedule(AppEvent::DesktopWrapperMessage(message));
182185
}
183186
});
@@ -352,6 +355,11 @@ impl App {
352355
window.toggle_maximize();
353356
}
354357
}
358+
DesktopFrontendMessage::WindowFullscreen => {
359+
if let Some(window) = &mut self.window {
360+
window.toggle_fullscreen();
361+
}
362+
}
355363
DesktopFrontendMessage::WindowDrag => {
356364
if let Some(window) = &self.window {
357365
window.start_drag();
@@ -473,14 +481,6 @@ impl ApplicationHandler for App {
473481
self.resize();
474482

475483
self.desktop_wrapper.init(self.wgpu_context.clone());
476-
477-
#[cfg(target_os = "windows")]
478-
let platform = Platform::Windows;
479-
#[cfg(target_os = "macos")]
480-
let platform = Platform::Mac;
481-
#[cfg(target_os = "linux")]
482-
let platform = Platform::Linux;
483-
self.dispatch_desktop_wrapper_message(DesktopWrapperMessage::UpdatePlatform(platform));
484484
}
485485

486486
fn proxy_wake_up(&mut self, event_loop: &dyn ActiveEventLoop) {
@@ -550,7 +550,7 @@ impl ApplicationHandler for App {
550550
for path in paths {
551551
match fs::read(&path) {
552552
Ok(content) => {
553-
let message = DesktopWrapperMessage::OpenFile { path, content };
553+
let message = DesktopWrapperMessage::ImportFile { path, content };
554554
self.app_event_scheduler.schedule(AppEvent::DesktopWrapperMessage(message));
555555
}
556556
Err(e) => {

desktop/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub fn start() {
6666
}
6767
};
6868

69+
// Must be called before event loop initialization or native window integrations will break
6970
App::init();
7071

7172
let wgpu_context = futures::executor::block_on(gpu_context::create_wgpu_context());
@@ -78,9 +79,9 @@ pub fn start() {
7879

7980
let cef_handler = cef::CefHandler::new(wgpu_context.clone(), app_event_scheduler.clone(), cef_view_info_receiver);
8081
let cef_context = match cef_context_builder.initialize(cef_handler, cli.disable_ui_acceleration) {
81-
Ok(c) => {
82+
Ok(context) => {
8283
tracing::info!("CEF initialized successfully");
83-
c
84+
context
8485
}
8586
Err(cef::InitError::AlreadyRunning) => {
8687
tracing::error!("Another instance is already running, Exiting.");

0 commit comments

Comments
 (0)