Skip to content

chore: View.vue の style ブロックを Tailwind に置き換える - #187

Merged
isamu merged 1 commit into
mainfrom
chore/view-utilities
Oct 21, 2026
Merged

isamu merged 1 commit into
mainfrom
chore/view-utilities

Conversation

@isamu

@isamu isamu commented Oct 21, 2026

Copy link
Copy Markdown
Member

Summary

Replaces View.vue's <style scoped> block with Tailwind classes. This clears scoria's ui-token/style-block finding. The look does not change.

  • Every value is the stylesheet's own value, written as a Tailwind class or an arbitrary value (text-[0.9em], bg-[#217346] and the like).
  • The table XLSX renders (through v-html) gets its styling from arbitrary variants on its container: [&_td]:…, [&_tr:nth-child(even)]:…, [&_.cell-editing]:…. Nothing goes into a global stylesheet.
    • The old :deep() rules were scoped to this component. Putting them in a global stylesheet could have hit a host's own .table-container, which is why they stay on the container.
  • Long or repeated class strings move to src/vue/viewClasses.ts: the table, the sheet tabs, the editor, the buttons and the mini editor's inputs.
  • Pseudo-elements and states use Tailwind's variants: group-open: for details[open] summary, placeholder:, focus: and disabled:.

Items to Confirm

  • The look does not change. The old (origin/main) and new demos were opened in Chromium (playwright-core) and the computed styles of every element under the View component compared, in every state:
    • States: each sample loaded; a cell hovered; the editor opened; summary hovered; the textarea and the inputs focused; a cell clicked (green editing highlight); a formula cell clicked (orange referenced-cell highlight); the radio switched; ✕ hovered; Apply enabled and hovered; two sheets applied; a tab hovered; the second tab.
    • Values compared: the size and position of each element, and its margin, padding, border, colours, font, alignment, overflow, cursor, outline, shadow, opacity, border-collapse, transition and the like.
    • Result: everything matches except three things you cannot see.
      • The outline's width and colour while it is off: outline-style itself is none in both.
      • The box shadow: Tailwind adds transparent layers in front of the same visible shadow.
      • On focus, the input border's colour mid-transition (0.2s): it was caught at a different moment.
    • Full-page screenshots also match. No console errors.
  • The hover over rows is !important. It and the alternate rows' colour have the same specificity, so which one wins would depend on the order Tailwind writes them in. Marking hover important makes the old order (hover wins) certain.
  • yarn lint, yarn typecheck, yarn build, yarn test and yarn test:engine pass. dist/style.css contains the new classes, as the build writes them.
  • Not fixed here: View.vue's god-file (over 500 lines). This change makes the file shorter, but not under the limit.

User Prompt

🤖 Generated with Claude Code

work in GUIChatPluginSpreadsheet

Same values as the stylesheet had; the rules for the table XLSX renders become arbitrary variants on
its container, so nothing moves to a global stylesheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isamu

isamu commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

CODEX VERDICT: LGTM

  • N1 (verification prose): the PR body says the Chromium comparison covered every state, but its state list omits the old Apply-button :active, :disabled, and :disabled:hover rules. The implementation does emit the corresponding active/disabled utilities, so this is documentation-only. Every occurrence is the “Items to Confirm” state list in the PR body. Smallest resolution: add those three Apply states (or explicitly say they were not probed) to that list. What would change my mind: the probe is shown to exercise those states, or the body is corrected.
Axis Result
correctness and edge cases none
security (injection / path traversal / code evaluation) none
tests: does a test go red if the new behaviour breaks none; no style-specific automated regression test was added, while the stated Chromium probe covers the visual behavior
API / schema / wire / on-disk compatibility none
consistency with the rest of the codebase none
i18n lockstep (all 8 src/lang locales) none; no locale keys or text changed
TIER C (UI: every rendering of View; CSS delivery to hosts) none
visual equivalence none; the removed rules have matching classes and the requested specificity/order checks are preserved
Tailwind v4 syntax and state variants none; build output contains the arbitrary values/variants, including group-open:, trailing !, [&_td]:, and [border-bottom-style:solid]
delivery: Tailwind source detection and global-vs-scoped CSS none; yarn build emitted the new classes in dist/style.css; no old scoped selector was left needed
verification state coverage N1 above: the listed probe states miss Apply active/disabled/disabled-hover

Read sha: ab07870055ef066e3208cd7c9a2b9150756e75ec.

Verification run: yarn build and yarn typecheck passed. npx vitest run --configLoader runner could not start because the existing vite.config.ts references undefined __dirname. yarn test:engine ran 2216 tests: 2215 passed and 1 failed in the pre-existing custom-function interruption assertion; that failure is outside this diff.

FINDINGS COMPLETE: I read every hunk of the diff and this is every finding I have.

@isamu
isamu merged commit 1b6eb50 into main Oct 21, 2026
17 checks passed
@isamu
isamu deleted the chore/view-utilities branch October 21, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant