Skip to main content

max / quasi

Show the palette's contract in the template's own tests The done-condition, pinned where the worked example is read: /palette answers with Over, is not a place, and lists what it can jump to.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-13 14:22 UTC
Signed with PGP, not checked
Commit: 52cee0845097e4a12fe422e8aa3d8b0749da35e7
Parent: d029843
2 files changed, +58 insertions, -1 deletion
M Cargo.lock +24 -1
@@ -787,7 +787,6 @@
787 787 [[package]]
788 788 name = "docengine"
789 789 version = "0.7.0"
790 - source = "git+https://makenot.work/git/max/docengine.git#6858555ec2c2e08e8834c867169c108a6aa3e9d2"
791 790 dependencies = [
792 791 "ammonia",
793 792 "pulldown-cmark",
@@ -5159,3 +5158,27 @@
5159 5158 version = "1.0.23"
5160 5159 source = "registry+https://github.com/rust-lang/crates.io-index"
5161 5160 checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
5161 +
5162 + [[patch.unused]]
5163 + name = "kberg"
5164 + version = "0.1.0"
5165 +
5166 + [[patch.unused]]
5167 + name = "ops-status"
5168 + version = "0.1.0"
5169 +
5170 + [[patch.unused]]
5171 + name = "painhours"
5172 + version = "0.1.0"
5173 +
5174 + [[patch.unused]]
5175 + name = "tagtree"
5176 + version = "0.4.0"
5177 +
5178 + [[patch.unused]]
5179 + name = "synckit-client"
5180 + version = "0.8.0"
5181 +
5182 + [[patch.unused]]
5183 + name = "synckit-config"
5184 + version = "0.2.0"
@@ -405,3 +405,37 @@
405 405 let cut = preview("**Bold**").expect("a preview");
406 406 assert!(matches!(cut, Prose::Text(_)), "got: {cut:?}");
407 407 }
408 +
409 + #[test]
410 + fn the_palette_is_drawn_over_the_screen_rather_than_replacing_it() {
411 + // The one route here that answers with `Over`. Both hosts draw it the same
412 + // way from this one description: the webview into its overlay container,
413 + // the terminal over the current screen. Neither has a line of palette code
414 + // in it -- what each declares is the key, because "ctrl+k" and "k" are the
415 + // same affordance spelled for two keyboards.
416 + let state = state();
417 + let response = get(&state, "/palette");
418 + let Outcome::Over(screen) = &response.outcome else {
419 + panic!("expected an overlay, got {:?}", response.outcome);
420 + };
421 + assert_eq!(screen.title, "Go to note");
422 + // Not a place: nothing to push, nothing to come back from.
423 + assert!(response.destination().is_none());
424 + assert!(response.target().is_none());
425 + }
426 +
427 + #[test]
428 + fn the_palette_offers_the_notes_it_can_jump_to() {
429 + let state = state();
430 + post(
431 + &state,
432 + "/note",
433 + Params::new().with("title", "Findable").with("body", "x"),
434 + );
435 + let response = get(&state, "/palette");
436 + let Outcome::Over(screen) = &response.outcome else {
437 + panic!("expected an overlay");
438 + };
439 + let listed = titles(&screen.slots[0]);
440 + assert!(listed.iter().any(|title| title == "Findable"), "{listed:?}");
441 + }