Skip to content

Commit eca5d0d

Browse files
authored
Add node description tooltips in the Properties panel and on secondary inputs in the graph (#2590)
Add tooltips to secondary inputs in graph/Properties panel, and to nodes in Properties panel
1 parent ab39f3f commit eca5d0d

File tree

15 files changed

+434
-283
lines changed

15 files changed

+434
-283
lines changed

editor/src/dispatcher.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ impl Dispatcher {
167167

168168
// Send the information for tooltips and categories for each node/input.
169169
queue.add(FrontendMessage::SendUIMetadata {
170-
input_type_descriptions: Vec::new(),
171170
node_descriptions: document_node_definitions::collect_node_descriptions(),
172171
node_types: document_node_definitions::collect_node_types(),
173172
});

editor/src/messages/frontend/frontend_message.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ pub enum FrontendMessage {
4444

4545
// Send prefix: Send global, static data to the frontend that is never updated
4646
SendUIMetadata {
47-
#[serde(rename = "inputTypeDescriptions")]
48-
input_type_descriptions: Vec<(String, String)>,
4947
#[serde(rename = "nodeDescriptions")]
5048
node_descriptions: Vec<(String, String)>,
5149
#[serde(rename = "nodeTypes")]

editor/src/messages/layout/utility_types/layout_widget.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,14 @@ pub enum LayoutGroup {
325325
},
326326
// TODO: Move this from being a child of `enum LayoutGroup` to being a child of `enum Layout`
327327
#[serde(rename = "section")]
328-
Section { name: String, visible: bool, pinned: bool, id: u64, layout: SubLayout },
328+
Section {
329+
name: String,
330+
description: String,
331+
visible: bool,
332+
pinned: bool,
333+
id: u64,
334+
layout: SubLayout,
335+
},
329336
}
330337

331338
impl Default for LayoutGroup {
@@ -402,13 +409,15 @@ impl LayoutGroup {
402409
(
403410
Self::Section {
404411
name: current_name,
412+
description: current_description,
405413
visible: current_visible,
406414
pinned: current_pinned,
407415
id: current_id,
408416
layout: current_layout,
409417
},
410418
Self::Section {
411419
name: new_name,
420+
description: new_description,
412421
visible: new_visible,
413422
pinned: new_pinned,
414423
id: new_id,
@@ -417,9 +426,16 @@ impl LayoutGroup {
417426
) => {
418427
// Resend the entire panel if the lengths, names, visibility, or node IDs are different
419428
// TODO: Diff insersion and deletion of items
420-
if current_layout.len() != new_layout.len() || *current_name != new_name || *current_visible != new_visible || *current_pinned != new_pinned || *current_id != new_id {
429+
if current_layout.len() != new_layout.len()
430+
|| *current_name != new_name
431+
|| *current_description != new_description
432+
|| *current_visible != new_visible
433+
|| *current_pinned != new_pinned
434+
|| *current_id != new_id
435+
{
421436
// Update self to reflect new changes
422437
current_name.clone_from(&new_name);
438+
current_description.clone_from(&new_description);
423439
*current_visible = new_visible;
424440
*current_pinned = new_pinned;
425441
*current_id = new_id;
@@ -428,6 +444,7 @@ impl LayoutGroup {
428444
// Push an update layout group to the diff
429445
let new_value = DiffUpdate::LayoutGroup(Self::Section {
430446
name: new_name,
447+
description: new_description,
431448
visible: new_visible,
432449
pinned: new_pinned,
433450
id: new_id,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
353353
}
354354
let Some(bounds) = self.metadata().bounding_box_document(layer) else { continue };
355355

356-
let name = self.network_interface.frontend_display_name(&layer.to_node(), &[]);
356+
let name = self.network_interface.display_name(&layer.to_node(), &[]);
357357

358358
let transform = self.metadata().document_to_viewport
359359
* DAffine2::from_translation(bounds[0].min(bounds[1]))

editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl MessageHandler<GraphOperationMessage, GraphOperationMessageData<'_>> for Gr
240240

241241
responses.add(NodeGraphMessage::SetDisplayName {
242242
node_id,
243-
alias: network_interface.frontend_display_name(&artboard.to_node(), &[]),
243+
alias: network_interface.display_name(&artboard.to_node(), &[]),
244244
skip_adding_history_step: true,
245245
});
246246

0 commit comments

Comments
 (0)