Skip to content

Show explicit stylesheet locks when selector usage is uncertain - #84

Merged
flowtricks merged 1 commit into
flowtricks:mainfrom
MadeByKin:codex/show-explicit-stylesheet-locks
Nov 16, 2026
Merged

flowtricks merged 1 commit into
flowtricks:mainfrom
MadeByKin:codex/show-explicit-stylesheet-locks

Conversation

@MadeByKin

Copy link
Copy Markdown
Contributor

Why the Bunny video triggers “Can’t tell”

In an Astro Lumos starter with patterns.css and utilities.css explicitly locked, adding a Bunny HLS player caused the Style selectors panel to show Can’t tell for selectors in those files. Its diagnostic pointed to both the Bunny helper and the section wrapper.

The helper in src/lib/media/bunny.ts fetches an HLS playlist as text, sums the #EXTINF durations, and writes the formatted time with textContent. Separately, src/components/wrapper/Section.astro uses set:html to render its Astro slots. Stacki’s import analysis sees an external data source and an HTML insertion site in the same page’s dependency graph. It conservatively accounts for the possibility of class names arriving at runtime. In this example the playlist text never reaches the HTML insertion site.

Change

Previously, lockedVerdict mapped only unused to kept. An unknown result therefore hid an explicit stylesheet or folder lock in the panel. This change maps both verdicts to kept when the stylesheet is locked. Used and untracked selectors retain their existing classifications. Unlocking exposes the underlying uncertainty again. The outside-HTML analysis still applies to unlocked stylesheets.

Verification

  • Added a regression covering file and folder locks, an unlocked stylesheet, refusal to remove a protected selector, and the result after unlocking. It fails on the original implementation and passes with the fix.
  • All 21 selector-usage tests pass. npm run check:changed passes.
  • Ran the patched analyser against the affected starter. Zero selectors in locked stylesheets were classified as unknown. Nine selectors elsewhere remained unknown.

Verification covered the analyser and source checks. The full Electron runtime suite and a rebuilt desktop UI were not exercised.

A possible outside HTML source can leave every unmatched global selector uncertain, hiding an explicit stylesheet lock in the panel. Classify those locked selectors as kept so the panel reflects the user’s retention choice. Unlocking restores the underlying uncertainty.
@flowtricks
flowtricks merged commit 2ed3d16 into flowtricks:main Nov 16, 2026
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.

2 participants