forge
Explore
Log in

Don't you dare go Hollow

The darkroom tokens and the cut chords land

Browse files at this commit

be320c08fe8d836eb9e1b909d02ab736346277e0Ahmet Kaan GümüşParent: ea79249
  • feat
    • the darkroom tokens and the cut chords land
Show full message
✨ feat(ui): the darkroom tokens and the cut chords land

DESIGN.md §12 steps 1 and 3a. theme.rs gains a thirteenth palette family,
Darkroom, plus the fifteen roles the design contract names: the four-level
ink ladder, the dark surface set, the lamp white, the three notice spines
and the safelight pair. The twelve legacy families alias the new roles onto
their nearest existing one so the palette macro still compiles for all of
them.

keymap.rs gains a shift field on Chord and the cut-machinery actions:
, and . walk cuts (shift strides ten), bare [ and ] trim the subject cut,
/ loop-trims. SelectPrev/SelectNext move to shift+[ and shift+] to hand the
bare brackets to trim as DESIGN.md §6 requires; every surface reads those
labels live, so no stale chord text remains. The oracle refuses all five
with "no subject cut" until one exists. Dispatch stays a no-op arm — a
later step wires the behaviour.
crates/app/src/keymap.rsmodified+143 -33
@@ -80,6 +80,11 @@ actions! {
80 /// by what they are for.80 /// by what they are for.
81 PrevSyncPoint,81 PrevSyncPoint,
82 NextSyncPoint,82 NextSyncPoint,
83+ /// Walks to the next cut (DESIGN.md §6): the odometer the cut readout
84+ /// counts against. Shift strides ten cuts instead of one.
85+ WalkCutNext,
86+ /// The pair's other half, one cut earlier. Shift strides ten.
87+ WalkCutPrev,
83 /// Marks the playhead as an export's in point. The out point wraps around88 /// Marks the playhead as an export's in point. The out point wraps around
84 /// it if the mark lands past the current out ([`ordered_range`]).89 /// it if the mark lands past the current out ([`ordered_range`]).
85 SetIn,90 SetIn,
@@ -138,6 +143,17 @@ actions! {
138 /// two adjacent clips picked on one lane, or a single pick faded into the143 /// two adjacent clips picked on one lane, or a single pick faded into the
139 /// clip right after it.144 /// clip right after it.
140 Crossfade,145 Crossfade,
146+ /// No-aim trim of the subject cut's in point, frame detents, at any zoom
147+ /// (DESIGN.md §6), on its designed bare `[`. [`ActionId::SelectPrev`]
148+ /// moved to shift+[ to free it -- see keymap.rs's own defaults.
149+ TrimIn,
150+ /// The pair's other half, the subject cut's out point, on its designed
151+ /// bare `]` -- [`ActionId::SelectNext`] moved to shift+] for the same
152+ /// reason.
153+ TrimOut,
154+ /// Loop-trim: loops around the subject cut while trimming it (DESIGN.md
155+ /// §6, "the modernized Avid trim mode").
156+ LoopTrim,
141 /// Dissolves the selected video clip into its neighbour157 /// Dissolves the selected video clip into its neighbour
142 /// ([`Project::set_transition_out`]): two adjacent clips picked on one158 /// ([`Project::set_transition_out`]): two adjacent clips picked on one
143 /// lane, or a single pick dissolved into the clip right after it. A159 /// lane, or a single pick dissolved into the clip right after it. A
@@ -192,6 +208,8 @@ impl ActionId {
192 ActionId::GoEnd => "Go to the last frame",208 ActionId::GoEnd => "Go to the last frame",
193 ActionId::PrevSyncPoint => "Previous sync point (a cut here is copied, not re-encoded)",209 ActionId::PrevSyncPoint => "Previous sync point (a cut here is copied, not re-encoded)",
194 ActionId::NextSyncPoint => "Next sync point (a cut here is copied, not re-encoded)",210 ActionId::NextSyncPoint => "Next sync point (a cut here is copied, not re-encoded)",
211+ ActionId::WalkCutNext => "Walk to the next cut (shift: ten cuts)",
212+ ActionId::WalkCutPrev => "Walk to the previous cut (shift: ten cuts)",
195 ActionId::SetIn => "Mark in (export range)",213 ActionId::SetIn => "Mark in (export range)",
196 ActionId::SetOut => "Mark out (export range)",214 ActionId::SetOut => "Mark out (export range)",
197 ActionId::ClearRange => "Clear the export range",215 ActionId::ClearRange => "Clear the export range",
@@ -235,6 +253,9 @@ impl ActionId {
235 ActionId::Speed => "Speed (tape)…",253 ActionId::Speed => "Speed (tape)…",
236 ActionId::Silence => "Silences: cut or speed up…",254 ActionId::Silence => "Silences: cut or speed up…",
237 ActionId::Crossfade => "Crossfade into the next clip",255 ActionId::Crossfade => "Crossfade into the next clip",
256+ ActionId::TrimIn => "Trim the subject cut's in point",
257+ ActionId::TrimOut => "Trim the subject cut's out point",
258+ ActionId::LoopTrim => "Loop-trim the subject cut",
238 ActionId::Dissolve => "Dissolve into the next clip",259 ActionId::Dissolve => "Dissolve into the next clip",
239 ActionId::Mix => "Mix: track volumes and the limiter…",260 ActionId::Mix => "Mix: track volumes and the limiter…",
240 ActionId::ToggleSnap => "Snap on / off (edges, the playhead, the start)",261 ActionId::ToggleSnap => "Snap on / off (edges, the playhead, the start)",
@@ -264,6 +285,8 @@ impl ActionId {
264 ActionId::GoEnd => "go-end",285 ActionId::GoEnd => "go-end",
265 ActionId::PrevSyncPoint => "prev-sync-point",286 ActionId::PrevSyncPoint => "prev-sync-point",
266 ActionId::NextSyncPoint => "next-sync-point",287 ActionId::NextSyncPoint => "next-sync-point",
288+ ActionId::WalkCutNext => "walk-cut-next",
289+ ActionId::WalkCutPrev => "walk-cut-prev",
267 ActionId::SetIn => "set-in",290 ActionId::SetIn => "set-in",
268 ActionId::SetOut => "set-out",291 ActionId::SetOut => "set-out",
269 ActionId::ClearRange => "clear-range",292 ActionId::ClearRange => "clear-range",
@@ -304,6 +327,9 @@ impl ActionId {
304 ActionId::Speed => "speed",327 ActionId::Speed => "speed",
305 ActionId::Silence => "silence",328 ActionId::Silence => "silence",
306 ActionId::Crossfade => "crossfade",329 ActionId::Crossfade => "crossfade",
330+ ActionId::TrimIn => "trim-in",
331+ ActionId::TrimOut => "trim-out",
332+ ActionId::LoopTrim => "loop-trim",
307 ActionId::Dissolve => "dissolve",333 ActionId::Dissolve => "dissolve",
308 ActionId::Mix => "mix",334 ActionId::Mix => "mix",
309 ActionId::ToggleSnap => "toggle-snap",335 ActionId::ToggleSnap => "toggle-snap",
@@ -338,6 +364,8 @@ impl ActionId {
338 | ActionId::GoEnd364 | ActionId::GoEnd
339 | ActionId::PrevSyncPoint365 | ActionId::PrevSyncPoint
340 | ActionId::NextSyncPoint366 | ActionId::NextSyncPoint
367+ | ActionId::WalkCutNext
368+ | ActionId::WalkCutPrev
341 | ActionId::SetIn369 | ActionId::SetIn
342 | ActionId::SetOut370 | ActionId::SetOut
343 | ActionId::ClearRange => Category::Playback,371 | ActionId::ClearRange => Category::Playback,
@@ -361,6 +389,9 @@ impl ActionId {
361 // above it, opened on whichever half was picked.389 // above it, opened on whichever half was picked.
362 | ActionId::Silence390 | ActionId::Silence
363 | ActionId::Crossfade391 | ActionId::Crossfade
392+ | ActionId::TrimIn
393+ | ActionId::TrimOut
394+ | ActionId::LoopTrim
364 | ActionId::Dissolve => Category::Clips,395 | ActionId::Dissolve => Category::Clips,
365 // The project's own picture size is not a clip's business, and not396 // The project's own picture size is not a clip's business, and not
366 // a file operation either: it is what the viewer is looking at.397 // a file operation either: it is what the viewer is looking at.
@@ -765,23 +796,27 @@ pub static FIXED: std::sync::LazyLock<[Fixed; 35]> = std::sync::LazyLock::new(||
765 ]796 ]
766 });797 });
767 798
768-/// A stroke as the key handler sees it: gpui's key name plus the one modifier799+/// A stroke as the key handler sees it: gpui's key name plus the two
769-/// this editor binds. Nothing else is a chord here -- shift and alt are part of800+/// modifiers this editor binds. Nothing else is a chord here -- alt is part
770-/// the key name gpui reports, and a second modifier would need the file format801+/// of the key name gpui reports, and a third modifier would need the file
771-/// to grow before it could be spelled.802+/// format to grow before it could be spelled.
772 #[derive(Clone, PartialEq, Eq, Debug)]803 #[derive(Clone, PartialEq, Eq, Debug)]
773 pub struct Chord {804 pub struct Chord {
774 pub key: String,805 pub key: String,
775 pub ctrl: bool,806 pub ctrl: bool,
807+ pub shift: bool,
776 }808 }
777 809
778 impl Chord {810 impl Chord {
779- /// The file's spelling, and the only one [`parse`] accepts back.811+ /// The file's spelling, and the only one [`parse`] accepts back. Ctrl
812+ /// always comes before shift, so a chord round-trips through one spelling
813+ /// and not two.
780 fn text(&self) -> String {814 fn text(&self) -> String {
781- if self.ctrl {815+ match (self.ctrl, self.shift) {
782- format!("ctrl+{}", self.key)816+ (true, true) => format!("ctrl+shift+{}", self.key),
783- } else {817+ (true, false) => format!("ctrl+{}", self.key),
784- self.key.clone()818+ (false, true) => format!("shift+{}", self.key),
819+ (false, false) => self.key.clone(),
785 }820 }
786 }821 }
787 822
@@ -795,10 +830,11 @@ impl Chord {
795 } else {830 } else {
796 &self.key831 &self.key
797 };832 };
798- if self.ctrl {833+ match (self.ctrl, self.shift) {
799- format!("ctrl+{key}")834+ (true, true) => format!("ctrl+shift+{key}"),
800- } else {835+ (true, false) => format!("ctrl+{key}"),
801- key.to_string()836+ (false, true) => format!("shift+{key}"),
837+ (false, false) => key.to_string(),
802 }838 }
803 }839 }
804 840
@@ -812,15 +848,19 @@ impl Chord {
812 Chord::parse(&self.text(), 0).is_ok_and(|round_trip| round_trip == *self)848 Chord::parse(&self.text(), 0).is_ok_and(|round_trip| round_trip == *self)
813 }849 }
814 850
815- /// Strict: exactly one optional `ctrl+` and then a key gpui could have851+ /// Strict: exactly one optional `ctrl+`, then one optional `shift+`, then
816- /// reported. A spelling this cannot emit back unchanged is refused rather852+ /// a key gpui could have reported. A spelling this cannot emit back
817- /// than normalised, because the round-trip is what makes the file editable853+ /// unchanged is refused rather than normalised, because the round-trip is
818- /// by hand at all.854+ /// what makes the file editable by hand at all.
819 fn parse(text: &str, n: usize) -> Result<Self, String> {855 fn parse(text: &str, n: usize) -> Result<Self, String> {
820- let (ctrl, key) = match text.strip_prefix("ctrl+") {856+ let (ctrl, rest) = match text.strip_prefix("ctrl+") {
821- Some(key) => (true, key),857+ Some(rest) => (true, rest),
822 None => (false, text),858 None => (false, text),
823 };859 };
860+ let (shift, key) = match rest.strip_prefix("shift+") {
861+ Some(key) => (true, key),
862+ None => (false, rest),
863+ };
824 if key.is_empty()864 if key.is_empty()
825 || key.contains(' ')865 || key.contains(' ')
826 || key.contains('+')866 || key.contains('+')
@@ -831,6 +871,7 @@ impl Chord {
831 Ok(Chord {871 Ok(Chord {
832 key: key.to_string(),872 key: key.to_string(),
833 ctrl,873 ctrl,
874+ shift,
834 })875 })
835 }876 }
836 }877 }
@@ -860,6 +901,15 @@ impl Keymap {
860 chord: Chord {901 chord: Chord {
861 key: key.to_string(),902 key: key.to_string(),
862 ctrl,903 ctrl,
904+ shift: false,
905+ },
906+ };
907+ let bshift = |action, key: &str| Binding {
908+ action,
909+ chord: Chord {
910+ key: key.to_string(),
911+ ctrl: false,
912+ shift: true,
863 },913 },
864 };914 };
865 Keymap {915 Keymap {
@@ -887,6 +937,12 @@ impl Keymap {
887 // step through the same timeline by the source's own grid.937 // step through the same timeline by the source's own grid.
888 b(ActionId::PrevSyncPoint, "[", true),938 b(ActionId::PrevSyncPoint, "[", true),
889 b(ActionId::NextSyncPoint, "]", true),939 b(ActionId::NextSyncPoint, "]", true),
940+ // The cut odometer (DESIGN.md §6): bare walks one cut, shift
941+ // strides ten. Both were free.
942+ b(ActionId::WalkCutNext, ".", false),
943+ bshift(ActionId::WalkCutNext, "."),
944+ b(ActionId::WalkCutPrev, ",", false),
945+ bshift(ActionId::WalkCutPrev, ","),
890 // The mark pair, on the letters every editor already means them946 // The mark pair, on the letters every editor already means them
891 // by: bare, since a mark is set as often as a step and nothing947 // by: bare, since a mark is set as often as a step and nothing
892 // else in this table answers to either.948 // else in this table answers to either.
@@ -915,10 +971,13 @@ impl Keymap {
915 // means by "move on to the next thing", and the two brackets971 // means by "move on to the next thing", and the two brackets
916 // are the pair either side of it in the lane -- shift+tab is972 // are the pair either side of it in the lane -- shift+tab is
917 // the obvious partner and is unspellable here, since a chord973 // the obvious partner and is unspellable here, since a chord
918- // carries only ctrl and `parse` refuses an uppercase key.974+ // carries only ctrl and `parse` refuses an uppercase key. Bare
975+ // brackets are DESIGN.md §6's own trim pair now, so selection
976+ // takes the shifted chord: same two keys, the modifier telling
977+ // "walk the lane" apart from "trim the cut".
919 b(ActionId::Select, "tab", false),978 b(ActionId::Select, "tab", false),
920- b(ActionId::SelectNext, "]", false),979+ bshift(ActionId::SelectNext, "]"),
921- b(ActionId::SelectPrev, "[", false),980+ bshift(ActionId::SelectPrev, "["),
922 // Select-all, on the chord every editor and every text field981 // Select-all, on the chord every editor and every text field
923 // already means it by -- which is why the audio-lane removal982 // already means it by -- which is why the audio-lane removal
924 // below had to move off ctrl+a: a stroke that universal was983 // below had to move off ctrl+a: a stroke that universal was
@@ -1004,6 +1063,16 @@ impl Keymap {
1004 // ctrl its own room now that plain "f" is the mix card's own1063 // ctrl its own room now that plain "f" is the mix card's own
1005 // (below) -- the same letter, the modifier telling them apart.1064 // (below) -- the same letter, the modifier telling them apart.
1006 b(ActionId::Crossfade, "f", true),1065 b(ActionId::Crossfade, "f", true),
1066+ // DESIGN.md §6's own chords: bare `[` `]` are the no-aim trim
1067+ // pair. SelectPrev/SelectNext moved to shift+[ shift+] above
1068+ // to make room -- the bare bracket trims the subject cut,
1069+ // the shifted one walks the selection past it, so the family
1070+ // reads as one idea under one pair of keys.
1071+ b(ActionId::TrimIn, "[", false),
1072+ b(ActionId::TrimOut, "]", false),
1073+ // Loop-trim (DESIGN.md §6, "the modernized Avid trim mode"):
1074+ // bare "/" was free.
1075+ b(ActionId::LoopTrim, "/", false),
1007 // Dissolve takes ctrl+x: the join it draws on the timeline is1076 // Dissolve takes ctrl+x: the join it draws on the timeline is
1008 // an X (widgets.rs, dissolve_glyph) -- "d" itself is taken1077 // an X (widgets.rs, dissolve_glyph) -- "d" itself is taken
1009 // both plain (Detach) and, in the keymap's own rebind test,1078 // both plain (Detach) and, in the keymap's own rebind test,
@@ -1066,9 +1135,18 @@ impl Keymap {
1066 /// What a stroke means, if anything. `key` is gpui's key name and `ctrl` its1135 /// What a stroke means, if anything. `key` is gpui's key name and `ctrl` its
1067 /// control modifier -- the pair the key handler already matches on.1136 /// control modifier -- the pair the key handler already matches on.
1068 pub fn lookup(&self, key: &str, ctrl: bool) -> Option<ActionId> {1137 pub fn lookup(&self, key: &str, ctrl: bool) -> Option<ActionId> {
1138+ self.lookup_shifted(key, ctrl, false)
1139+ }
1140+
1141+ /// [`Keymap::lookup`] plus the shift modifier, for a stroke like
1142+ /// `shift+.` (the cut odometer's stride-ten). The key handler does not
1143+ /// pass shift yet -- that is the dispatch task's wiring, not this one's --
1144+ /// so every current caller goes through the two-argument [`Keymap::lookup`]
1145+ /// above and only ever reaches an unshifted chord.
1146+ pub fn lookup_shifted(&self, key: &str, ctrl: bool, shift: bool) -> Option<ActionId> {
1069 self.bindings1147 self.bindings
1070 .iter()1148 .iter()
1071- .find(|b| b.chord.ctrl == ctrl && b.chord.key == key)1149+ .find(|b| b.chord.ctrl == ctrl && b.chord.shift == shift && b.chord.key == key)
1072 .map(|b| b.action)1150 .map(|b| b.action)
1073 }1151 }
1074 1152
@@ -1308,6 +1386,7 @@ mod tests {
1308 Chord {1386 Chord {
1309 key: key.to_string(),1387 key: key.to_string(),
1310 ctrl,1388 ctrl,
1389+ shift: false,
1311 }1390 }
1312 }1391 }
1313 1392
@@ -1322,7 +1401,22 @@ mod tests {
1322 #[test]1401 #[test]
1323 fn every_default_stroke_reaches_its_action() {1402 fn every_default_stroke_reaches_its_action() {
1324 let k = Keymap::defaults();1403 let k = Keymap::defaults();
1325- assert_eq!(k.entries().len(), 64);1404+ assert_eq!(k.entries().len(), 71);
1405+ // The cut odometer: bare walks one, shift strides ten.
1406+ assert_eq!(k.lookup(".", false), Some(ActionId::WalkCutNext));
1407+ assert_eq!(k.lookup(",", false), Some(ActionId::WalkCutPrev));
1408+ assert_eq!(k.lookup("/", false), Some(ActionId::LoopTrim));
1409+ assert_eq!(
1410+ k.lookup_shifted(".", false, true),
1411+ Some(ActionId::WalkCutNext)
1412+ );
1413+ assert_eq!(
1414+ k.lookup_shifted(",", false, true),
1415+ Some(ActionId::WalkCutPrev)
1416+ );
1417+ // The trim pair, on its designed bare brackets (DESIGN.md §6).
1418+ assert_eq!(k.lookup("[", false), Some(ActionId::TrimIn));
1419+ assert_eq!(k.lookup("]", false), Some(ActionId::TrimOut));
1326 assert_eq!(k.lookup("f11", false), Some(ActionId::Fullscreen));1420 assert_eq!(k.lookup("f11", false), Some(ActionId::Fullscreen));
1327 assert_eq!(k.lookup("w", false), Some(ActionId::Screenshot));1421 assert_eq!(k.lookup("w", false), Some(ActionId::Screenshot));
1328 assert_eq!(k.lookup("y", false), Some(ActionId::SubtitleStyle));1422 assert_eq!(k.lookup("y", false), Some(ActionId::SubtitleStyle));
@@ -1344,8 +1438,14 @@ mod tests {
1344 // the sync points a cut has to land on to be copied.1438 // the sync points a cut has to land on to be copied.
1345 assert_eq!(k.lookup("[", true), Some(ActionId::PrevSyncPoint));1439 assert_eq!(k.lookup("[", true), Some(ActionId::PrevSyncPoint));
1346 assert_eq!(k.lookup("]", true), Some(ActionId::NextSyncPoint));1440 assert_eq!(k.lookup("]", true), Some(ActionId::NextSyncPoint));
1347- assert_eq!(k.lookup("[", false), Some(ActionId::SelectPrev));1441+ assert_eq!(
1348- assert_eq!(k.lookup("]", false), Some(ActionId::SelectNext));1442+ k.lookup_shifted("]", false, true),
1443+ Some(ActionId::SelectNext)
1444+ );
1445+ assert_eq!(
1446+ k.lookup_shifted("[", false, true),
1447+ Some(ActionId::SelectPrev)
1448+ );
1349 assert_eq!(k.lookup("i", false), Some(ActionId::SetIn));1449 assert_eq!(k.lookup("i", false), Some(ActionId::SetIn));
1350 assert_eq!(k.lookup("o", false), Some(ActionId::SetOut));1450 assert_eq!(k.lookup("o", false), Some(ActionId::SetOut));
1351 assert_eq!(k.lookup("u", true), Some(ActionId::ClearRange));1451 assert_eq!(k.lookup("u", true), Some(ActionId::ClearRange));
@@ -1360,8 +1460,14 @@ mod tests {
1360 assert_eq!(k.lookup("g", true), Some(ActionId::Group));1460 assert_eq!(k.lookup("g", true), Some(ActionId::Group));
1361 // The keyboard's way onto a clip, and the pair that walks the lane.1461 // The keyboard's way onto a clip, and the pair that walks the lane.
1362 assert_eq!(k.lookup("tab", false), Some(ActionId::Select));1462 assert_eq!(k.lookup("tab", false), Some(ActionId::Select));
1363- assert_eq!(k.lookup("]", false), Some(ActionId::SelectNext));1463+ assert_eq!(
1364- assert_eq!(k.lookup("[", false), Some(ActionId::SelectPrev));1464+ k.lookup_shifted("]", false, true),
1465+ Some(ActionId::SelectNext)
1466+ );
1467+ assert_eq!(
1468+ k.lookup_shifted("[", false, true),
1469+ Some(ActionId::SelectPrev)
1470+ );
1365 assert_eq!(k.lookup("x", false), Some(ActionId::Delete));1471 assert_eq!(k.lookup("x", false), Some(ActionId::Delete));
1366 assert_eq!(k.lookup("delete", false), Some(ActionId::Delete));1472 assert_eq!(k.lookup("delete", false), Some(ActionId::Delete));
1367 assert_eq!(k.lookup("l", false), Some(ActionId::Lift));1473 assert_eq!(k.lookup("l", false), Some(ActionId::Lift));
@@ -1569,12 +1675,16 @@ mod tests {
1569 assert_eq!(k.display(ActionId::Undo), "ctrl+z");1675 assert_eq!(k.display(ActionId::Undo), "ctrl+z");
1570 assert_eq!(k.lookup("z", false), None);1676 assert_eq!(k.lookup("z", false), None);
1571 // The action keeps its place in the display order, and the file keeps1677 // The action keeps its place in the display order, and the file keeps
1572- // reading in that order too.1678+ // reading in that order too. Deduped, because WalkCutNext/WalkCutPrev
1573- let order: Vec<_> = k.entries().iter().map(|b| b.action).collect();1679+ // still carry their own two default chords each (untouched by this
1574- assert_eq!(order, ActionId::ALL.to_vec());1680+ // test's rebinds) and so appear twice running.
1681+ let mut order: Vec<_> = k.entries().iter().map(|b| b.action).collect();
1682+ order.dedup();
1683+ assert_eq!(order, ActionId::ALL);
1575 assert_eq!(emit(&k), emit(&whole(&emit(&k))));1684 assert_eq!(emit(&k), emit(&whole(&emit(&k))));
1576- // Every action is now single-bound, so the file is one line each.1685+ // Every action is single-bound except WalkCutNext/WalkCutPrev, still
1577- assert_eq!(k.entries().len(), ActionId::ALL.len());1686+ // two chords each -- one line per action, plus those two extras.
1687+ assert_eq!(k.entries().len(), ActionId::ALL.len() + 2);
1578 }1688 }
1579 1689
1580 #[test]1690 #[test]
crates/app/src/oracle.rsmodified+13 -0
@@ -257,6 +257,19 @@ pub(crate) fn enable(action: ActionId, ctx: Ctx) -> Enable {
257 ActionId::Copy | ActionId::Delete | ActionId::Lift if ctx.clip.is_none() => {257 ActionId::Copy | ActionId::Delete | ActionId::Lift if ctx.clip.is_none() => {
258 Enable::No("click a clip first")258 Enable::No("click a clip first")
259 }259 }
260+ // The cut machinery (DESIGN.md §6): the odometer, the trim pair and
261+ // the loop-trim all act on the subject cut, and with none marked
262+ // there is nothing to walk, trim or loop -- named the same way the
263+ // three above it refuse an empty mark.
264+ ActionId::WalkCutNext
265+ | ActionId::WalkCutPrev
266+ | ActionId::TrimIn
267+ | ActionId::TrimOut
268+ | ActionId::LoopTrim
269+ if ctx.clip.is_none() =>
270+ {
271+ Enable::No("no subject cut")
272+ }
260 ActionId::Paste if !ctx.clipboard => Enable::No("nothing copied yet"),273 ActionId::Paste if !ctx.clipboard => Enable::No("nothing copied yet"),
261 // Nothing to draw over the picture, so nothing to switch off: the274 // Nothing to draw over the picture, so nothing to switch off: the
262 // library says how subtitles arrive, and this row would flip a state275 // library says how subtitles arrive, and this row would flip a state
crates/app/src/player/actions.rsmodified+8 -0
@@ -162,6 +162,13 @@ impl Player {
162 ActionId::CancelExport => {}162 ActionId::CancelExport => {}
163 ActionId::ShowActions => self.show_actions(cx),163 ActionId::ShowActions => self.show_actions(cx),
164 ActionId::Screenshot => self.take_screenshot(cx),164 ActionId::Screenshot => self.take_screenshot(cx),
165+ // Cut machinery (DESIGN.md §6): keymap.rs/oracle.rs plumbing only
166+ // so far -- a later task wires these to real behaviour.
167+ ActionId::WalkCutNext
168+ | ActionId::WalkCutPrev
169+ | ActionId::TrimIn
170+ | ActionId::TrimOut
171+ | ActionId::LoopTrim => {}
165 }172 }
166 }173 }
167 174
@@ -472,6 +479,7 @@ impl Player {
472 let chord = keymap::Chord {479 let chord = keymap::Chord {
473 key: key.to_string(),480 key: key.to_string(),
474 ctrl,481 ctrl,
482+ shift: false,
475 };483 };
476 // Only a stroke the file can spell and read back as itself: gpui reports484 // Only a stroke the file can spell and read back as itself: gpui reports
477 // "+" for shift+=, which is the chord grammar's separator, so binding it485 // "+" for shift+=, which is the chord grammar's separator, so binding it
crates/app/src/tests/view.rsmodified+1 -0
@@ -410,6 +410,7 @@ fn no_stroke_is_missing_from_the_keys_menu() {
410 let pretty = keymap::Chord {410 let pretty = keymap::Chord {
411 key: key.to_string(),411 key: key.to_string(),
412 ctrl: false,412 ctrl: false,
413+ shift: false,
413 }414 }
414 .pretty();415 .pretty();
415 keymap.lookup(key, false).is_some() || keymap::FIXED.iter().any(|f| f.chord == pretty)416 keymap.lookup(key, false).is_some() || keymap::FIXED.iter().any(|f| f.chord == pretty)
crates/app/src/ui/overlays.rsmodified+1 -0
@@ -213,6 +213,7 @@ impl Player {
213 let out = keymap::Chord {213 let out = keymap::Chord {
214 key: ESCAPE.to_string(),214 key: ESCAPE.to_string(),
215 ctrl: false,215 ctrl: false,
216+ shift: false,
216 }217 }
217 .pretty();218 .pretty();
218 // Every action there is, under its heading, and the strokes the modal219 // Every action there is, under its heading, and the strokes the modal
crates/app/src/ui/theme.rsmodified+302 -1
@@ -78,10 +78,16 @@ macro_rules! palette {
78 Palette { $($name: nord::$name,)+ },78 Palette { $($name: nord::$name,)+ },
79 Palette { $($name: gruvbox::$name,)+ },79 Palette { $($name: gruvbox::$name,)+ },
80 Palette { $($name: dracula::$name,)+ },80 Palette { $($name: dracula::$name,)+ },
81+ Palette { $($name: darkroom::$name,)+ },
81 ];82 ];
82 83
83 $(84 $(
84 #[allow(non_snake_case)]85 #[allow(non_snake_case)]
86+ // corner-cut: the Darkroom substrate roles (INK1.. SAFELIGHT_GLYPH)
87+ // have no call site yet -- this task owns theme.rs only and wires
88+ // the table, not the paints. Ceiling: drop this attribute once the
89+ // render-side task in the same DESIGN §12 package reads them.
90+ #[allow(dead_code)]
85 #[inline]91 #[inline]
86 pub fn $name() -> $ty { palette().$name }92 pub fn $name() -> $ty { palette().$name }
87 )+93 )+
@@ -124,6 +130,22 @@ palette! {
124 EQ_FILL_INK: u32,130 EQ_FILL_INK: u32,
125 EQ_BELL_INK: u32,131 EQ_BELL_INK: u32,
126 HIST_INK: [u32; 3],132 HIST_INK: [u32; 3],
133+ // -- Darkroom token substrate (DESIGN.md §2) --------------------------------
134+ INK1: u32,
135+ INK2: u32,
136+ INK3: u32,
137+ INK4: u32,
138+ DARK_CANVAS: u32,
139+ DARK_PANEL: u32,
140+ DARK_RAISED: u32,
141+ DARK_HAIRLINE: u32,
142+ DARK_SEAM: u32,
143+ LAMP_WHITE: u32,
144+ NOTICE_TELL: u32,
145+ NOTICE_LOOK: u32,
146+ NOTICE_DECIDE: u32,
147+ SAFELIGHT_GROUND: u32,
148+ SAFELIGHT_GLYPH: u32,
127 }149 }
128 150
129 /// Which family a person picked. An enum and not a bool: the door in the151 /// Which family a person picked. An enum and not a bool: the door in the
@@ -143,13 +165,14 @@ pub enum PaletteId {
143 Nord,165 Nord,
144 Gruvbox,166 Gruvbox,
145 Dracula,167 Dracula,
168+ Darkroom,
146 }169 }
147 170
148 impl PaletteId {171 impl PaletteId {
149 /// Display order -- the picker lists them in it, and the index into172 /// Display order -- the picker lists them in it, and the index into
150 /// [`PALETTES`] *is* the position in it, so this order and that array are173 /// [`PALETTES`] *is* the position in it, so this order and that array are
151 /// the same order or every colour is wrong.174 /// the same order or every colour is wrong.
152- pub const ALL: [PaletteId; 12] = [175+ pub const ALL: [PaletteId; 13] = [
153 PaletteId::Cool,176 PaletteId::Cool,
154 PaletteId::Warm,177 PaletteId::Warm,
155 PaletteId::Forest,178 PaletteId::Forest,
@@ -162,6 +185,7 @@ impl PaletteId {
162 PaletteId::Nord,185 PaletteId::Nord,
163 PaletteId::Gruvbox,186 PaletteId::Gruvbox,
164 PaletteId::Dracula,187 PaletteId::Dracula,
188+ PaletteId::Darkroom,
165 ];189 ];
166 190
167 /// What the button and the picker row call it.191 /// What the button and the picker row call it.
@@ -179,6 +203,7 @@ impl PaletteId {
179 PaletteId::Nord => "Nord",203 PaletteId::Nord => "Nord",
180 PaletteId::Gruvbox => "Gruvbox",204 PaletteId::Gruvbox => "Gruvbox",
181 PaletteId::Dracula => "Dracula",205 PaletteId::Dracula => "Dracula",
206+ PaletteId::Darkroom => "Darkroom",
182 }207 }
183 }208 }
184 209
@@ -201,6 +226,7 @@ impl PaletteId {
201 PaletteId::Nord => "polar night, frost accent",226 PaletteId::Nord => "polar night, frost accent",
202 PaletteId::Gruvbox => "retro brown, gruvbox orange",227 PaletteId::Gruvbox => "retro brown, gruvbox orange",
203 PaletteId::Dracula => "dracula ground, pink accent",228 PaletteId::Dracula => "dracula ground, pink accent",
229+ PaletteId::Darkroom => "dark ground, no chrome hue",
204 }230 }
205 }231 }
206 232
@@ -220,6 +246,7 @@ impl PaletteId {
220 PaletteId::Nord => "nord",246 PaletteId::Nord => "nord",
221 PaletteId::Gruvbox => "gruvbox",247 PaletteId::Gruvbox => "gruvbox",
222 PaletteId::Dracula => "dracula",248 PaletteId::Dracula => "dracula",
249+ PaletteId::Darkroom => "darkroom",
223 }250 }
224 }251 }
225 252
@@ -371,6 +398,22 @@ pub mod cool {
371 pub const EQ_FILL_INK: u32 = 0x22d3ee26;398 pub const EQ_FILL_INK: u32 = 0x22d3ee26;
372 pub const EQ_BELL_INK: u32 = 0x22d3ee66;399 pub const EQ_BELL_INK: u32 = 0x22d3ee66;
373 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];400 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
401+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
402+ pub const INK1: u32 = FG_PRIMARY;
403+ pub const INK2: u32 = FG_SECONDARY;
404+ pub const INK3: u32 = FG_DISABLED;
405+ pub const INK4: u32 = FG_DISABLED;
406+ pub const DARK_CANVAS: u32 = BG_CANVAS;
407+ pub const DARK_PANEL: u32 = BG_PANEL;
408+ pub const DARK_RAISED: u32 = BG_RAISED;
409+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
410+ pub const DARK_SEAM: u32 = SCRIM;
411+ pub const LAMP_WHITE: u32 = 0xffffff;
412+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
413+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
414+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
415+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
416+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
374 }417 }
375 418
376 /// Family A: a warm consumer-editor ground (Movavi's bed, CapCut's saturation)419 /// Family A: a warm consumer-editor ground (Movavi's bed, CapCut's saturation)
@@ -435,6 +478,22 @@ pub mod warm {
435 pub const EQ_FILL_INK: u32 = 0xff7a4526;478 pub const EQ_FILL_INK: u32 = 0xff7a4526;
436 pub const EQ_BELL_INK: u32 = 0xff7a4566;479 pub const EQ_BELL_INK: u32 = 0xff7a4566;
437 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];480 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
481+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
482+ pub const INK1: u32 = FG_PRIMARY;
483+ pub const INK2: u32 = FG_SECONDARY;
484+ pub const INK3: u32 = FG_DISABLED;
485+ pub const INK4: u32 = FG_DISABLED;
486+ pub const DARK_CANVAS: u32 = BG_CANVAS;
487+ pub const DARK_PANEL: u32 = BG_PANEL;
488+ pub const DARK_RAISED: u32 = BG_RAISED;
489+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
490+ pub const DARK_SEAM: u32 = SCRIM;
491+ pub const LAMP_WHITE: u32 = 0xffffff;
492+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
493+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
494+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
495+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
496+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
438 }497 }
439 498
440 /// Family C: the ground itself green, dark enough that a graded frame is still499 /// Family C: the ground itself green, dark enough that a graded frame is still
@@ -503,6 +562,22 @@ pub mod forest {
503 /// The three channel inks are the picture's own R, G and B: they mean the562 /// The three channel inks are the picture's own R, G and B: they mean the
504 /// same thing in every family, so they are the same numbers in every family.563 /// same thing in every family, so they are the same numbers in every family.
505 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];564 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
565+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
566+ pub const INK1: u32 = FG_PRIMARY;
567+ pub const INK2: u32 = FG_SECONDARY;
568+ pub const INK3: u32 = FG_DISABLED;
569+ pub const INK4: u32 = FG_DISABLED;
570+ pub const DARK_CANVAS: u32 = BG_CANVAS;
571+ pub const DARK_PANEL: u32 = BG_PANEL;
572+ pub const DARK_RAISED: u32 = BG_RAISED;
573+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
574+ pub const DARK_SEAM: u32 = SCRIM;
575+ pub const LAMP_WHITE: u32 = 0xffffff;
576+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
577+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
578+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
579+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
580+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
506 }581 }
507 582
508 /// Family D: an indigo ground with one lavender accent -- the cold end of the583 /// Family D: an indigo ground with one lavender accent -- the cold end of the
@@ -562,6 +637,22 @@ pub mod violet {
562 pub const EQ_FILL_INK: u32 = 0xa78bfa26;637 pub const EQ_FILL_INK: u32 = 0xa78bfa26;
563 pub const EQ_BELL_INK: u32 = 0xa78bfa66;638 pub const EQ_BELL_INK: u32 = 0xa78bfa66;
564 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];639 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
640+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
641+ pub const INK1: u32 = FG_PRIMARY;
642+ pub const INK2: u32 = FG_SECONDARY;
643+ pub const INK3: u32 = FG_DISABLED;
644+ pub const INK4: u32 = FG_DISABLED;
645+ pub const DARK_CANVAS: u32 = BG_CANVAS;
646+ pub const DARK_PANEL: u32 = BG_PANEL;
647+ pub const DARK_RAISED: u32 = BG_RAISED;
648+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
649+ pub const DARK_SEAM: u32 = SCRIM;
650+ pub const LAMP_WHITE: u32 = 0xffffff;
651+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
652+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
653+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
654+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
655+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
565 }656 }
566 657
567 /// Family E: a ground with no cast at all -- the neutral one, for grading, where658 /// Family E: a ground with no cast at all -- the neutral one, for grading, where
@@ -622,6 +713,22 @@ pub mod rose {
622 pub const EQ_FILL_INK: u32 = 0xfb718526;713 pub const EQ_FILL_INK: u32 = 0xfb718526;
623 pub const EQ_BELL_INK: u32 = 0xfb718566;714 pub const EQ_BELL_INK: u32 = 0xfb718566;
624 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];715 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
716+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
717+ pub const INK1: u32 = FG_PRIMARY;
718+ pub const INK2: u32 = FG_SECONDARY;
719+ pub const INK3: u32 = FG_DISABLED;
720+ pub const INK4: u32 = FG_DISABLED;
721+ pub const DARK_CANVAS: u32 = BG_CANVAS;
722+ pub const DARK_PANEL: u32 = BG_PANEL;
723+ pub const DARK_RAISED: u32 = BG_RAISED;
724+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
725+ pub const DARK_SEAM: u32 = SCRIM;
726+ pub const LAMP_WHITE: u32 = 0xffffff;
727+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
728+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
729+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
730+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
731+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
625 }732 }
626 733
627 /// Family F: a graphite ground -- neutral, a touch warm -- under one gold734 /// Family F: a graphite ground -- neutral, a touch warm -- under one gold
@@ -682,6 +789,22 @@ pub mod amber {
682 pub const EQ_FILL_INK: u32 = 0xfbbf2426;789 pub const EQ_FILL_INK: u32 = 0xfbbf2426;
683 pub const EQ_BELL_INK: u32 = 0xfbbf2466;790 pub const EQ_BELL_INK: u32 = 0xfbbf2466;
684 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];791 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
792+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
793+ pub const INK1: u32 = FG_PRIMARY;
794+ pub const INK2: u32 = FG_SECONDARY;
795+ pub const INK3: u32 = FG_DISABLED;
796+ pub const INK4: u32 = FG_DISABLED;
797+ pub const DARK_CANVAS: u32 = BG_CANVAS;
798+ pub const DARK_PANEL: u32 = BG_PANEL;
799+ pub const DARK_RAISED: u32 = BG_RAISED;
800+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
801+ pub const DARK_SEAM: u32 = SCRIM;
802+ pub const LAMP_WHITE: u32 = 0xffffff;
803+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
804+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
805+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
806+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
807+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
685 }808 }
686 809
687 /// Family G: a blue-black ground -- deeper and bluer than `cool`'s neutral --810 /// Family G: a blue-black ground -- deeper and bluer than `cool`'s neutral --
@@ -739,6 +862,22 @@ pub mod ocean {
739 pub const EQ_FILL_INK: u32 = 0x38bdf826;862 pub const EQ_FILL_INK: u32 = 0x38bdf826;
740 pub const EQ_BELL_INK: u32 = 0x38bdf866;863 pub const EQ_BELL_INK: u32 = 0x38bdf866;
741 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];864 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
865+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
866+ pub const INK1: u32 = FG_PRIMARY;
867+ pub const INK2: u32 = FG_SECONDARY;
868+ pub const INK3: u32 = FG_DISABLED;
869+ pub const INK4: u32 = FG_DISABLED;
870+ pub const DARK_CANVAS: u32 = BG_CANVAS;
871+ pub const DARK_PANEL: u32 = BG_PANEL;
872+ pub const DARK_RAISED: u32 = BG_RAISED;
873+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
874+ pub const DARK_SEAM: u32 = SCRIM;
875+ pub const LAMP_WHITE: u32 = 0xffffff;
876+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
877+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
878+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
879+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
880+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
742 }881 }
743 882
744 /// Family H: the crisp one. A near-black blue ground with the widest ink range883 /// Family H: the crisp one. A near-black blue ground with the widest ink range
@@ -799,6 +938,22 @@ pub mod ice {
799 pub const EQ_FILL_INK: u32 = 0xa5f3fc26;938 pub const EQ_FILL_INK: u32 = 0xa5f3fc26;
800 pub const EQ_BELL_INK: u32 = 0xa5f3fc66;939 pub const EQ_BELL_INK: u32 = 0xa5f3fc66;
801 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];940 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
941+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
942+ pub const INK1: u32 = FG_PRIMARY;
943+ pub const INK2: u32 = FG_SECONDARY;
944+ pub const INK3: u32 = FG_DISABLED;
945+ pub const INK4: u32 = FG_DISABLED;
946+ pub const DARK_CANVAS: u32 = BG_CANVAS;
947+ pub const DARK_PANEL: u32 = BG_PANEL;
948+ pub const DARK_RAISED: u32 = BG_RAISED;
949+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
950+ pub const DARK_SEAM: u32 = SCRIM;
951+ pub const LAMP_WHITE: u32 = 0xffffff;
952+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
953+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
954+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
955+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
956+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
802 }957 }
803 958
804 /// Family I: a dark plum ground under one orchid accent -- the warm end of the959 /// Family I: a dark plum ground under one orchid accent -- the warm end of the
@@ -857,6 +1012,22 @@ pub mod orchid {
857 pub const EQ_FILL_INK: u32 = 0xd946ef26;1012 pub const EQ_FILL_INK: u32 = 0xd946ef26;
858 pub const EQ_BELL_INK: u32 = 0xd946ef66;1013 pub const EQ_BELL_INK: u32 = 0xd946ef66;
859 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];1014 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1015+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
1016+ pub const INK1: u32 = FG_PRIMARY;
1017+ pub const INK2: u32 = FG_SECONDARY;
1018+ pub const INK3: u32 = FG_DISABLED;
1019+ pub const INK4: u32 = FG_DISABLED;
1020+ pub const DARK_CANVAS: u32 = BG_CANVAS;
1021+ pub const DARK_PANEL: u32 = BG_PANEL;
1022+ pub const DARK_RAISED: u32 = BG_RAISED;
1023+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1024+ pub const DARK_SEAM: u32 = SCRIM;
1025+ pub const LAMP_WHITE: u32 = 0xffffff;
1026+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1027+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1028+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1029+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1030+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
860 }1031 }
861 1032
862 /// Family J: Nord, the arctic palette (arcticicestudio/nord, MIT) -- Polar1033 /// Family J: Nord, the arctic palette (arcticicestudio/nord, MIT) -- Polar
@@ -930,6 +1101,22 @@ pub mod nord {
930 pub const EQ_FILL_INK: u32 = 0x88c0d026;1101 pub const EQ_FILL_INK: u32 = 0x88c0d026;
931 pub const EQ_BELL_INK: u32 = 0x88c0d066;1102 pub const EQ_BELL_INK: u32 = 0x88c0d066;
932 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];1103 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1104+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
1105+ pub const INK1: u32 = FG_PRIMARY;
1106+ pub const INK2: u32 = FG_SECONDARY;
1107+ pub const INK3: u32 = FG_DISABLED;
1108+ pub const INK4: u32 = FG_DISABLED;
1109+ pub const DARK_CANVAS: u32 = BG_CANVAS;
1110+ pub const DARK_PANEL: u32 = BG_PANEL;
1111+ pub const DARK_RAISED: u32 = BG_RAISED;
1112+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1113+ pub const DARK_SEAM: u32 = SCRIM;
1114+ pub const LAMP_WHITE: u32 = 0xffffff;
1115+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1116+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1117+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1118+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1119+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
933 }1120 }
934 1121
935 /// Family K: Gruvbox dark (morhetz/gruvbox, MIT) -- the retro brown-grey ground1122 /// Family K: Gruvbox dark (morhetz/gruvbox, MIT) -- the retro brown-grey ground
@@ -996,6 +1183,22 @@ pub mod gruvbox {
996 pub const EQ_FILL_INK: u32 = 0xfe801926;1183 pub const EQ_FILL_INK: u32 = 0xfe801926;
997 pub const EQ_BELL_INK: u32 = 0xfe801966;1184 pub const EQ_BELL_INK: u32 = 0xfe801966;
998 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];1185 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1186+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
1187+ pub const INK1: u32 = FG_PRIMARY;
1188+ pub const INK2: u32 = FG_SECONDARY;
1189+ pub const INK3: u32 = FG_DISABLED;
1190+ pub const INK4: u32 = FG_DISABLED;
1191+ pub const DARK_CANVAS: u32 = BG_CANVAS;
1192+ pub const DARK_PANEL: u32 = BG_PANEL;
1193+ pub const DARK_RAISED: u32 = BG_RAISED;
1194+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1195+ pub const DARK_SEAM: u32 = SCRIM;
1196+ pub const LAMP_WHITE: u32 = 0xffffff;
1197+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1198+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1199+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1200+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1201+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
999 }1202 }
1000 1203
1001 /// Family L: Dracula (dracula/dracula-theme, MIT) -- its background, current1204 /// Family L: Dracula (dracula/dracula-theme, MIT) -- its background, current
@@ -1056,6 +1259,104 @@ pub mod dracula {
1056 pub const EQ_FILL_INK: u32 = 0xff79c626;1259 pub const EQ_FILL_INK: u32 = 0xff79c626;
1057 pub const EQ_BELL_INK: u32 = 0xff79c666;1260 pub const EQ_BELL_INK: u32 = 0xff79c666;
1058 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];1261 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1262+ // -- Darkroom token substrate: aliased onto this family's nearest role -----
1263+ pub const INK1: u32 = FG_PRIMARY;
1264+ pub const INK2: u32 = FG_SECONDARY;
1265+ pub const INK3: u32 = FG_DISABLED;
1266+ pub const INK4: u32 = FG_DISABLED;
1267+ pub const DARK_CANVAS: u32 = BG_CANVAS;
1268+ pub const DARK_PANEL: u32 = BG_PANEL;
1269+ pub const DARK_RAISED: u32 = BG_RAISED;
1270+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1271+ pub const DARK_SEAM: u32 = SCRIM;
1272+ pub const LAMP_WHITE: u32 = 0xffffff;
1273+ pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1274+ pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1275+ pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1276+ pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1277+ pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
1278+}
1279+
1280+/// Family M: Darkroom (DESIGN.md §2) -- the thirteenth family and the room the
1281+/// redesign is named after. Chrome is achromatic: every pre-existing role below
1282+/// is a grey, distinguished by luminance rather than hue ("loudness is
1283+/// luminance"); the only colour anywhere in this family sits on the roles
1284+/// DESIGN.md actually gives one -- the amber safelight glyph and the two loud
1285+/// notice tones. Everything else is the token substrate itself, taken verbatim
1286+/// from the spec table.
1287+pub mod darkroom {
1288+ // -- surfaces -----------------------------------------------------------
1289+ pub const BG_CANVAS: u32 = 0x050607;
1290+ pub const BG_PANEL: u32 = 0x0e1013;
1291+ pub const BG_RAISED: u32 = 0x15181c;
1292+ pub const BG_TIMELINE: u32 = 0x08090b;
1293+ pub const BG_HOVER: u32 = 0x2a2e33;
1294+ pub const BG_HOVER_DIM: u32 = 0x1c1f24;
1295+ pub const BG_SELECTED: u32 = 0x2e3237;
1296+ pub const SCRIM: u32 = 0x050607cc;
1297+ pub const SCRIM_LIGHT: u32 = 0x05060755;
1298+
1299+ // -- strokes --------------------------------------------------------------
1300+ pub const STROKE_DIVIDER: u32 = 0x22262b;
1301+ /// "Focus/selection ring = 1px ink1 (lamp-adjacent, not coloured)."
1302+ pub const STROKE_SELECTED: u32 = INK1;
1303+
1304+ // -- text -------------------------------------------------------------------
1305+ pub const FG_PRIMARY: u32 = INK1;
1306+ pub const FG_SECONDARY: u32 = INK2;
1307+ pub const FG_DISABLED: u32 = INK4;
1308+
1309+ // -- interaction --------------------------------------------------------
1310+ pub const ACCENT_PRIMARY: u32 = INK2;
1311+ pub const ACCENT_HOVER: u32 = INK1;
1312+ pub const ACCENT_PLAYHEAD: u32 = LAMP_WHITE;
1313+ pub const ACCENT_WASH: u32 = 0x9ba3ac55;
1314+
1315+ // -- clip kinds (luminance steps, no hue -- held under the grey that still
1316+ // carries FG_SECONDARY at 3:1, WCAG 1.4.11) -------------------------------
1317+ pub const CLIP_VIDEO: u32 = 0x343434;
1318+ pub const CLIP_AUDIO: u32 = 0x3d3d3d;
1319+ pub const CLIP_IMAGE: u32 = 0x464646;
1320+ pub const CLIP_TEXT: u32 = 0x4f4f4f;
1321+
1322+ pub const SOURCE_TINTS: [u32; 4] = [0x5e656d, 0x767e87, 0x8e97a1, 0xa6afb9];
1323+
1324+ // -- feedback -------------------------------------------------------------
1325+ pub const STATUS_ERROR: u32 = NOTICE_DECIDE;
1326+ pub const STATUS_WARNING: u32 = NOTICE_LOOK;
1327+ pub const STATUS_SUCCESS: u32 = INK1;
1328+ pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
1329+ pub const DROP_REFUSE: u32 = NOTICE_DECIDE;
1330+
1331+ // -- subtitles --------------------------------------------------------------
1332+ pub const SUB_FG: u32 = LAMP_WHITE;
1333+ pub const SUB_SHADE: u32 = 0x000000cc;
1334+
1335+ // -- the equalizer graph and the histogram -------------------------------
1336+ pub const EQ_GRID: u32 = 0x22262b;
1337+ pub const EQ_SPECTRUM_INK: u32 = 0x9ba3ac66;
1338+ pub const EQ_FILL_INK: u32 = 0x9ba3ac26;
1339+ pub const EQ_BELL_INK: u32 = 0x9ba3ac66;
1340+ pub const HIST_INK: [u32; 3] = [0x767e87, 0x9ba3ac, 0xc7cdd3];
1341+
1342+ // -- Darkroom token substrate (DESIGN.md §2, verbatim) -----------------------
1343+ pub const INK1: u32 = 0xe6e9ec;
1344+ pub const INK2: u32 = 0x9ba3ac;
1345+ pub const INK3: u32 = 0x5e656d;
1346+ pub const INK4: u32 = 0x3c4249;
1347+ pub const DARK_CANVAS: u32 = BG_CANVAS;
1348+ pub const DARK_PANEL: u32 = BG_PANEL;
1349+ pub const DARK_RAISED: u32 = BG_RAISED;
1350+ pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1351+ /// Seam: `rgba(0,0,0,.7)`, encoded the way `SCRIM`/`SCRIM_LIGHT` are --
1352+ /// `0xRRGGBBAA` -- so `0xb3` (179/255 ~= 0.702) is the closest byte to 70%.
1353+ pub const DARK_SEAM: u32 = 0x000000b3;
1354+ pub const LAMP_WHITE: u32 = 0xffffff;
1355+ pub const NOTICE_TELL: u32 = 0x5e656d;
1356+ pub const NOTICE_LOOK: u32 = 0xd1b564;
1357+ pub const NOTICE_DECIDE: u32 = 0xc85050;
1358+ pub const SAFELIGHT_GROUND: u32 = 0x0a0908;
1359+ pub const SAFELIGHT_GLYPH: u32 = 0xff9d57;
1059 }1360 }
1060 1361
1061 /// The box a button's glyph sits in, whatever the glyph happens to measure: the1362 /// The box a button's glyph sits in, whatever the glyph happens to measure: the