diff --git a/.github/workflows/comment-clippy-warnings.yaml b/.github/workflows/comment-clippy-warnings.yaml index a12c02c7..a9fb2ca8 100644 --- a/.github/workflows/comment-clippy-warnings.yaml +++ b/.github/workflows/comment-clippy-warnings.yaml @@ -9,7 +9,8 @@ jobs: clippy: name: Run Clippy runs-on: ubuntu-latest - if: ${{ !github.event.pull_request.draft }} + # TODO(Keavon): Find a workaround (passing the output text to a separate action with permission to read the secrets?) that allows this to work on fork PRs + if: ${{ !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork }} permissions: contents: read pull-requests: write diff --git a/editor/src/dispatcher.rs b/editor/src/dispatcher.rs index 1c902513..7dabc354 100644 --- a/editor/src/dispatcher.rs +++ b/editor/src/dispatcher.rs @@ -77,7 +77,7 @@ impl Dispatcher { pub fn handle_message>(&mut self, message: T, process_after_all_current: bool) { let message = message.into(); - // Add all aditional messages to the buffer if it exists (except from the end buffer message) + // Add all additional messages to the buffer if it exists (except from the end buffer message) if !matches!(message, Message::EndBuffer(_)) { if let Some(buffered_queue) = &mut self.buffered_queue { Self::schedule_execution(buffered_queue, true, [message]); diff --git a/editor/src/messages/frontend/frontend_message.rs b/editor/src/messages/frontend/frontend_message.rs index ecf80dc0..137565ed 100644 --- a/editor/src/messages/frontend/frontend_message.rs +++ b/editor/src/messages/frontend/frontend_message.rs @@ -110,7 +110,7 @@ pub enum FrontendMessage { #[serde(rename = "copyText")] copy_text: String, }, - // TODO: Eventually remove this (probably starting late 2024) + // TODO: Eventually remove this document upgrade code TriggerUpgradeDocumentToVectorManipulationFormat { #[serde(rename = "documentId")] document_id: DocumentId, @@ -234,7 +234,7 @@ pub enum FrontendMessage { #[serde(rename = "hintData")] hint_data: HintData, }, - UpdateLayersPanelOptionsLayout { + UpdateLayersPanelControlBarLayout { #[serde(rename = "layoutTarget")] layout_target: LayoutTarget, diff: Vec, @@ -251,7 +251,7 @@ pub enum FrontendMessage { nodes: Vec, wires: Vec, }, - UpdateNodeGraphBarLayout { + UpdateNodeGraphControlBarLayout { #[serde(rename = "layoutTarget")] layout_target: LayoutTarget, diff: Vec, diff --git a/editor/src/messages/layout/layout_message_handler.rs b/editor/src/messages/layout/layout_message_handler.rs index 9a0ea3f8..a9f77063 100644 --- a/editor/src/messages/layout/layout_message_handler.rs +++ b/editor/src/messages/layout/layout_message_handler.rs @@ -401,9 +401,9 @@ impl LayoutMessageHandler { LayoutTarget::DialogColumn2 => FrontendMessage::UpdateDialogColumn2 { layout_target, diff }, LayoutTarget::DocumentBar => FrontendMessage::UpdateDocumentBarLayout { layout_target, diff }, LayoutTarget::DocumentMode => FrontendMessage::UpdateDocumentModeLayout { layout_target, diff }, - LayoutTarget::LayersPanelOptions => FrontendMessage::UpdateLayersPanelOptionsLayout { layout_target, diff }, + LayoutTarget::LayersPanelControlBar => FrontendMessage::UpdateLayersPanelControlBarLayout { layout_target, diff }, LayoutTarget::MenuBar => unreachable!("Menu bar is not diffed"), - LayoutTarget::NodeGraphBar => FrontendMessage::UpdateNodeGraphBarLayout { layout_target, diff }, + LayoutTarget::NodeGraphControlBar => FrontendMessage::UpdateNodeGraphControlBarLayout { layout_target, diff }, LayoutTarget::PropertiesSections => FrontendMessage::UpdatePropertyPanelSectionsLayout { layout_target, diff }, LayoutTarget::ToolOptions => FrontendMessage::UpdateToolOptionsLayout { layout_target, diff }, LayoutTarget::ToolShelf => FrontendMessage::UpdateToolShelfLayout { layout_target, diff }, diff --git a/editor/src/messages/layout/utility_types/layout_widget.rs b/editor/src/messages/layout/utility_types/layout_widget.rs index 06ba2007..dfff3e84 100644 --- a/editor/src/messages/layout/utility_types/layout_widget.rs +++ b/editor/src/messages/layout/utility_types/layout_widget.rs @@ -33,11 +33,11 @@ pub enum LayoutTarget { /// Contains the dropdown for design / select / guide mode found on the top left of the canvas. DocumentMode, /// Options for opacity seen at the top of the Layers panel. - LayersPanelOptions, + LayersPanelControlBar, /// The dropdown menu at the very top of the application: File, Edit, etc. MenuBar, /// Bar at the top of the node graph containing the location and the "Preview" and "Hide" buttons. - NodeGraphBar, + NodeGraphControlBar, /// The body of the Properties panel containing many collapsable sections. PropertiesSections, /// The bar directly above the canvas, left-aligned and to the right of the document mode dropdown. diff --git a/editor/src/messages/portfolio/document/document_message_handler.rs b/editor/src/messages/portfolio/document/document_message_handler.rs index 3258ecaf..5fc56143 100644 --- a/editor/src/messages/portfolio/document/document_message_handler.rs +++ b/editor/src/messages/portfolio/document/document_message_handler.rs @@ -275,10 +275,10 @@ impl MessageHandler> for DocumentMessag let data_buffer: RawBuffer = Self::default().serialize_root(); responses.add(FrontendMessage::UpdateDocumentLayerStructure { data_buffer }); - // Clear the options bar + // Clear the control bar responses.add(LayoutMessage::SendLayout { layout: Layout::WidgetLayout(Default::default()), - layout_target: LayoutTarget::LayersPanelOptions, + layout_target: LayoutTarget::LayersPanelControlBar, }); } DocumentMessage::InsertBooleanOperation { operation } => { @@ -350,7 +350,7 @@ impl MessageHandler> for DocumentMessag DocumentMessage::DocumentHistoryBackward => self.undo_with_history(ipp, responses), DocumentMessage::DocumentHistoryForward => self.redo_with_history(ipp, responses), DocumentMessage::DocumentStructureChanged => { - self.update_layers_panel_options_bar_widgets(responses); + self.update_layers_panel_control_bar_widgets(responses); self.network_interface.load_structure(); let data_buffer: RawBuffer = self.serialize_root(); @@ -1901,7 +1901,7 @@ impl DocumentMessageHandler { }); } - pub fn update_layers_panel_options_bar_widgets(&self, responses: &mut VecDeque) { + pub fn update_layers_panel_control_bar_widgets(&self, responses: &mut VecDeque) { // Get an iterator over the selected layers (excluding artboards which don't have an opacity or blend mode). let selected_nodes = self.network_interface.selected_nodes(&[]).unwrap(); let selected_layers_except_artboards = selected_nodes.selected_layers_except_artboards(&self.network_interface); @@ -1969,7 +1969,7 @@ impl DocumentMessageHandler { .selected_layers(self.metadata()) .all(|layer| self.network_interface.is_locked(&layer.to_node(), &[])); - let layers_panel_options_bar = WidgetLayout::new(vec![LayoutGroup::Row { + let layers_panel_control_bar = WidgetLayout::new(vec![LayoutGroup::Row { widgets: vec![ DropdownInput::new(blend_mode_menu_entries) .selected_index(blend_mode.and_then(|blend_mode| blend_mode.index_in_list_svg_subset()).map(|index| index as u32)) @@ -2037,8 +2037,8 @@ impl DocumentMessageHandler { }]); responses.add(LayoutMessage::SendLayout { - layout: Layout::WidgetLayout(layers_panel_options_bar), - layout_target: LayoutTarget::LayersPanelOptions, + layout: Layout::WidgetLayout(layers_panel_control_bar), + layout_target: LayoutTarget::LayersPanelControlBar, }); } @@ -2295,7 +2295,7 @@ impl Iterator for ClickXRayIter<'_> { } } -// TODO: Eventually remove this (probably starting late 2024) +// TODO: Eventually remove this document upgrade code #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct OldDocumentMessageHandler { // ============================================ diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs index 972035a7..7423911c 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs @@ -1637,11 +1637,11 @@ impl NodeGraphMessageHandler { common } - /// Send the cached layout to the frontend for the options bar at the top of the node panel + /// Send the cached layout to the frontend for the control bar at the top of the node panel fn send_node_bar_layout(&self, responses: &mut VecDeque) { responses.add(LayoutMessage::SendLayout { layout: Layout::WidgetLayout(WidgetLayout::new(self.widgets.to_vec())), - layout_target: LayoutTarget::NodeGraphBar, + layout_target: LayoutTarget::NodeGraphControlBar, }); } diff --git a/editor/src/messages/portfolio/document/utility_types/network_interface.rs b/editor/src/messages/portfolio/document/utility_types/network_interface.rs index 5427a27f..54add70d 100644 --- a/editor/src/messages/portfolio/document/utility_types/network_interface.rs +++ b/editor/src/messages/portfolio/document/utility_types/network_interface.rs @@ -3311,7 +3311,7 @@ impl NodeNetworkInterface { node.implementation = implementation; } - // TODO: Eventually remove this (probably starting late 2024) + // TODO: Eventually remove this document upgrade code /// Keep metadata in sync with the new implementation if this is used by anything other than the upgrade scripts pub fn replace_implementation_metadata(&mut self, node_id: &NodeId, network_path: &[NodeId], metadata: DocumentNodePersistentMetadata) { let Some(network_metadata) = self.network_metadata_mut(network_path) else { diff --git a/editor/src/messages/portfolio/portfolio_message_handler.rs b/editor/src/messages/portfolio/portfolio_message_handler.rs index 3e01f155..9482d2f2 100644 --- a/editor/src/messages/portfolio/portfolio_message_handler.rs +++ b/editor/src/messages/portfolio/portfolio_message_handler.rs @@ -407,7 +407,7 @@ impl MessageHandler> for PortfolioMes } }; - // TODO: Eventually remove this (probably starting late 2024) + // TODO: Eventually remove this document upgrade code // Upgrade all old nodes to support editable subgraphs introduced in #1750 if upgrade_from_before_editable_subgraphs { // This can be used, if uncommented, to upgrade demo artwork with outdated document node internals from their definitions. Delete when it's no longer needed. @@ -461,7 +461,7 @@ impl MessageHandler> for PortfolioMes }; // Upgrade Fill nodes to the format change in #1778 - // TODO: Eventually remove this (probably starting late 2024) + // TODO: Eventually remove this document upgrade code let Some(ref reference) = node_metadata.persistent_metadata.reference.clone() else { continue; }; @@ -616,7 +616,7 @@ impl MessageHandler> for PortfolioMes } } - // TODO: Eventually remove this (probably starting late 2024) + // TODO: Eventually remove this document upgrade code // Upgrade document to the new vector manipulation format introduced in #1676 let document_serialized_content = document.serialize_document(); if upgrade_vector_manipulation_format && !document_serialized_content.is_empty() { @@ -974,7 +974,7 @@ impl PortfolioMessageHandler { fn load_document(&mut self, new_document: DocumentMessageHandler, document_id: DocumentId, responses: &mut VecDeque) { let new_document = new_document; self.document_ids.push(document_id); - new_document.update_layers_panel_options_bar_widgets(responses); + new_document.update_layers_panel_control_bar_widgets(responses); self.documents.insert(document_id, new_document); diff --git a/editor/src/messages/tool/common_functionality/shape_editor.rs b/editor/src/messages/tool/common_functionality/shape_editor.rs index bfc0e6b0..26fa445a 100644 --- a/editor/src/messages/tool/common_functionality/shape_editor.rs +++ b/editor/src/messages/tool/common_functionality/shape_editor.rs @@ -795,7 +795,7 @@ impl ShapeState { while let Some((anchor, handles)) = missing_anchors.keys().next().copied().and_then(|id| missing_anchors.remove_entry(&id)) { visited.push(anchor); - // If the adgacent point is just this point then skip + // If the adjacent point is just this point then skip let mut handles = handles.map(|handle| (handle.1 != anchor).then_some(handle)); // If the adjacent points are themselves being deleted, then repeatedly visit the newest agacent points. diff --git a/editor/src/messages/tool/utility_types.rs b/editor/src/messages/tool/utility_types.rs index 74d4c179..948451b1 100644 --- a/editor/src/messages/tool/utility_types.rs +++ b/editor/src/messages/tool/utility_types.rs @@ -63,8 +63,7 @@ pub trait Fsm { /// The implementing tool must set this to a struct designed to store the internal values stored in the tool. /// For example, it might be used to store the starting location of a point when a drag began so the displacement distance can be calculated. type ToolData; - /// The implementing tool must set this to a struct (or `()` if none) designed to store the values of the tool options set by the user in the Options Bar - /// (located above the viewport, below the document's tab). + /// The implementing tool must set this to a struct (or `()` if none) designed to store the values of the tool options set by the user in the tool controls portion on the left of the control bar. type ToolOptions; /// Implementing this mandatory trait function lets a specific tool react accordingly (and potentially change its state or internal variables) upon receiving an event to do something. diff --git a/frontend/src/components/panels/Document.svelte b/frontend/src/components/panels/Document.svelte index 1301cefb..84c1a08e 100644 --- a/frontend/src/components/panels/Document.svelte +++ b/frontend/src/components/panels/Document.svelte @@ -444,18 +444,18 @@ e.preventDefault()} on:drop={dropFile}> - + {#if !$document.graphViewOverlayOpen} {:else} - + {/if} - + {#if !$document.graphViewOverlayOpen} @@ -471,24 +471,24 @@ {:else} {/if} - + - + {#if rulersVisible} {/if} - + {#if rulersVisible} {/if} - + {#if cursorEyedropper} { - editor.subscriptions.subscribeJsMessage(UpdateLayersPanelOptionsLayout, (updateLayersPanelOptionsLayout) => { - patchWidgetLayout(layersPanelOptionsLayout, updateLayersPanelOptionsLayout); - layersPanelOptionsLayout = layersPanelOptionsLayout; + editor.subscriptions.subscribeJsMessage(UpdateLayersPanelControlBarLayout, (updateLayersPanelControlBarLayout) => { + patchWidgetLayout(layersPanelControlBarLayout, updateLayersPanelControlBarLayout); + layersPanelControlBarLayout = layersPanelControlBarLayout; }); editor.subscriptions.subscribeJsMessage(UpdateDocumentLayerStructureJs, (updateDocumentLayerStructure) => { @@ -403,8 +403,8 @@ (dragInPanel = false)}> - - + + deselectAllLayers()} on:dragover={updateInsertLine} on:dragend={drop} on:drop={drop}> @@ -489,8 +489,8 @@