Merge pull request #2380 from denisg0mes/eyedropper-onto-stroke

M4: The eyedropper colours a stroke-only layer's stroke and shows its colour
This commit is contained in:
BFlat authored and GitHub committed 2026-11-27 15:19:40 +07:00
commit 10cccb2c82
8 files changed
+164 -4

No files matched your search

+13 -1
View File
@@ -414,7 +414,15 @@ impl Session {
// and what to call it; nothing is applied).
self.request_ui("dialog.createFromColor", json!({"color": c.to_css_hex()}));
} else if !sel.is_empty() {
self.execute("node.set", &json!({"ids": sel, "props": {"fill": c.to_css_hex()}}))?;
let (stroked, filled): (Vec<NodeId>, Vec<NodeId>) = sel.iter().partition(|id| doc.node(**id).is_some_and(takes_pick_on_stroke));
self.grouped("Pick color", |s| {
for (ids, key) in [(filled, "fill"), (stroked, "stroke")] {
if !ids.is_empty() {
s.execute("node.set", &json!({"ids": ids, "props": {key: c.to_css_hex()}}))?;
}
}
Ok(())
})?;
}
self.recent_colors.retain(|x| *x != c);
self.recent_colors.insert(0, c);
@@ -424,3 +432,7 @@ impl Session {
Ok(())
}
}
fn takes_pick_on_stroke(n: &Node) -> bool {
!n.fills.iter().any(|p| p.visible) && n.strokes.iter().any(|p| p.visible)
}
@@ -0,0 +1,58 @@
use figcraft_doc::NodeId;
use serde_json::json;
use crate::Session;
use crate::tools::{PointerEvent, PointerKind};
fn rect(s: &mut Session, x: f64, props: serde_json::Value) -> NodeId {
let r = s.execute("shape.rectangle", &json!({"x": x, "y": 0, "width": 100, "height": 100, "props": props})).unwrap();
crate::params::id_of(&r["id"]).unwrap()
}
fn hex(paints: &[figcraft_color::Paint]) -> Vec<String> {
paints.iter().map(|p| p.solid_color().map(|c| c.to_hex()).unwrap_or_default()).collect()
}
fn pick_red_onto(s: &mut Session, ids: &[NodeId]) {
s.execute("select.set", &json!({"ids": ids})).unwrap();
s.execute("edit.pickColor", &json!({})).unwrap();
s.pointer(&PointerEvent::at(PointerKind::Down, 50.0, 50.0, 1.0)).unwrap();
}
fn scene() -> Session {
let mut s = Session::new();
s.execute("page.setBackground", &json!({"color": "#FFFFFF"})).unwrap();
rect(&mut s, 0.0, json!({"fills": ["#FF0000"]}));
s
}
#[test]
fn a_layer_with_only_a_stroke_takes_the_pick_on_its_stroke() {
let mut s = scene();
let outline = rect(&mut s, 200.0, json!({"fills": [], "strokes": ["#0000FF"], "strokeWeight": 2}));
pick_red_onto(&mut s, &[outline]);
let n = s.doc().unwrap().node(outline).unwrap().clone();
assert!(n.fills.is_empty(), "no fill appears: {:?}", n.fills);
assert_eq!(hex(&n.strokes), ["FF0000"]);
assert_eq!(n.stroke.weight, 2.0, "the stroke keeps its weight");
}
#[test]
fn a_hidden_fill_counts_as_none_and_a_visible_one_takes_the_pick() {
let mut s = scene();
let hidden = rect(&mut s, 200.0, json!({"fills": [{"type": "solid", "color": "#00FF00", "visible": false}], "strokes": ["#0000FF"]}));
let filled = rect(&mut s, 400.0, json!({"fills": ["#00FF00"], "strokes": ["#0000FF"]}));
let bare = rect(&mut s, 600.0, json!({"fills": [], "strokes": []}));
let undo = s.undo_depth().0;
pick_red_onto(&mut s, &[hidden, filled, bare]);
let d = s.doc().unwrap();
let (h, f, b) = (d.node(hidden).unwrap(), d.node(filled).unwrap(), d.node(bare).unwrap());
assert_eq!((hex(&h.strokes), h.fills.iter().any(|p| p.visible)), (vec!["FF0000".to_string()], false));
assert_eq!((hex(&f.fills), hex(&f.strokes)), (vec!["FF0000".to_string()], vec!["0000FF".to_string()]));
assert_eq!(hex(&b.fills), ["FF0000"], "with neither, the fill as before");
assert_eq!(s.undo_depth().0, undo + 1, "one step for the whole selection");
s.execute("edit.undo", &json!({})).unwrap();
let d = s.doc().unwrap();
assert_eq!(hex(&d.node(hidden).unwrap().strokes), ["0000FF"]);
assert_eq!(hex(&d.node(filled).unwrap().fills), ["00FF00"]);
}
+2
View File
@@ -342,6 +342,8 @@ mod eyedropper_create_tests;
#[cfg(test)]
mod eyedropper_image_tests;
#[cfg(test)]
mod eyedropper_stroke_tests;
#[cfg(test)]
mod facilitate_tests;
#[cfg(test)]
mod fig_export_assets_tests;
+29 -2
View File
@@ -53,6 +53,7 @@ pub mod widget_bar;
pub struct CanvasState {
pub rect: Rect,
texture: Option<egui::TextureHandle>,
tex_pixels: Option<Arc<egui::ColorImage>>,
tex_view: Option<figcraft_render::View>,
/// The file ([`figcraft_engine::DocState::uid`]) and page the texture shows: it is drawn only
/// on them.
@@ -146,6 +147,7 @@ impl Default for CanvasState {
Self {
rect: Rect::NOTHING,
texture: None,
tex_pixels: None,
tex_view: None,
tex_of: None,
tex_coarse: false,
@@ -196,6 +198,7 @@ impl CanvasState {
fn switch_texture(&mut self, shown: Option<(u64, NodeId)>, open: impl Fn(u64) -> bool) {
if shown.is_some() && self.tex_of != shown {
let back = self.kept.iter().position(|k| Some(k.of) == shown).map(|i| self.kept.remove(i));
self.tex_pixels = None;
let (texture, view, of) = (self.texture.take(), self.tex_view.take(), self.tex_of.take());
// An image without the dragged layers isn't the page's complete one: not kept.
if let (Some(texture), Some(view), Some(of), false, false) = (texture, view, of, self.tex_coarse, self.tex_skipped) {
@@ -216,6 +219,23 @@ impl CanvasState {
pub(crate) fn drop_closed(&mut self, open: impl Fn(u64) -> bool) {
self.kept.retain(|k| open(k.of.0));
}
pub(crate) fn pixel_under(&self, p: Point, of: Option<(u64, NodeId)>, page: Color32) -> Option<Color32> {
let (image, v) = (self.tex_pixels.as_ref()?, self.tex_view.as_ref()?);
if of.is_none() || self.tex_of != of {
return None;
}
let x = ((p.x - v.origin.0) * v.scale).floor();
let y = ((p.y - v.origin.1) * v.scale).floor();
let [w, h] = image.size;
if !(x >= 0.0 && y >= 0.0 && x < w as f64 && y < h as f64) {
return None;
}
let c = *image.pixels.get(y as usize * w + x as usize)?;
let under = 255 - u16::from(c.a());
let over = |a: u8, b: u8| (u16::from(a) + (u16::from(b) * under + 127) / 255).min(255) as u8;
Some(Color32::from_rgb(over(c.r(), page.r()), over(c.g(), page.g()), over(c.b(), page.b())))
}
}
/// What the canvas shows while an IME composition is in progress: the document with the
@@ -388,10 +408,12 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) {
} else {
egui::TextureOptions::LINEAR
};
let pixels = Arc::new(done.image);
match &mut app.canvas.texture {
Some(t) => t.set(done.image, filter),
None => app.canvas.texture = Some(ctx.load_texture("figcraft-canvas", done.image, filter)),
Some(t) => t.set(Arc::clone(&pixels), filter),
None => app.canvas.texture = Some(ctx.load_texture("figcraft-canvas", Arc::clone(&pixels), filter)),
}
app.canvas.tex_pixels = Some(pixels);
let done_at = done.at;
let latency = Some(done.at.elapsed().as_secs_f64() * 1000.0);
if done.coarse {
@@ -485,6 +507,11 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) {
let panning = app.canvas.space_pan || app.canvas.middle_pan.is_some();
let shown = crate::cursors::on_canvas(panning, ctx.input(|i| i.pointer.any_down()), app.canvas.zoom_tool, app.session.tool.overlay.cursor);
shown.show(&ctx, at);
if shown == crate::cursors::Shown::Drawn(crate::cursors::Glyph::Eyedropper)
&& let Some(c) = app.canvas.pixel_under(app.to_page(at), app.session.ds().ok().map(|ds| (ds.uid, ds.page)), bg)
{
crate::cursors::sampled_swatch(&ctx, at, c);
}
app.canvas.cursor = Some(shown);
}
}
+11
View File
@@ -130,6 +130,17 @@ impl Shown {
}
}
pub fn sampled_swatch(ctx: &egui::Context, at: Pos2, color: Color32) {
let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Tooltip, egui::Id::unique("canvas_cursor_swatch")));
let centre = at + vec2(SWATCH_OFFSET, SWATCH_OFFSET);
painter.circle_filled(centre, SWATCH_RADIUS + 2.0, INK);
painter.circle_filled(centre, SWATCH_RADIUS + 1.0, EDGE);
painter.circle_filled(centre, SWATCH_RADIUS, color);
}
pub(crate) const SWATCH_OFFSET: f32 = 16.0;
pub(crate) const SWATCH_RADIUS: f32 = 8.0;
/// Dark lines over a light edge: readable on any page and artwork.
pub(crate) const INK: Color32 = Color32::from_rgb(0x1E, 0x1E, 0x1E);
const EDGE: Color32 = Color32::WHITE;
@@ -88,3 +88,49 @@ fn closing_the_picker_drops_its_eyedropper() {
assert_eq!(u.app.session.tool.tool, ToolId::Move);
assert_eq!(u.app.session.tool.picked, None, "a colour sampled for a closed picker is dropped");
}
#[test]
fn the_pick_color_key_with_a_picker_open_colours_the_pickers_paint() {
let mut s = Session::new();
s.execute("page.setBackground", &json!({"color": "#FFFFFF"})).unwrap();
rect(&mut s, 0.0, json!({"fill": "#FF0000"}));
let b = rect(&mut s, 200.0, json!({"fill": "#00FF00", "stroke": "#0000FF"}));
s.execute("select.set", &json!({"ids": [b]})).unwrap();
let target = PickerTarget::Paint { fills: false, index: 0, ids: vec![b] };
let mut u = Ui::new(s);
u.app.ui.picker = Some(target.clone());
u.frame(vec![]);
let key = |pressed| Event::Key { key: egui::Key::I, physical_key: None, pressed, repeat: false, modifiers: egui::Modifiers::NONE };
u.frame(vec![key(true), key(false)]);
assert_eq!((u.app.session.tool.tool, u.app.session.tool.pick_only), (ToolId::Eyedropper, true));
let on_red = u.app.to_screen(30.0, 30.0);
click(&mut u, on_red);
let n = u.app.session.doc().unwrap().node(b).unwrap().clone();
let hex = |p: &figcraft_color::Paint| p.solid_color().map(|c| c.to_hex()).unwrap_or_default();
assert_eq!((hex(&n.strokes[0]), hex(&n.fills[0])), ("FF0000".to_string(), "00FF00".to_string()));
assert_eq!(u.app.ui.picker, Some(target), "the picker stays open on its paint");
}
#[test]
fn the_eyedropper_shows_the_colour_under_it_from_the_canvas_image() {
let mut s = Session::new();
s.execute("page.setBackground", &json!({"color": "#FFFFFF"})).unwrap();
rect(&mut s, 0.0, json!({"fill": "#FF0000"}));
let mut u = Ui::new(s);
u.app.session.execute("edit.pickColor", &json!({})).unwrap();
let of = u.app.session.ds().ok().map(|ds| (ds.uid, ds.page));
let under = |u: &Ui, x: f64| u.app.canvas.pixel_under(figcraft_geom::Point::new(x, 30.0), of, egui::Color32::WHITE);
let mut seen = None;
for _ in 0..500 {
let p = u.app.to_screen(30.0, 30.0);
u.frame(vec![Event::PointerMoved(p)]);
seen = under(&u, 30.0);
if seen.is_some() {
break;
}
std::thread::sleep(std::time::Duration::from_millis(4));
}
assert_eq!(seen, Some(egui::Color32::from_rgb(255, 0, 0)));
assert_eq!(under(&u, 130.0), Some(egui::Color32::WHITE), "the page around it");
assert_eq!(u.app.canvas.cursor.map(|c| c.name()).as_deref(), Some("eyedropper"));
}
+3
View File
@@ -419,6 +419,9 @@ pub fn run_binding(app: &mut FigApp, id: &str) {
"edit.delete" if app.session.tool.pen.is_some() => {
let _ = app.session.pen_finish();
}
"edit.pickColor" if app.ui.picker.is_some() => {
app.run("edit.pickColor", json!({"apply": false}));
}
// Enter with a shape or frame tool chosen places one in the middle of the view.
"select.children" if !dev && app.session.tool.tool.draws_shape() => {
app.run("tool.place", json!({}));
+2 -1
View File
@@ -1,6 +1,6 @@
# UI and interaction parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-24 · **Change:** minor (Shift with a double-click goes a level deeper and keeps the rest of the selection, so layers nested in neighbouring artboards can be selected together; M1: Frame selection makes a frame without a fill; M1: centred auto-width text keeps its middle as it grows and shrinks; M1: a drag on a section's background, or on the background of a frame in it, draws a marquee; the Layers panel's eye and padlock stay at the list's right edge, and a name takes at most 400 pt; in vector edit mode, deleting a point selects the next one on its path, so Delete pressed again goes on along it; the hover and selection outline of a curved layer bends smoothly instead of showing straight pieces; text copied while editing, or a whole text layer copied, pastes into a text edit with its formatting and its layer's colour, and Shift+Cmd/Ctrl+V (also Alt+Cmd/Ctrl+V) pastes it in the style at the caret; crop mode: the layer's sides and corners crop its image in an auto layout frame too, up to the image's edges, change a locked ratio (Shift keeps it), the image's own corners scale freely with Shift proportional as a resize does, and crop mode and vector edit mode end each other; after a click on a layer row the arrow keys nudge the selection, or move a layer in an auto layout flow one place, as in Figma; the rows take the arrows once they have the keyboard (F6); Shift+Cmd/Ctrl+V with several layers selected pastes after the last of them as seen: next in an auto layout frame's flow, else below the lowest or right of the rightmost, at the selection's own gap; Tab and Shift+Tab while editing a text layer go on to the next or previous text layer of its frame, in reading order, with all of its text selected; a file opens again on the page and at the view it was left at; the desktop app reopens the files open when it quit, in their tabs' order with the same one in front, and with nothing to reopen starts on the Home screen instead of in a new file; a dropdown, button menu or context menu in the panels that is taller than the window scrolls, so its last rows can be picked; frames, sections, components and instances move, resize and draw on whole pixels whatever Snap to pixel grid says and whatever they snap to, as Figma's help says; the pixel grid shows on a dark canvas and dark fills as well as on white, its lines one screen pixel wide in a light grey at a fifth of its strength, as measured in Figma; Shift+Cmd/Ctrl+' says at the bottom of the window whether snapping to the pixel grid is now on or off; Paste properties links the copied layer's colour, effect, grid and text styles and binds the variables it follows, and a frame's layout grids come along; links another file lacks paste as values; mind maps from the toolbar and the keyboard: Shapes ▸ Mind map places one with a click, Cmd/Ctrl+Enter adds a child and Shift+Cmd/Ctrl+Enter a sibling, Tab goes to the next sibling (#2226); a dragged layer is drawn from a sprite that moves with its outline (#2033); the Scale tool keeps variable-bound lengths scaled: a scaled instance keeps its bindings and draws them at the variable's value times its scale factor, other scaled layers keep the scaled value and drop the binding (#2090); Type settings ▸ Details ▸ Position sets the selected text layers to superscript or subscript, or neither (#2338); Shift with the Pencil, Marker or Highlighter draws one straight segment from where the stroke started, at the nearest 45° step, as the Line tool and the Pen do (#2447); the Design panel's header names a selected component or component set, after its icon, instead of only its type (#2347); dragging near the canvas edge pans the view toward it, as measured in Figma: 40 px/s for each px within about 15 px of the edge, 600 px/s at it, for moving layers, the selection box, drawing and prototype connections (#2015); M8: a Shift-click range in the Layers panel across parents keeps a frame and not its covered children, measured in Figma's web app on 2026-11-12; points align and distribute in vector edit mode as in Figma: the six Align commands, the keys Alt+A/H/D/W/V/S, and Distribute horizontal and vertical spacing act on the selected points, each moving along one axis to their box's edge or centre line, spaced evenly between the outermost for distribute, with the alignment row first in the Design panel (#2109); going back to a page shows it where it was left, not fitted again; Duplicate repeats the last copy's move and its rotation (about the copy's centre, or the selection's centre for several layers), not its size, and forgets the step when the selection changes, measured in Figma's web app on 2026-11-12 (#2293); M8: a double-click on a layer's icon zooms to it instead of renaming, measured in Figma's web app on 2026-11-12; Tidy up keeps the order and sizes and evens the gaps, as measured in Figma's web app on 2026-11-12, rounds the gap half up, tidies overlapping rows and paLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-24 · **Change:** minor (M4: the eyedropper colours the stroke of a layer that has only a stroke, samples for an open colour picker from the shortcut too, and shows the colour under it beside the pointer; Shift with a double-click goes a level deeper and keeps the rest of the selection, so layers nested in neighbouring artboards can be selected together; M1: Frame selection makes a frame without a fill; M1: centred auto-width text keeps its middle as it grows and shrinks; M1: a drag on a section's background, or on the background of a frame in it, draws a marquee; the Layers panel's eye and padlock stay at the list's right edge, and a name takes at most 400 pt; in vector edit mode, deleting a point selects the next one on its path, so Delete pressed again goes on along it; the hover and selection outline of a curved layer bends smoothly instead of showing straight pieces; text copied while editing, or a whole text layer copied, pastes into a text edit with its formatting and its layer's colour, and Shift+Cmd/Ctrl+V (also Alt+Cmd/Ctrl+V) pastes it in the style at the caret; crop mode: the layer's sides and corners crop its image in an auto layout frame too, up to the image's edges, change a locked ratio (Shift keeps it), the image's own corners scale freely with Shift proportional as a resize does, and crop mode and vector edit mode end each other; after a click on a layer row the arrow keys nudge the selection, or move a layer in an auto layout flow one place, as in Figma; the rows take the arrows once they have the keyboard (F6); Shift+Cmd/Ctrl+V with several layers selected pastes after the last of them as seen: next in an auto layout frame's flow, else below the lowest or right of the rightmost, at the selection's own gap; Tab and Shift+Tab while editing a text layer go on to the next or previous text layer of its frame, in reading order, with all of its text selected; a file opens again on the page and at the view it was left at; the desktop app reopens the files open when it quit, in their tabs' order with the same one in front, and with nothing to reopen starts on the Home screen instead of in a new file; a dropdown, button menu or context menu in the panels that is taller than the window scrolls, so its last rows can be picked; frames, sections, components and instances move, resize and draw on whole pixels whatever Snap to pixel grid says and whatever they snap to, as Figma's help says; the pixel grid shows on a dark canvas and dark fills as well as on white, its lines one screen pixel wide in a light grey at a fifth of its strength, as measured in Figma; Shift+Cmd/Ctrl+' says at the bottom of the window whether snapping to the pixel grid is now on or off; Paste properties links the copied layer's colour, effect, grid and text styles and binds the variables it follows, and a frame's layout grids come along; links another file lacks paste as values; mind maps from the toolbar and the keyboard: Shapes ▸ Mind map places one with a click, Cmd/Ctrl+Enter adds a child and Shift+Cmd/Ctrl+Enter a sibling, Tab goes to the next sibling (#2226); a dragged layer is drawn from a sprite that moves with its outline (#2033); the Scale tool keeps variable-bound lengths scaled: a scaled instance keeps its bindings and draws them at the variable's value times its scale factor, other scaled layers keep the scaled value and drop the binding (#2090); Type settings ▸ Details ▸ Position sets the selected text layers to superscript or subscript, or neither (#2338); Shift with the Pencil, Marker or Highlighter draws one straight segment from where the stroke started, at the nearest 45° step, as the Line tool and the Pen do (#2447); the Design panel's header names a selected component or component set, after its icon, instead of only its type (#2347); dragging near the canvas edge pans the view toward it, as measured in Figma: 40 px/s for each px within about 15 px of the edge, 600 px/s at it, for moving layers, the selection box, drawing and prototype connections (#2015); M8: a Shift-click range in the Layers panel across parents keeps a frame and not its covered children, measured in Figma's web app on 2026-11-12; points align and distribute in vector edit mode as in Figma: the six Align commands, the keys Alt+A/H/D/W/V/S, and Distribute horizontal and vertical spacing act on the selected points, each moving along one axis to their box's edge or centre line, spaced evenly between the outermost for distribute, with the alignment row first in the Design panel (#2109); going back to a page shows it where it was left, not fitted again; Duplicate repeats the last copy's move and its rotation (about the copy's centre, or the selection's centre for several layers), not its size, and forgets the step when the selection changes, measured in Figma's web app on 2026-11-12 (#2293); M8: a double-click on a layer's icon zooms to it instead of renaming, measured in FigmaLine truncated
Fine canvas control is what Figma users feel first: handles, snapping, nudging, modifier keys,
drag behaviour, numeric precision. This checklist covers the tools, gestures and panels. Status:
@@ -231,6 +231,7 @@ This audit records candidates for subsequent fixes; their behaviour is unchanged
| 2026-11-15 | patch | M1: typing in centred auto-width text kept its left edge, so the text crept to the right. It now keeps its middle, half of each width change going to each side, also when rotated, under the same conditions as right-aligned text keeps its right edge (#1477). Tests: `text_behaviour_tests` |
| 2026-11-15 | patch | M1: Frame selection (Alt+Cmd/Ctrl+G) gave the new frame the white fill a drawn frame gets, which covered the page behind the framed layers. It now has no fill; a frame drawn with the Frame tool keeps its white fill. Test: `frames_behaviour_tests` |
| 2026-11-18 | patch | M1: a double-click with Shift held, on a layer in another artboard than the selected one, left only that artboard's layer selected, so layers nested in neighbouring artboards couldn't be selected together. It now goes a level deeper as a double-click does and keeps the rest of the selection: the selected layer it went into, or the layer a click would select there, is replaced by the one a level below, as in Figma. Where nothing on that branch is selected it starts beside the selection, just inside the deepest layer the branch shares with a selected one, so a Shift double-click on the next row of a list adds that row's label beside the selected label instead of collapsing the selection to the list. The selection it works from is the one before the double-click's two clicks, which Shift had already toggled. Test: `shift_double_click_tests` |
| 2026-11-15 | patch | M4: the eyedropper (I, Ctrl+C on macOS) gave a selected layer that had only a stroke a new fill. Such a layer now takes the colour on its stroke; other layers take it on their fill as before, and a mixed selection changes in one undo step. With a colour picker open on a fill or a stroke, the shortcut samples for that paint, as the picker's own eyedropper button does. A swatch beside the pointer shows the colour under it, read from the canvas image already on screen. Tests: `eyedropper_stroke_tests`, `colorpicker_eyedropper_tests` |
| 2026-11-19 | patch | M4, #2338: superscript and subscript were drawn (#1868) but nothing in the interface set them. Type settings ▸ Details now starts with Position: None, Superscript (X²) or Subscript (X₂), for the selected text layers, through `text.setFeatures` (`sups`, `subs`; choosing one clears the other). It shows the layers' current position, none when they differ. Raising a range of characters on its own needs per-run features and is left for a separate change. Test: `typography::variable_tests::details_position_sets_superscript_subscript_or_neither`. |
| 2026-11-19 | patch | M1, #2447: Shift did nothing with the Pencil: a stroke stayed freehand while the Line tool and the Pen keep theirs to 45° steps. With Shift held, the Pencil (and the Marker and Highlighter) now draws one straight segment from where the stroke started to the pointer, at the nearest 45° step; the preview shows it. A Shift-click without a move draws nothing, as before. Tests: `pencil_shift_tests`. |
| 2026-11-19 | patch | M3, #2347: with one component or component set selected, the Design panel's header said only "Component" or "Component set", so the selected one's name was only in the Layers panel. It now shows the name after a component icon (cut short with an ellipsis clear of the quick actions), with the type, and the whole name when cut, on hover. Other layers keep their type. Test: `component_header_tests::the_header_names_the_selected_component_or_set`. |