Skip to content

Keep backend edits out of the frontend CSS watch graph - #931

Merged
Varuas37 merged 2 commits into
mainfrom
codex/929-tailwind-ui-sources
Oct 15, 2026
Merged

Varuas37 merged 2 commits into
mainfrom
codex/929-tailwind-ui-sources

Conversation

@Varuas37

@Varuas37 Varuas37 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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 resulting full-reload on 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 reload
Loading

Solution

  1. f5a37b177: Add a real Vite/Tailwind integration regression to the existing script suite, including actual HMR packets and production CSS output.
  2. 98ff416b7: Disable implicit scanning with source(none) at both app imports. Register the frontend src/ root explicitly; the shared UI package continues to register its own components and composites. Document ownership in the existing module map.
  3. 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 unique h-screen utility 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 CSS
Loading

No 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

  • Both regressions fail before the fix with backend touch must not interrupt the frontend document and an actual full-reload packet; final 2/2 pass.
  • Five independent omission probes fail: either implicit scan restored, frontend source removed, or desktop source narrowed so shared conversation UI is excluded. The fixture-height omission also fails all three narrow Run on cases (68 px instead of the 900 px viewport). The intended source was restored afterward.
  • Existing script suite: 362 passed, 2 intentional skips, including the new tests. Full formatting, architecture source check and git diff --check pass.
  • Run on/details browser checks: 109/109 held across both engines at 360, 600 and 1440 px; height and bottom match the viewport within 1 px.
  • Production app build and smoke: 33/33 held, Chromium and WebKit, columns and sidebar, including send, split, Settings, overview and console checks.
✔ src/styles.css watches UI sources without reloading for backend edits
✔ src/desktop/styles.css watches UI sources without reloading for backend edits
smoke: 33/33 held

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

  • Bug Fixes
    • Improved style isolation so changes to backend files do not trigger frontend style updates or add unrelated styles to production builds.
    • Improved desktop conversation layout checks to ensure the conversation area fills the viewport and the tray stays at the bottom.
  • Documentation
    • Updated the codebase guide and desktop checklist with details about style-source boundaries and viewport layout checks.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T16:57:51.345438Z 98ff416 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04ff87ed-a5b9-4d66-aa1f-d92e56e0152d
📥 Commits

Reviewing files that changed from the base of the PR and between 4219790 and 98ff416.

📒 Files selected for processing: 7
  • docs/codebase-structure.md
  • scripts/tailwind-sources.test.mjs
  • src/desktop/styles.css
  • src/styles.css
  • verification/conversation/run-on-fixture.tsx
  • verification/desktop/CHECKLIST.md
  • verification/desktop/scripts/lease-details.mjs
+---------------------------------------------------------+
| Your config has more knobs than a 2004 Honda dashboard. |
+---------------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Varuas37

Copy link
Copy Markdown
Contributor Author

Qualified head 98ff416b7 (same seven source hashes as fresh round2 review):

  • Real Vite/Tailwind HMR and production CSS regressions: 2/2.
  • Existing script suite: 362 passed, 2 intentional skips.
  • Production app smoke: 33/33, Chromium and WebKit, both layouts.
  • Run on/details: 109/109, both engines at 360/600/1440 px; fixture height and bottom equal its 900 px viewport.
  • Five independent omitted constraints are rejected; fixture-height omission reports 68 px instead of 900 px. Intended source restored and complete affected check passed.
  • Full format, architecture source check and fresh complete round2 review: clean.

CI is running; no merge or performance claim yet.

@Varuas37
Varuas37 merged commit 6f7c8b6 into main Oct 15, 2026
9 of 10 checks passed
@Varuas37
Varuas37 deleted the codex/929-tailwind-ui-sources branch October 15, 2026 16:59
@Varuas37

Copy link
Copy Markdown
Contributor Author

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.

Varuas37 added a commit that referenced this pull request Oct 16, 2026
…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.
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.

Limit Tailwind scanning to UI sources so backend edits do not reload the app

1 participant