graphic design tool
git clone https://git.lucas.co/cce-designer.git
refactor(network): the network menu has no Plate page
The network has no plate and is in no dock, so the network menu's Plate
page held Detach alone, which is the detach_circular_window command in
the palette. The page, NetworkMenuAction::PlatePage and its turn are
gone; the playbar's Plate page is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md | 13 ++++++++-----
src/app.rs | 14 +++-----------
src/main.rs | 20 ++++----------------
src/menu_page.rs | 17 ++++++-----------
4 files changed, 21 insertions(+), 43 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index ed8f22e..c34412f 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -250,14 +250,15 @@ gone from cce-ui with the wgpu path).
viewport, whose plate is the window-spanning lip) — Collapse/Expand, Detach/
Reattach, Full Width, the selection pins, the dock's tabs, Add Tab, Move To Own
Plate, **Move To Left/Right/Bottom** and Close Tab. The network and the params
- HUD are in no dock, so theirs are Detach (and the HUD's pins) alone. `plate_menu_rows(idx)` is the
+ HUD are in no dock, so theirs are Detach (and the HUD's pins) alone, and the
+ network's are in no menu: its Plate page went on 2026-10-07, Detach being the
+ `detach_circular_window` command in the palette. `plate_menu_rows(idx)` is the
one list. **There is no corner trigger** (since 2026-10-01; it was a small
circle on each plate's top-right, which opened these rows as a menu of their
own and, DRAGGED, moved the pane to another dock — the drag, its drop
highlight and `AppDrag::DockDrag` went with it, and Move To is the rows'
replacement). The rows are in each plate's RIGHT-CLICK menu: a **Plate**
- PAGE row (see "Page rows" below) at the foot of the network editor's
- empty-space menu (`NetworkMenuAction::PlatePage`) and the playbar's
+ PAGE row (see "Page rows" below) at the foot of the playbar's menu
(`PlaybarMenuAction::PlatePage`), which turns the menu into them under a
band back to it (`open_plate_page`; until 2026-10-06 they were appended
inline there), and the whole menu where a pane has none of its own — the
@@ -266,7 +267,7 @@ gone from cce-ui with the wgpu path).
`run_plate_menu_action`. Add Tab is a page row too: the menu turns into
the list of panes where it stood, under a back band to whichever menu it
turned from (`State::plate_page_from`) — from a Plate page, back to that
- page, whose band goes back to the network's or the playbar's menu
+ page, whose band goes back to the playbar's menu
(`State::plate_page_root`). Collapse shrinks a plate to its title stub via
`apply_collapsed_panes`, a post-pass over `positions[..]` (one place, all three
branches); a LEFT press on a collapsed stub expands it, and a right press on any
@@ -2785,7 +2786,9 @@ none. The left dock starts EMPTY (`dock_panes` `[NO_PANE, NO_PANE,
spreadsheet]`), so the spreadsheet runs flush to the window's left, where
it stopped short of the network's invisible dock until then;
`TAB_CANDIDATES` is the spreadsheet and the second editor; the network's
-plate menu is Detach alone (no tab, Move To or Collapse rows), and
+plate menu is Detach alone (no tab, Move To or Collapse rows) — and is in
+no menu: the network menu's Plate page went the next day, Detach being the
+palette's `detach_circular_window` — and
`set_pane_collapsed` refuses it; the pane-state load takes it out of an
older save's tab lists, the dock it fronted fronting its next tab or
emptying (`the_params_hud_is_under_the_plates_and_stops_above_the_bottom_ones`
diff --git a/src/app.rs b/src/app.rs
index f08f582..4f02a03 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -570,9 +570,6 @@ pub enum PlaybarMenuAction {
pub enum NetworkMenuAction {
/// Run `command::by_id(id)` — the row's label came from the same row.
Command(&'static str),
- /// The Plate row: a page turning the menu into the network pane's
- /// plate rows — collapse, detach, its dock's tabs, Move To.
- PlatePage,
/// A "-" row: engraved, inert.
Separator,
}
@@ -7610,14 +7607,9 @@ impl State {
options.pop();
actions.pop();
}
- // The network pane's plate rows, below the graph's own, as a page:
- // one Plate row the menu turns into them (`open_plate_page`).
- if !self.plate_menu_rows(NETWORK_PANEL_IDX).0.is_empty() {
- options.push("-".to_string());
- actions.push(NetworkMenuAction::Separator);
- options.push("Plate".to_string());
- actions.push(NetworkMenuAction::PlatePage);
- }
+ // No Plate page (since 2026-10-07): the network has no plate and is
+ // in no dock, so its plate rows were Detach alone, which is the
+ // `detach_circular_window` command in the palette.
let target = self.slots.get_dyn(CONTENT_IDX).base().id();
let back = self.network_menu_from.filter(|_| at.is_some());
diff --git a/src/main.rs b/src/main.rs
index 03178eb..e254ee9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -404,7 +404,7 @@ mod tests {
#[test]
fn a_plates_rows_are_in_its_right_click_menu() {
use crate::plate_menu::PlateMenuAction;
- use crate::slots::{NETWORK_PANEL_IDX, PARAM_IDX, PLAYBAR_IDX, SPREADSHEET_IDX};
+ use crate::slots::{PARAM_IDX, PLAYBAR_IDX, SPREADSHEET_IDX};
use cce_ui::widget::{context_menu, MouseButton};
let mut state = State::new(false);
state.resize(1600.0, 900.0, 1.0);
@@ -444,9 +444,8 @@ mod tests {
state.params_plate = false;
// The network: its menu is the viewport menu's Network page (empty
- // graph space is the scene's), and in it its own rows, then one
- // Plate row, a page: the menu turns into the plate's rows, under a
- // band back to it.
+ // graph space is the scene's), and it has no Plate page — the
+ // network has no plate and is in no dock.
let (cx, cy, cw, ch) = state.positions[crate::slots::CONTENT_IDX];
let (px, py) = (cx + cw * 0.3, cy + ch * 0.6);
assert!(state.graph().node_at(px, py).is_none() && !state.over_floating_pane_at(px, py));
@@ -456,18 +455,7 @@ mod tests {
assert!(state.network_menu_active, "the Network row turned the menu into the network's");
let options = cce_ui::widget::context_menu::options();
assert_eq!(options.first().map(String::as_str), Some("Add Node"));
- assert!(!options.contains(&collapse) && !options.iter().any(|o| o.starts_with("Move To")), "no plate rows inline: {options:?}");
- let plate = options.iter().position(|o| o == "Plate").expect("a Plate row");
- assert!(context_menu::leads_to_page(plate), "a page row");
- let corner = (context_menu::x(), context_menu::y());
- press_at(&mut state, corner.0 + 8.0, context_menu::row_y(plate) + 4.0, MouseButton::Left);
- assert_eq!(state.plate_menu_slot, Some(NETWORK_PANEL_IDX), "turned into the plate's rows");
- assert_eq!((context_menu::x(), context_menu::y()), corner, "where the menu stood");
- assert_eq!(context_menu::back_title().as_deref(), Some("Network"));
- // The network is in no dock and does not collapse: Detach alone.
- assert_eq!(context_menu::options(), vec!["Detach".to_string()]);
- press_at(&mut state, corner.0 + 20.0, corner.1 + context_menu::PAD + context_menu::ROW_H * 0.5, MouseButton::Left);
- assert!(state.network_menu_active && state.plate_menu_slot.is_none(), "back on the network's menu");
+ assert!(!options.iter().any(|o| o == "Plate" || *o == collapse || o.starts_with("Move To")), "no plate rows: {options:?}");
press_at(&mut state, 2.0, 2.0, MouseButton::Left);
// The playbar: its transport, then the Plate page row.
diff --git a/src/menu_page.rs b/src/menu_page.rs
index 08cd78e..e2b6399 100644
--- a/src/menu_page.rs
+++ b/src/menu_page.rs
@@ -21,7 +21,7 @@
//! - A page of rows is shown by the menu that owns it (`put_up_menu` with
//! an `at`): the viewport menu's Style and Markers, the plate rows' Add
//! Tab — whose back band returns to whichever menu it was turned from,
-//! the network or playbar menu or a stub's plate menu.
+//! the playbar menu or a stub's plate menu.
//! - The dialog turned to from a row (`State::dialog_from`) goes back to
//! that menu, shown again at the dialog's corner; inside the dialog, a
//! mode turned to from another (Group Markers from the palette, one
@@ -34,7 +34,7 @@
use crate::app::{NetworkMenuAction, NodeMenuAction, PlaybarMenuAction, State, ViewportMenuAction};
use crate::dialog::Mode;
use crate::plate_menu::{plate_title, PlateMenuAction};
-use crate::slots::{DIALOG_IDX, NETWORK_PANEL_IDX, PLAYBAR_IDX};
+use crate::slots::{DIALOG_IDX, PLAYBAR_IDX};
use cce_ui::widget::context_menu::{self, PageTurn};
use cce_ui::widget::WidgetId;
@@ -52,11 +52,10 @@ pub enum MenuOrigin {
}
impl MenuOrigin {
- /// The menu a plate's rows are part of: the network and playbar menus
- /// carry their plates' rows, every other plate's are a menu alone.
+ /// The menu a plate's rows are part of: the playbar menu carries its
+ /// plate's rows, every other plate's are a menu alone.
pub fn of_plate(idx: usize) -> MenuOrigin {
match idx {
- NETWORK_PANEL_IDX => MenuOrigin::Network,
PLAYBAR_IDX => MenuOrigin::Playbar,
other => MenuOrigin::Plate(other),
}
@@ -72,9 +71,9 @@ impl ViewportMenuAction {
}
impl NetworkMenuAction {
- /// Add Node turns the menu into the add-node list; Add Tab into its page.
+ /// Add Node turns the menu into the add-node list.
pub fn leads_to_page(self) -> bool {
- matches!(self, NetworkMenuAction::Command("add_node") | NetworkMenuAction::PlatePage)
+ matches!(self, NetworkMenuAction::Command("add_node"))
}
}
@@ -221,10 +220,6 @@ impl State {
self.close_network_menu();
self.open_dialog_from(Mode::AddNode, origin, at);
}
- Some(NetworkMenuAction::PlatePage) => {
- self.close_network_menu();
- self.open_plate_page(NETWORK_PANEL_IDX, at, origin);
- }
_ => return false,
},
MenuOrigin::Playbar => match self.playbar_menu_actions.get(n).copied() {