Skip to content

Commit 3af073e

Browse files
gajopclaude
andcommitted
Move concrete UI out of panels/ to their features
panels/ should hold only reusable UI infrastructure. Relocate the three feature-specific things that were sitting in it: - dev_gallery -> sbc/dev/gallery.rs (it is an editor, not a panel component; new top-level dev/ for developer-only editors) - new_project_dialog -> sbc/project/ (a specific dialog owned by the project feature, not reusable) - thumbnails -> sbc/objects/ (renders unit/feature def previews for the Objects grid; not used anywhere else) asset_picker is now pub(crate) so the relocated new-project dialog can still reach it. Removed the empty leftover panels/editors/ dir. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 16c05f3 commit 3af073e

12 files changed

Lines changed: 11 additions & 8 deletions

File tree

native/src/sbc/dev/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//! Developer-only editors, gated behind `SBC_DEV_PANEL=1`.
2+
3+
mod gallery;

native/src/sbc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mod chonsole;
44
mod command_system;
55
pub mod commands_api;
66
pub(crate) mod compile;
7+
mod dev;
78
mod devconsole;
89
pub(crate) mod grass;
910
pub(crate) mod heightmap;

native/src/sbc/objects/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ mod model;
55
mod selection;
66
pub(crate) mod states;
77
mod tests;
8+
pub(crate) mod thumbnails;
89
mod ui;
910

1011
pub(crate) use commands::{AddObjectCommand, RemoveObjectCommand, SetObjectParamCommand};

native/src/sbc/objects/ui/definitions/behavior.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use spring_native::prelude::{Error, NativeInterfaceRef};
22

33
use crate::sbc::command_system::model::Models;
4+
use crate::sbc::objects::thumbnails::ThumbKind;
45
use crate::sbc::objects::ui::filters::DefTraits;
56
use crate::sbc::panels::field::{escape_rml, ChangeQueue, CommitRequest, InteractionQueue};
67
use crate::sbc::panels::grid::GridItem;
78
use crate::sbc::panels::runtime::{Behavior, Event, Item, Outcome, Phase, Watch};
8-
use crate::sbc::panels::thumbnails::ThumbKind;
99
use crate::sbc::rml::element_by_id;
1010
use crate::sbc::states::StateRequest;
1111

native/src/sbc/objects/ui/definitions/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ use std::rc::Rc;
55
use spring_native::prelude::{Error, NativeInterfaceRef};
66

77
use crate::sbc::command_system::model::Models;
8+
use crate::sbc::objects::thumbnails::ThumbnailRenderer;
89
use crate::sbc::objects::ui::filters::{DefTraits, FEATURE_TYPES, TERRAINS, UNIT_TYPES};
910
use crate::sbc::panels::grid::{GridItem, GridView};
1011
use crate::sbc::panels::runtime::{
1112
Brush, DynChoice, DynChoiceDef, EditorModel, FieldMut, FieldRef, Num, NumDef, StrChoice,
1213
StrChoiceDef,
1314
};
14-
use crate::sbc::panels::thumbnails::ThumbnailRenderer;
1515
use crate::sbc::states::PlacementConfig;
1616
use crate::sbc::teams::TeamManager;
1717

native/src/sbc/panels/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
mod action_dispatcher;
2-
mod asset_picker;
2+
pub(crate) mod asset_picker;
33
pub(crate) mod brush;
44
mod brush_sync;
55
mod color_picker;
66
mod cursortip;
7-
mod dev_gallery;
87
mod drag_cursor;
98
mod editor;
109
pub(crate) mod editor_base;
@@ -17,10 +16,8 @@ pub(crate) mod grid;
1716
mod input;
1817
mod manager;
1918
mod modal_stack;
20-
mod new_project_dialog;
2119
pub(crate) mod registry;
2220
pub(crate) mod runtime;
23-
pub(crate) mod thumbnails;
2421
mod view;
2522

2623
pub(crate) use manager::PanelManager;

native/src/sbc/panels/modal_stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::sbc::panels::asset_picker::AssetPicker;
1010
use crate::sbc::panels::color_picker::{ColorPicker, PickerEvent};
1111
use crate::sbc::panels::field::FieldValue;
1212
use crate::sbc::panels::file_dialog::FileDialog;
13-
use crate::sbc::panels::new_project_dialog::NewProjectDialog;
13+
use crate::sbc::project::new_project_dialog::NewProjectDialog;
1414

1515
/// What a modal produced this tick, in the order it must be applied.
1616
pub(crate) enum ModalEvent {

native/src/sbc/panels/view.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::sbc::panels::asset_picker::AssetPicker;
88
use crate::sbc::panels::color_picker::ColorPicker;
99
use crate::sbc::panels::field::{bind_tooltip, element_by_id, escape_rml};
1010
use crate::sbc::panels::file_dialog::FileDialog;
11-
use crate::sbc::panels::new_project_dialog::NewProjectDialog;
1211
use crate::sbc::panels::registry::{editors_for, Tab};
12+
use crate::sbc::project::new_project_dialog::NewProjectDialog;
1313
use crate::sbc::rml;
1414

1515
const UI_CONTEXT: &str = "sbc_native_ui";

0 commit comments

Comments
 (0)