diff --git a/DESIGN.md b/DESIGN.md index 3afcead..5d32323 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -78,8 +78,11 @@ Two faces, fixed roles (bundled, no runtime deps): Scale: 18px hero timecode (700, colons in `ink3`) · 15px labels/rows (500) · 13–14px chords and metadata (500) · 12px section heads (Archivo 700, uppercase, +0.14em letter-spacing, `ink3`). -Room/column heads (Settings) are 15px Archivo 700 `ink1`; in-list section heads stay 12px `ink3` +Room/column heads are 15px Archivo 700 `ink1`; in-list section heads stay 12px `ink3` (2026-09-10 -- the settings columns read as body text and a person could not find them). +Settings itself is a tab strip since 2026-09-19 (one section shows at a time), so its heads are +gone: the tabs wear the dock's tab look instead -- 15px Archivo 500, the showing tab marked by a +1px `ink1` top rule and `ink1` text, the resting one `ink3`. Nothing below 10px. Every size is a whole pixel (no half-pixel sizes -- they put glyph baselines off the pixel grid and blurred cosmic-text's AA). No italics. Tabular figures wherever digits align. diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 47d7f38..45b79b8 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -567,6 +567,15 @@ struct Player { /// list). Cleared by [`Player::close_card`], the one reset list every /// opener routes through. settings_open: bool, + /// Which of the settings page's three tabs is showing + /// ([`ui::settings_stance::render`]'s strip). A field rather than state + /// inside the page so a close and a reopen return to the section a hand + /// left; it is deliberately *not* in [`Player::close_card`]'s reset list, + /// the same way the dock's tab pick outlives its panel + /// ([`Player::dock_src_active`]). Nothing but the strip reads it, and + /// picking a tab writes no project value, so the pick never arms + /// autosave. + settings_tab: ui::settings_stance::SettingsTab, /// Where the actions list is scrolled to. Held here rather than left to /// the wheel alone: forty actions are four times what a 360 px window /// shows, and the rows past the fold have to be reachable from the @@ -1057,6 +1066,7 @@ fn main() { keymap: keymap.clone(), keys_open: false, settings_open: false, + settings_tab: ui::settings_stance::SettingsTab::Project, keys_scroll: ScrollHandle::new(), lanes_scroll: ScrollHandle::new(), eq_scroll: ScrollHandle::new(), diff --git a/crates/app/src/player/cards.rs b/crates/app/src/player/cards.rs index 5bbdf9a..5b42d90 100644 --- a/crates/app/src/player/cards.rs +++ b/crates/app/src/player/cards.rs @@ -2,6 +2,7 @@ //! silence, the mixer and the equalizer. use crate::*; +use crate::ui::settings_stance::SettingsTab; impl Player { /// Cycles the *project's* resolution through [`RESOLUTIONS`], starting from @@ -927,12 +928,12 @@ impl Player { self.apply_encoder(EncoderSeat::ALL[(at + 1) % EncoderSeat::ALL.len()], cx); } - /// Opens the settings page (PROJECT rows beside EDITOR rows, - /// `ui::settings_stance`): the one door for "edit project and editor - /// settings" -- refused while an export is running, same as every other - /// card here, since the exporting card owns this same modal slot - /// (`oracle.rs` agrees: `ActionId::Settings` is `No` there too, for the - /// same reason). + /// Opens the settings page (three tabs -- PROJECT/EDITOR/EXPORT -- over + /// whichever section is showing, `ui::settings_stance`): the one door for + /// "edit project and editor settings" -- refused while an export is + /// running, same as every other card here, since the exporting card owns + /// this same modal slot (`oracle.rs` agrees: `ActionId::Settings` is `No` + /// there too, for the same reason). pub(crate) fn open_settings(&mut self, cx: &mut Context) { if self.exporting().is_some() { return; @@ -944,6 +945,19 @@ impl Player { cx.notify(); } + /// Which of the settings page's three tabs is showing -- the strip's one + /// door, and the page's only piece of state that [`Self::close_card`] + /// leaves alone, so a close and a reopen come back to the section a hand + /// left rather than snapping back to PROJECT. Display state and nothing + /// else: no row reads it, it writes no project value, and it therefore + /// never lights the ledger or arms autosave -- picking a tab is not an + /// edit, which is why this is a setter with no [`Self::mark_dirty`] in + /// it, unlike every row the page carries that writes a value. + pub(crate) fn set_settings_tab(&mut self, tab: SettingsTab, cx: &mut Context) { + self.settings_tab = tab; + cx.notify(); + } + pub(crate) fn open_subtitle_style(&mut self, cx: &mut Context) { // One card at a time -- `close_card`'s own rule. self.close_card(); diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index fa4a548..46e367f 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2338,9 +2338,10 @@ fn every_darkroom_menu_sizes_its_list_against_the_floor_room_not_the_raw_viewpor /// (`ui::dock_stance::config_path`/`ui::theme::config_path`/ /// `keymap::Keymap::config_path`) directly, which every editor-side row /// already routes around through its own opener. A row wired to the wrong -/// section's opener is exactly the regression a page organised around two -/// headings invites; this pins each half to its own doors so the two lists -/// cannot cross. +/// section's opener is exactly the regression a page organised around named +/// sections invites -- and the tab strip did not loosen it: a tab decides +/// which section is *shown*, never which door a row opens. This pins each +/// half to its own doors so the two lists cannot cross. #[test] fn settings_project_and_editor_sections_open_disjoint_doors() { let source = src_text("ui/settings_stance.rs"); @@ -4019,37 +4020,77 @@ fn no_region_root_wears_a_focus_ring() { /// The user could not find the three columns (2026-09-10: "I couldn't realize /// them when I look at"), because their heads were 12px `ink3` -- the room's -/// quietest type -- with a prose tail running on after each one. DESIGN §3's -/// new line: a room/column head is 15px Archivo 700 `ink1`, and the prose is a -/// hover plate (DESIGN §8), never ambient text on the head itself. +/// quietest type -- with a prose tail running on after each one. The page's +/// answer has since become a tab strip (user 2026-09-19): three columns at +/// once asked the eye to find three anchors in one glance and then to read a +/// column that began mid-screen. The pin moved with the page: the sections are +/// tabs now, each tab wears the dock's own tab look -- [`crate::ui::dock_stance`]'s +/// `dock_tab`, reproduced here because that fn is private to its module -- and +/// each section's one-line explanation rides the tab's hover plate +/// (DESIGN §8), never running on after a head as ambient text. #[test] -fn the_settings_columns_wear_room_heads_not_section_heads() { +fn the_settings_sections_are_tabs_that_carry_their_own_explanation() { let source = src_text("ui/settings_stance.rs"); - let start = source.find("fn room_head(").expect("the room head"); + let start = source.find("fn settings_tab(").expect("the tab builder"); let body = &source[start..source[start..].find("\n}\n").unwrap() + start]; + // The dock's own tab look: no pill, no fill; a 1px `ink1` top rule and + // `ink1` text mark the showing tab, the resting one is `ink3`. Every tab + // is a `hitmap::control` wearing a plate of its own (the hover-line gate + // below counts the plates one to one). for needle in [ "type_scale::LABEL_ROW_PX", - "FontWeight::BOLD", + "gpui::FontWeight::MEDIUM", + "border_t_1()", "rgb(INK1())", + "INK3()", + ".cursor_pointer()", ".tooltip(", - ".pb(px(12.))", + "hitmap::control(", ] { - assert!(body.contains(needle), "a room head lost {needle}"); + assert!(body.contains(needle), "a settings tab lost {needle}"); } assert!( - !body.contains("INK3()") && !body.contains("type_scale::head()"), - "the room heads fell back to the 12px in-list section head" + !body.contains("type_scale::head()"), + "the settings tabs fell back to the 12px in-list section head" ); - // Each column head is one word, and its prose lives on the plate. - for head in ["\"PROJECT\"", "\"EDITOR\"", "\"EXPORT\""] { - assert!(source.contains(head), "the settings room lost its {head} head"); + // Three tabs, one per section, named the way the room names the section. + for tab in ["project", "editor", "export"] { + assert!( + source.contains(&format!("\"settings-tab-{tab}\"")), + "the settings strip has no {tab} tab" + ); + } + // Each section's one-line explanation is the tab's plate now. + for explanation in [ + "stored in the .edith file", + "this machine, this window", + "what a delivery is written as", + ] { + assert!( + source.contains(explanation), + "a settings tab lost its explanation: {explanation}" + ); } + // ...and none of them runs on after a head as ambient text. for run_on in ["PROJECT \u{b7}", "EDITOR \u{b7}", "EXPORT \u{b7}"] { assert!( !source.contains(run_on), "a settings head grew its prose tail back: {run_on}" ); } + // One section shows at a time: the plate mounts the showing tab's own + // section and nothing else -- a page that drew all three under the strip + // would be the three columns back with the strip doing nothing. + for (tab, section) in [ + ("SettingsTab::Project", "project_section(player, cx)"), + ("SettingsTab::Editor", "editor_section(player, cx)"), + ("SettingsTab::Export", "export_section(player, cx)"), + ] { + assert!( + source.contains(&format!("{tab} => {section}")), + "the {tab} tab no longer shows {section}" + ); + } } /// The Picture row said every refused format's reason after its value diff --git a/crates/app/src/ui/cards.rs b/crates/app/src/ui/cards.rs index 809d5eb..728ffc3 100644 --- a/crates/app/src/ui/cards.rs +++ b/crates/app/src/ui/cards.rs @@ -934,19 +934,6 @@ impl Player { .child(note( format!("{source} → {}", file_name(&self.export_path)).into(), )) - .child(note( - match armed { - true => { - "cancelling deletes what has been written so far".to_string() - } - false => format!( - "{} cancels · esc alone does nothing while this runs · the \ - timeline is read-only until it finishes", - self.keymap.display(ActionId::CancelExport) - ), - } - .into(), - )) // One button, or the pair that answers it: never a // control that cycles -- both choices are on screen at // once, each saying which one it is. diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index 7719105..4a0e869 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -1257,6 +1257,13 @@ fn viz_style_verbs(player: &Player, cx: &mut Context) -> impl IntoElemen .flex() .flex_col() .gap(px(2.)) + .child( + div() + .flex_none() + .pt(px(4.)) + .px(px(8.)) + .child(section_head("VISUALIZER")), + ) .child(pick( "dock-viz-fill", "Fill", diff --git a/crates/app/src/ui/settings_stance.rs b/crates/app/src/ui/settings_stance.rs index 24e41d8..620986e 100644 --- a/crates/app/src/ui/settings_stance.rs +++ b/crates/app/src/ui/settings_stance.rs @@ -1,6 +1,12 @@ //! The settings page (user complaint: "we should have a settings page that -//! we can edit project and editor settings"). Two clearly-headed sections, -//! per the split rule a rubric pass settled: +//! we can edit project and editor settings"). Three sections, per the split +//! rule a rubric pass settled -- but never three columns at once: they are +//! tabs of one strip since 2026-09-19 (user: the three-column row asked the +//! eye to find three anchors in one glance and then to read a column that +//! began mid-screen). One section shows under the strip; the strip wears the +//! dock's own tab look ([`crate::ui::dock_stance`]'s `dock_tab`, reproduced +//! here because that fn is private to its module) and each tab's hover plate +//! carries the one-line explanation the column head used to trail: //! //! - PROJECT: anything that changes the rendered output or is stored in the //! `.edith` file -- resolution, fps, sample-rate, the HDR tonemap, the mix. @@ -37,27 +43,61 @@ use crate::ui::type_scale; use crate::*; use engine::colorspace::ContentLight; -/// The room's three anchors (user 2026-09-10: "I couldn't realize them when I -/// look at"): 15px Archivo 700 `ink1`, uppercase, with a row's own height of -/// air below (+12px past a row's gap) so a head reads as the start of a -/// column and not as one more line in it. The prose that used to trail each -/// head (`· stored in the .edith file`) is a hover plate on the head now, -/// ≤6 words -- DESIGN §8: a distinction that matters is a plate, not ambient -/// text. In-list section heads (the dock's own KEYS head) stay 12px -/// `ink3`. -fn room_head(id: &'static str, text: &'static str, tail: &'static str) -> impl IntoElement { - let style = type_scale::label(type_scale::LABEL_ROW_PX, gpui::FontWeight::BOLD); - let tail: SharedString = tail.into(); +/// Which of the page's three sections is showing. Kept on [`Player`] beside +/// [`Player::settings_open`] rather than in the leaf, so a close and a reopen +/// return to the section a hand left instead of snapping back to the first -- +/// the dock keeps its own tab pick the same way ([`Player::dock_src_active`]). +/// Display state and nothing else: no row reads it, and picking a tab writes +/// no project value, so the pick never lights the ledger. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub(crate) enum SettingsTab { + Project, + Editor, + Export, +} + +/// One tab of the page's strip (PROJECT/EDITOR/EXPORT), wearing the dock's +/// own tab look -- [`crate::ui::dock_stance`]'s `dock_tab` verbatim: no pill, +/// no fill, no rounded button, a 1px `ink1` top rule and `ink1` text mark the +/// showing tab, the resting one is `ink3`, and the whole row is a +/// [`hitmap::control`] so the harness can press it. The section's one-line +/// explanation -- what used to run on after a column head as ambient prose -- +/// is the tab's hover plate (DESIGN §8: a distinction that matters is a plate, +/// not ambient text). +fn settings_tab( + id: &'static str, + label_text: &'static str, + explanation: &'static str, + tab: SettingsTab, + active: bool, + cx: &mut Context, +) -> impl IntoElement { + let style = type_scale::label(type_scale::LABEL_ROW_PX, gpui::FontWeight::MEDIUM); div() .id(id) - .flex_none() - .pt(px(4.)) - .pb(px(12.)) - .font(style.font) - .text_size(style.size) - .text_color(rgb(INK1())) - .tooltip(move |_, cx| cx.new(|_| Tip(tail.clone())).into()) - .child(text) + .flex_1() + .flex() + .items_center() + .justify_center() + .gap(px(4.)) + .pt(px(6.)) + .pb(px(6.)) + .when(active, |d| d.border_t_1().border_color(rgb(INK1()))) + .cursor_pointer() + .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| this.set_settings_tab(tab, cx))) + .tooltip(crate::ui::widgets::tip_hover( + &format!("Show {}", label_text.to_lowercase()), + explanation, + None, + )) + .children(hitmap::control(id, label_text, true)) + .child( + div() + .font(style.font.clone()) + .text_size(style.size) + .text_color(rgb(if active { INK1() } else { INK3() })) + .child(label_text), + ) } /// One row: a ≤16-char label, its current value in mono (units carried, @@ -327,11 +367,6 @@ fn project_section(player: &Player, cx: &mut Context) -> impl IntoElemen .flex() .flex_col() .gap(px(2.)) - .child(room_head( - "settings-head-project", - "PROJECT", - "stored in the .edith file", - )) .child(row_ink( "settings-resolution", "Resolution", @@ -418,11 +453,6 @@ fn editor_section(player: &Player, cx: &mut Context) -> impl IntoElement .flex() .flex_col() .gap(px(2.)) - .child(room_head( - "settings-head-editor", - "EDITOR", - "this machine, this window", - )) // The monitoring level, which lost its slider when the time band was // cleansed (DESIGN §5 -- "the level lives in Settings"). A readout and // not a widget: the number is spent rarely, so the wheel over the row @@ -671,11 +701,6 @@ fn export_section(player: &Player, cx: &mut Context) -> impl IntoElement .flex() .flex_col() .gap(px(2.)) - .child(room_head( - "settings-head-export", - "EXPORT", - "what a delivery is written as", - )) .child(row_full( "settings-export-picture", "Picture", @@ -795,11 +820,12 @@ pub(crate) fn render( .child( div() .id("settings-card") - // The whole footprint's width, two columns inside: at 720p a - // 420px single column put Mix, the palette and the subtitle - // font below a fold with no visible scrollbar -- settings an - // editor cannot see are settings only a chord reaches, which - // is the defect class this page exists to close. + // The whole footprint's width: at 720p a 420px single column + // put Mix, the palette and the subtitle font below a fold with + // no visible scrollbar -- settings an editor cannot see are + // settings only a chord reaches, which is the defect class + // this page exists to close. The strip spends the width on + // tabs, and one section shows flat beneath it. .w_full() .max_h(px((room - 12.).max(120.))) .on_mouse_down(MouseButton::Left, swallow) @@ -836,42 +862,54 @@ pub(crate) fn render( .child(player.keymap.display(ActionId::Settings)), ) }) + .child( + div() + .id("settings-tabs") + .flex_none() + .flex() + .child(settings_tab( + "settings-tab-project", + "PROJECT", + "stored in the .edith file", + SettingsTab::Project, + player.settings_tab == SettingsTab::Project, + cx, + )) + .child(settings_tab( + "settings-tab-editor", + "EDITOR", + "this machine, this window", + SettingsTab::Editor, + player.settings_tab == SettingsTab::Editor, + cx, + )) + .child(settings_tab( + "settings-tab-export", + "EXPORT", + "what a delivery is written as", + SettingsTab::Export, + player.settings_tab == SettingsTab::Export, + cx, + )), + ) + // The showing section alone, on the plate's whole width: the + // three columns this row used to hold side by side -- each + // with its own head and a hairline down its left edge -- asked + // the eye to find three anchors at once and then to read a + // column that began mid-screen. The strip above is the way + // between them; there is one section in the tree at a time, so + // a row that is not showing cannot be reached by a tab stroke + // or by the pointer either. .child( div() .id("settings-rows") .min_h(px(0.)) .overflow_y_scroll() - .flex() - .gap(px(16.)) - .child( - div() - .flex_1() - .min_w(px(0.)) - .child(project_section(player, cx)), - ) - .child( - div() - .flex_1() - .min_w(px(0.)) - .border_l_1() - .border_color(rgb(DARK_HAIRLINE())) - .pl(px(12.)) - .child(editor_section(player, cx)), - ) - // The third column: what a delivery is written as, the - // rows the export card used to hold (user: it was "too - // complicated"). Beside the other two rather than under - // them -- a fold with no scrollbar is the defect this - // page's own two columns exist to avoid. - .child( - div() - .flex_1() - .min_w(px(0.)) - .border_l_1() - .border_color(rgb(DARK_HAIRLINE())) - .pl(px(12.)) - .child(export_section(player, cx)), - ), + .child(match player.settings_tab { + SettingsTab::Project => project_section(player, cx).into_any_element(), + SettingsTab::Editor => editor_section(player, cx).into_any_element(), + SettingsTab::Export => export_section(player, cx).into_any_element(), + }), ), ) }