Skip to content

dedup(#9859 Family G): ChatMessages ↔ MessageItem — 182L shared scoped CSS #10306

Closed

Description

@mrveiss

Shared scoped CSS between src/components/chat/ChatMessages.vue and src/components/chat/MessageItem.vue (182L).

Wave 2 — these components have NO Storybook story yet, so the visual-regression harness does not cover them. Step 1 of this issue is to add Storybook stories + capture baselines; only then extract the shared CSS.

Protocol

  1. Add *.stories.ts for each component; run the visual suite once to capture baselines.
  2. Extract ONLY disjoint-identical scoped-CSS rule-blocks into a shared @/design-system/styles/<family>.css via <style scoped src="…"> (byte-identical, order-independent ⇒ provably identical).
  3. Visual-regression zero-diff is the merge gate; vue-tsc + unit tests.

Part of #9859 · part of #9921.

Activity

  1. mrveiss commented on Jun 19, 2026

    @mrveiss
    OwnerAuthor

    Deferring this family — not safely extractable via the shared-CSS method. Unlike the other dedup families (whose shared blocks are plain CSS, provably identical when moved to <style scoped src>), ChatMessages/MessageItem's shared styles are 26 of 28 blocks Tailwind @apply directives (e.g. @apply rounded-lg shadow-sm …, @apply shadow-md). Those need @reference "../../assets/tailwind.css" context, which the components have inline but does not transfer cleanly to a bare imported sheet — the extraction broke the build (Cannot apply unknown utility class shadow-md, PR #10339).

    Adding @reference to the shared sheet is the Tailwind-sanctioned path, but @apply inside a <style scoped src> imported file is unproven in this repo (all existing @reference usage is inline), and the dedup output can't be verified visual-identical here (visual gate broken — #10320). The residual plain-CSS duplication is only 2 blocks.

    Per the campaign's own principle ("duplication is cheaper than the wrong abstraction"), leaving the chat pair as-is. Closing as won't-fix-via-this-method.

  2. added a commit that references this issue on Jun 20, 2026
  3. mrveiss commented on Jun 20, 2026

    @mrveiss
    OwnerAuthor

    Completed (un-deferred) — merged to Dev_new_gui via PR #10366 (squash 38c7aa2). Extracted the 28 byte-identical shared blocks (mostly Tailwind @apply) into chat-message-shared.css with @reference "../../assets/tailwind.css" so @apply resolves in the imported sheet (−101 lines). smoke-test passed, which proves the build resolves @reference+@apply — and since @apply's only failure mode is a build error (never a silent diff), green build = identical output. Effective rule-set verified unchanged (197/53). Part of #9859.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions