From 8ed11dcf2648444776da886684608c65b61bbabc Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 19 Nov 2026 10:09:38 +0100 Subject: [PATCH] :bug: Show a component's annotation in the Inspect styles view The annotation of a main component or a copy only showed in the Computed view of the Inspect tab; the Styles view, the default one in the workspace and in View mode, never rendered it. The Styles view now shows the annotation, above the exports, as the Computed view does. Found by the components Qase run (PENPOT-1428, PENPOT-1429, PENPOT-1618). Checked in the browser: selecting an annotated main component shows its annotation in Inspect > Styles. AI-assisted-by: claude-opus-5-5 --- frontend/src/app/main/ui/inspect/styles.cljs | 6 ++++++ frontend/src/app/main/ui/inspect/styles.scss | 1 + 2 files changed, 7 insertions(+) diff --git a/frontend/src/app/main/ui/inspect/styles.cljs b/frontend/src/app/main/ui/inspect/styles.cljs index 96a54a7b47..4e6d10b22c 100644 --- a/frontend/src/app/main/ui/inspect/styles.cljs +++ b/frontend/src/app/main/ui/inspect/styles.cljs @@ -16,6 +16,7 @@ [app.common.types.tokens-lib :as ctob] [app.main.data.style-dictionary :as sd] [app.main.refs :as refs] + [app.main.ui.inspect.annotation :refer [annotation*]] [app.main.ui.inspect.exports :as exports] [app.main.ui.inspect.styles.panels.blur :refer [blur-panel*]] [app.main.ui.inspect.styles.panels.fill :refer [fill-panel*]] @@ -110,6 +111,8 @@ first-component (ctkl/get-component data (:component-id first-shape)) shape-type (get-shape-type shapes first-shape first-component) panels (type->panel-group shape-type) + annotation-content (when (= (count shapes) 1) + (ctkl/get-component-annotation first-shape libraries)) tokens-lib (mf/deref refs/tokens-lib) tokens-status (mf/deref refs/tokens-status) @@ -279,6 +282,9 @@ ;; DEFAULT WIP [:> style-box* {:panel panel} [:div color-space]])])] + (when annotation-content + [:div {:class (stl/css :annotation-wrapper)} + [:> annotation* {:content annotation-content}]]) [:div {:class (stl/css :exports-wrapper)} [:& exports/exports {:shapes shapes diff --git a/frontend/src/app/main/ui/inspect/styles.scss b/frontend/src/app/main/ui/inspect/styles.scss index 865542c3f2..a6818c91f2 100644 --- a/frontend/src/app/main/ui/inspect/styles.scss +++ b/frontend/src/app/main/ui/inspect/styles.scss @@ -14,6 +14,7 @@ block-size: calc(100vh - px2rem(180)); // TODO: Fix this hardcoded value } +.annotation-wrapper, .exports-wrapper { padding-block: var(--sp-s); padding-inline: var(--sp-m);