Skip to content

Commit a28b943

Browse files
authored
Rename the "Table" type to "List" everywhere (#4133)
* Rename the "Table" type to "List" everywhere * Fix a few missed ones * Re-save demo artwork
1 parent 6b3e475 commit a28b943

79 files changed

Lines changed: 1573 additions & 1593 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

demo-artwork/changing-seasons.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/isometric-fountain.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/marbled-mandelbrot.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/painted-dreams.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/parametric-dunescape.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/procedural-string-lights.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/red-dress.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/valley-of-spires.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editor/src/messages/portfolio/document/data_panel/data_panel_message_handler.rs

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use glam::{Affine2, DAffine2, Vec2};
88
use graph_craft::document::NodeId;
99
use graphene_std::blending::BlendMode;
1010
use graphene_std::gradient::GradientStops;
11+
use graphene_std::list::List;
1112
use graphene_std::memo::IORecord;
1213
use graphene_std::raster_types::{CPU, GPU, Raster};
13-
use graphene_std::table::Table;
1414
use graphene_std::vector::Vector;
1515
use graphene_std::vector::style::{Fill, FillChoice, GradientSpreadMethod, GradientType};
1616
use graphene_std::{Artboard, Color, Context, Graphic};
@@ -155,7 +155,7 @@ struct LayoutData<'a> {
155155
desired_path: &'a mut Vec<PathStep>,
156156
network_interface: &'a NodeNetworkInterface,
157157
/// The `network_path` to use when resolving a `NodeId` against the network interface.
158-
/// Defaults to root (`&[]`); `Table<NodeId>` rendering temporarily sets it to the path's prefix so nested
158+
/// Defaults to root (`&[]`); `List<NodeId>` rendering temporarily sets it to the path's prefix so nested
159159
/// layers (e.g. inside a Ctrl+M-merged custom subgraph) resolve correctly.
160160
node_lookup_network_path: Vec<NodeId>,
161161
breadcrumbs: Vec<String>,
@@ -175,27 +175,27 @@ macro_rules! generate_layout_downcast {
175175
}
176176
// TODO: We simply try all these types sequentially. Find a better strategy.
177177
fn generate_layout(introspected_data: &Arc<dyn std::any::Any + Send + Sync + 'static>, data: &mut LayoutData) -> Option<Vec<LayoutGroup>> {
178-
// `Table<NodeId>` is interpreted as a path (e.g. the value produced by `path_of_subgraph`), shown as a
179-
// `Table` where each item's NodeId resolves against the prefix made up of the items above it.
180-
if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, Table<NodeId>>>() {
178+
// `List<NodeId>` is interpreted as a path (e.g. the value produced by `path_of_subgraph`), shown as a
179+
// `List` where each item's NodeId resolves against the prefix made up of the items above it.
180+
if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, List<NodeId>>>() {
181181
return Some(table_node_id_path_layout_with_breadcrumb(&io.output, data));
182182
}
183183
generate_layout_downcast!(introspected_data, data, [
184-
Table<Artboard>,
185-
Table<Graphic>,
186-
Table<Vector>,
187-
Table<Raster<CPU>>,
188-
Table<Raster<GPU>>,
189-
Table<Color>,
190-
Table<GradientStops>,
191-
Table<String>,
192-
Table<f64>,
193-
Table<u8>,
194-
Table<bool>,
195-
Table<DAffine2>,
196-
Table<BlendMode>,
197-
Table<GradientType>,
198-
Table<GradientSpreadMethod>,
184+
List<Artboard>,
185+
List<Graphic>,
186+
List<Vector>,
187+
List<Raster<CPU>>,
188+
List<Raster<GPU>>,
189+
List<Color>,
190+
List<GradientStops>,
191+
List<String>,
192+
List<f64>,
193+
List<u8>,
194+
List<bool>,
195+
List<DAffine2>,
196+
List<BlendMode>,
197+
List<GradientType>,
198+
List<GradientSpreadMethod>,
199199
GradientStops,
200200
f64,
201201
u32,
@@ -227,7 +227,7 @@ trait TableItemLayout {
227227
data.breadcrumbs.push(self.identifier());
228228
self.value_page(data)
229229
}
230-
/// Renders this value as a single inline widget inside an item of a Table.
230+
/// Renders this value as a single inline widget inside an item of a `List`.
231231
/// `target` is the [`PathStep`] to push when the widget is clicked to drill into the value.
232232
/// `data` provides shared context (notably `network_interface`) for types whose label or content
233233
/// depends on lookup beyond their own value (e.g. `NodeId` resolving a node's display name).
@@ -245,9 +245,9 @@ trait TableItemLayout {
245245
}
246246
}
247247

248-
impl<T: TableItemLayout> TableItemLayout for Table<T> {
248+
impl<T: TableItemLayout> TableItemLayout for List<T> {
249249
fn type_name() -> &'static str {
250-
"Table"
250+
"List"
251251
}
252252
fn identifier(&self) -> String {
253253
format!("{}[] ({} item{})", T::type_name(), self.len(), if self.len() == 1 { "" } else { "s" })
@@ -312,14 +312,14 @@ impl TableItemLayout for Artboard {
312312
"Artboard"
313313
}
314314
fn identifier(&self) -> String {
315-
self.as_graphic_table().identifier()
315+
self.as_graphic_list().identifier()
316316
}
317317
// Don't put a breadcrumb for Artboard
318318
fn layout_with_breadcrumb(&self, data: &mut LayoutData) -> Vec<LayoutGroup> {
319319
self.value_page(data)
320320
}
321321
fn value_page(&self, data: &mut LayoutData) -> Vec<LayoutGroup> {
322-
self.as_graphic_table().layout_with_breadcrumb(data)
322+
self.as_graphic_list().layout_with_breadcrumb(data)
323323
}
324324
}
325325

@@ -329,12 +329,12 @@ impl TableItemLayout for Graphic {
329329
}
330330
fn identifier(&self) -> String {
331331
match self {
332-
Self::Graphic(table) => table.identifier(),
333-
Self::Vector(table) => table.identifier(),
334-
Self::RasterCPU(table) => table.identifier(),
335-
Self::RasterGPU(table) => table.identifier(),
336-
Self::Color(table) => table.identifier(),
337-
Self::Gradient(table) => table.identifier(),
332+
Self::Graphic(list) => list.identifier(),
333+
Self::Vector(list) => list.identifier(),
334+
Self::RasterCPU(list) => list.identifier(),
335+
Self::RasterGPU(list) => list.identifier(),
336+
Self::Color(list) => list.identifier(),
337+
Self::Gradient(list) => list.identifier(),
338338
}
339339
}
340340
// Don't put a breadcrumb for Graphic
@@ -343,12 +343,12 @@ impl TableItemLayout for Graphic {
343343
}
344344
fn value_page(&self, data: &mut LayoutData) -> Vec<LayoutGroup> {
345345
match self {
346-
Self::Graphic(table) => table.layout_with_breadcrumb(data),
347-
Self::Vector(table) => table.layout_with_breadcrumb(data),
348-
Self::RasterCPU(table) => table.layout_with_breadcrumb(data),
349-
Self::RasterGPU(table) => table.layout_with_breadcrumb(data),
350-
Self::Color(table) => table.layout_with_breadcrumb(data),
351-
Self::Gradient(table) => table.layout_with_breadcrumb(data),
346+
Self::Graphic(list) => list.layout_with_breadcrumb(data),
347+
Self::Vector(list) => list.layout_with_breadcrumb(data),
348+
Self::RasterCPU(list) => list.layout_with_breadcrumb(data),
349+
Self::RasterGPU(list) => list.layout_with_breadcrumb(data),
350+
Self::Color(list) => list.layout_with_breadcrumb(data),
351+
Self::Gradient(list) => list.layout_with_breadcrumb(data),
352352
}
353353
}
354354
}
@@ -834,7 +834,7 @@ impl TableItemLayout for NodeId {
834834
}
835835
// The value's label resolves the node's display name via the network interface so the button reads as the name shown
836836
// in the Node Graph / Layers panels. The lookup uses `data.node_lookup_network_path` (set by the enclosing
837-
// `Table<NodeId>` if rendering a path) so the resolution succeeds at any nesting depth. The button's icon
837+
// `List<NodeId>` if rendering a path) so the resolution succeeds at any nesting depth. The button's icon
838838
// signals layer-vs-node kind. Falls back to "Node {id}" with no icon if the lookup misses.
839839
fn value_widget(&self, target: PathStep, data: &LayoutData) -> WidgetInstance {
840840
let label = node_id_display_label(*self, data.network_interface, &data.node_lookup_network_path);
@@ -935,20 +935,20 @@ impl TableItemLayout for NodeId {
935935
/// Invokes another macro with the full list of `TableItemLayout`-implementing types whose values may appear
936936
/// as attribute values. Both the value-rendering and drilldown-navigation dispatchers iterate this list,
937937
/// so adding a new attribute-displayable type is a single edit here.
938-
macro_rules! known_table_row_types {
938+
macro_rules! known_item_types {
939939
($apply:ident) => {
940940
$apply!(
941-
Table<Artboard>,
942-
Table<Graphic>,
943-
Table<Vector>,
944-
Table<Raster<CPU>>,
945-
Table<Raster<GPU>>,
946-
Table<Color>,
947-
Table<GradientStops>,
948-
Table<String>,
949-
Table<NodeId>,
950-
Table<f64>,
951-
Table<u8>,
941+
List<Artboard>,
942+
List<Graphic>,
943+
List<Vector>,
944+
List<Raster<CPU>>,
945+
List<Raster<GPU>>,
946+
List<Color>,
947+
List<GradientStops>,
948+
List<String>,
949+
List<NodeId>,
950+
List<f64>,
951+
List<u8>,
952952
GradientStops,
953953
Color,
954954
NodeId,
@@ -983,7 +983,7 @@ fn display_value_override(any: &dyn Any) -> Option<String> {
983983
None
984984
}
985985

986-
/// Type-dispatched widget for displaying an attribute value in a `Table<T>` item.
986+
/// Type-dispatched widget for displaying an attribute value in a `List<T>` item.
987987
/// Delegates to [`TableItemLayout::value_widget`] so the same widget code is shared between
988988
/// element-column rendering and attribute-column rendering. Returns `None` for unrecognized
989989
/// types so the caller can fall back to a debug-formatted [`TextLabel`].
@@ -997,16 +997,16 @@ fn dispatch_value_widget(any: &dyn Any, target: PathStep, data: &LayoutData) ->
997997
)*
998998
};
999999
}
1000-
known_table_row_types!(check);
1000+
known_item_types!(check);
10011001
None
10021002
}
10031003

1004-
/// Renders a `Table<NodeId>` as a path: the standard table view, but each item's `NodeId` value is resolved
1004+
/// Renders a `List<NodeId>` as a path: the standard table view, but each item's `NodeId` value is resolved
10051005
/// against the network path made up of all preceding items. So for a path `[outer, middle, leaf]`, item 0
10061006
/// resolves at root, item 1 resolves at `[outer]`, and item 2 resolves at `[outer, middle]` — letting deeply
10071007
/// nested layers display each step's correct name. Drilling into an item drops into that node's value page
10081008
/// using the same prefix as `network_path`.
1009-
fn table_node_id_path_layout_with_breadcrumb(path: &Table<NodeId>, data: &mut LayoutData) -> Vec<LayoutGroup> {
1009+
fn table_node_id_path_layout_with_breadcrumb(path: &List<NodeId>, data: &mut LayoutData) -> Vec<LayoutGroup> {
10101010
data.breadcrumbs.push(path.identifier());
10111011

10121012
if let Some(step) = data.desired_path.get(data.current_depth).cloned() {
@@ -1044,9 +1044,9 @@ fn table_node_id_path_layout_with_breadcrumb(path: &Table<NodeId>, data: &mut La
10441044
/// Mirrors [`dispatch_value_widget`] but routes to [`TableItemLayout::layout_with_breadcrumb`].
10451045
/// Returns `None` for unrecognized types.
10461046
fn drilldown_attribute_layout(any: &dyn Any, data: &mut LayoutData) -> Option<Vec<LayoutGroup>> {
1047-
// `Table<NodeId>` is interpreted as a path (e.g. the `editor:layer_path` attribute), so each item's NodeId value
1048-
// resolves against the prefix made up of preceding items. Handled before the generic `Table<T>` blanket impl.
1049-
if let Some(path) = any.downcast_ref::<Table<NodeId>>() {
1047+
// `List<NodeId>` is interpreted as a path (e.g. the `editor:layer_path` attribute), so each item's NodeId value
1048+
// resolves against the prefix made up of preceding items. Handled before the generic `List<T>` blanket impl.
1049+
if let Some(path) = any.downcast_ref::<List<NodeId>>() {
10501050
return Some(table_node_id_path_layout_with_breadcrumb(path, data));
10511051
}
10521052
macro_rules! check {
@@ -1058,7 +1058,7 @@ fn drilldown_attribute_layout(any: &dyn Any, data: &mut LayoutData) -> Option<Ve
10581058
)*
10591059
};
10601060
}
1061-
known_table_row_types!(check);
1061+
known_item_types!(check);
10621062
None
10631063
}
10641064

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,7 @@ impl DocumentMessageHandler {
24272427
});
24282428

24292429
if layer_to_move.parent(self.metadata()) != Some(parent) {
2430-
// TODO: Fix this so it works when dragging a layer into a group parent which has a Transform node, which used to work before #2689 caused this regression by removing the empty `Table<Vector>` item.
2430+
// TODO: Fix this so it works when dragging a layer into a group parent which has a Transform node, which used to work before #2689 caused this regression by removing the empty `List<Vector>` item.
24312431
// TODO: See #2688 for this issue.
24322432
let layer_local_transform = self.network_interface.document_metadata().transform_to_viewport(layer_to_move);
24332433
let undo_transform = self.network_interface.document_metadata().transform_to_viewport(parent).inverse();
@@ -3345,7 +3345,7 @@ impl DocumentMessageHandler {
33453345
/// Create a network interface with a single export
33463346
fn default_document_network_interface() -> NodeNetworkInterface {
33473347
let mut network_interface = NodeNetworkInterface::default();
3348-
network_interface.add_export(TaggedValue::TypeDefault(descriptor!(graphene_std::table::Table<graphene_std::Artboard>)), -1, "", &[]);
3348+
network_interface.add_export(TaggedValue::TypeDefault(descriptor!(graphene_std::list::List<graphene_std::Artboard>)), -1, "", &[]);
33493349
network_interface
33503350
}
33513351

0 commit comments

Comments
 (0)