Repository navigation
Keep backend edits out of the frontend CSS watch graph - #931
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 7
✨ Finishing Touches
Comment |
|
Qualified head
CI is running; no merge or performance claim yet. |
|
Follow-up correction tracked in #937: the generated release-note claim that backend edits do not trigger frontend style updates is broader than the demonstrated contract. The original regression proves Tailwind full-document reloads from implicit scanning. Its post-hotUpdate fence cannot exclude ordinary Vite CSS updates, which occur later. The correction keeps the full-reload and source-ownership checks and explicitly exercises ordinary CSS updates; the later captured js-update remains unattributed. Original evidence remains historical. |
…tes (#938) Frozen at1a1ca41d5fc21c1cd58f904fd103fadbe8aebf3d. Fresh FULL review of both heads and their latest-main assembly is clean at every priority. Current-head external review and CI remain required. Merge #938 before #933. ## Motivation The Tailwind regression from6f7c8b620 (#931) rejected ordinary CSS updates at a post-hotUpdate fence that precedes Vite’s ordinary dispatch. A full script gate captured an unattributed CSS js-update and blocked #933. The demonstrated #929 defect is Tailwind’s direct full document reload from implicit backend scanning; an ordinary update does not establish document destruction. Closes #937. The original no-HMR acceptance wording is corrected, retaining historical evidence. Later review also exposed that a positive UI assertion must identify the stylesheet and the event, rather than accept any update frame. ### Before A fence orders Tailwind’s direct reload but cannot exclude later Vite updates. Delivery timing also cannot attribute a prior or unrelated update to a UI edit. ```mermaid sequenceDiagram participant Tailwind as Tailwind hotUpdate participant Fence as Post hook participant Vite as Vite dispatch Tailwind-->>Fence: Direct reload if backend is scanned Fence-->>Vite: Fence precedes ordinary update dispatch ``` ## Solution 1. `41e392d47`: retain the direct full-reload exclusion, backend graph/class exclusion, registered UI compilation and production checks. Explicitly request a real normal stylesheet update before touching the unchanged backend. 2. `ccc14091d`: require an actual update for registered UI edits; a full reload alone cannot substitute. 3. `1a1ca41d5`: carry Vite’s event timestamp through the fence and match it with the imported stylesheet path/acceptedPath and actual js-update contract. Vite serves `?import` CSS as a JavaScript module. An earlier stylesheet update or current unrelated module update cannot satisfy the assertion; no global event map or sleep is needed. ### After The positive check follows the identity Vite publishes for the changed file through normal dispatch, while the negative check keeps the narrower direct-reload contract. ```mermaid sequenceDiagram participant Fixture as Source edit participant Hook as Vite hotUpdate context participant Socket as HMR socket Fixture->>Hook: Change registered UI source Hook-->>Socket: Fence with file and event timestamp Hook-->>Socket: Normal dispatch with same event timestamp Socket->>Fixture: Match event and imported stylesheet identity ``` ### Validation - Nine current-source applied probes fail intended assertions: broaden the reload rejection, restore either implicit scan, omit the explicit normal update, emit full-reload only, or emit wrong-path/accepted-path/kind and crossed prior/current update entries. Exact enforcing source is restored. - Both actual Vite/Tailwind entrypoints pass. The restored main script gate gives364total/362passed/two existing skips/zero failures; architecture104/boundary, targeted Prettier and whitespace pass on macOSNode22.16. - Actual packet capture confirms all eight registered UI edits use js-update for the imported CSS. Requiring css-update would reject this fixture. The original intermittent packet remains unattributed. - Earlier41/ccc full reviews/CI are historical. Fresh final-source FULL review is clean, including the full assembly; current-head external/CI gates remain required. ## Scripted gateway checks Not applicable: only a developer regression fixture and its documentation change. Product UI/gateway/ACP/MCP behavior, CSS sources and dependencies are unchanged. The real Vite/Tailwind integration fixture is the relevant runtime surface; no new product browser result is claimed. ## Current main composition Main advanced independently with #888/#899/#939. Fresh FULL composition review is clean at every priority for assemblyaf6740f2e636c0a5957a2e91ce329f74bf5fd45a, treedd5c0eaab89473e7460441b138d3f29cc4d6d180, against14746521400b9bd5a7d45fd61054a1ddb72af8d3. All six enforcing source/test files retain their qualified hashes; all new-main documentation blocks are preserved. These PRs add no product or dependency edits relative to new main. The prior global equality-to873 claim applies only to the historical assembly, not intervening product work. Architecture104/static checks pass; newest combined script run passes425total/423passed/2existing skips/0failures. Merge preview must equal this new qualified tree after all remaining gates.
Motivation
Backend file writes currently trigger full document reloads through Tailwind's automatic repository scan, interrupting the running app and browser verification even when Rust source bytes are unchanged. Closes #929.
The source-linked stylesheet imports in
1c1554e12(#663) retained implicit scanning alongside explicit UI sources. The new integration regression reproduces the resultingfull-reloadon both current entrypoints.Before
The repository is an implicit source of utility classes, so a backend write can invalidate frontend lifetime.
sequenceDiagram participant Backend as Backend writer participant Tailwind as Tailwind scan participant Browser as Vite client Backend->>Tailwind: Touch Rust source without changing bytes Tailwind-->>Browser: Full document reloadSolution
f5a37b177: Add a real Vite/Tailwind integration regression to the existing script suite, including actual HMR packets and production CSS output.98ff416b7: Disable implicit scanning withsource(none)at both app imports. Register the frontendsrc/root explicitly; the shared UI package continues to register its own components and composites. Document ownership in the existing module map.98ff416b7: Keep the Run on verification fixture’s viewport height fixture-owned, and measure its height/bottom in the existing browser check. Review caught that its uniqueh-screenutility had depended on implicit scanning.After
Only registered UI roots supply utility classes. Backend files are absent from the CSS dependency graph; app and shared UI changes still publish HMR and compile their new classes.
sequenceDiagram participant Backend as Backend writer participant Tailwind as Tailwind scan participant UI as App or shared UI participant Browser as Vite client Backend->>Backend: Touch Rust source outside UI roots UI->>Tailwind: Change a registered utility class Tailwind-->>Browser: Updated CSSNo extension denylist, watcher suppression, dependency change, shared-package mutation or new CI job. The new test runs in the existing frontend script gate. Disposable fixtures copy the actual CSS entrypoints and shared stylesheets, and own their cache, server, socket and cleanup.
Validation
backend touch must not interrupt the frontend documentand an actualfull-reloadpacket; final 2/2 pass.git diff --checkpass.This is a development watch-boundary repair; it changes no product layout, motion or gateway control behavior. Full interaction/performance and scripted-gateway suites were not repeated for this scope; no performance improvement or closure of all historical intermittent failures is claimed.
Fresh independent round2 reviewed all seven files and their source manifest: no findings at any priority. The final commit preserves the reviewed file hashes.
Summary by CodeRabbit