Skip to content

Preserve theme data and fix capture, comparison, and workflow correctness - #85

Merged
AdamXweb merged 15 commits into
mainfrom
fix/review-round-two
Oct 30, 2026
Merged

AdamXweb merged 15 commits into
mainfrom
fix/review-round-two

Conversation

@adamXbot

Copy link
Copy Markdown
Collaborator

Summary

Fix correctness and data-preservation issues found in two independent codebase review rounds. Theme installation now preserves existing user.js bytes and local stylesheet dependencies, captures preserve theme-provided CSS and use distinct filenames, and image comparisons measure changes before resizing so thin borders are detected without introducing false changes when image widths differ.

  • Preserve preference bytes across install, upgrade, rollback and uninstall; neutralize embedded fxcss markers, show theme preference names before confirmation, ignore commented imports, and copy bounded local stylesheet dependencies.
  • Handle symlinked audit sources and preserve parent-selector context in nested CSS conflict detection.
  • Detect Firefox launch failures promptly, clean up failed launches, report expected Marionette errors without tracebacks, and exclude unrelated apps from browser discovery.
  • Strip Git credentials from generated repository URLs and pass workflow inputs through the environment. Invalid support inputs and exhausted download budgets now produce controlled reports.
  • Preserve customChrome.css in previews and reloads, retain empty startup stylesheets for watch/audit, disambiguate variant and live-capture names, and prevent tweaks images from overwriting the baseline or diff panels. Fix Windows catalogue opening and Markdown table escaping.
  • Make the blob-hash test independent of Git line-ending settings, document the Pillow test dependency, and run the full unit suite on Linux, macOS and Windows.

Validation

  • Combined Pillow-enabled suite on macOS: 533 tests run, one skipped, no failures or errors.
  • Regression coverage includes preference byte round-trips, dependency traversal and bounds, symlinks, native CSS nesting, process lifecycle, hostile workflow inputs, synthetic DPR 1/2 comparisons, and capture-name collisions.
  • git diff --check, CLI help smoke check, and Python 3.9 grammar parsing of all 19 source modules pass.
  • Live Firefox smoke testing could not connect to Marionette in this environment. Native Windows and Python 3.9 runtime behavior remain for CI; their local coverage uses mocks/static checks.

Behavior changes and limits

Image counts now use capture pixels. Checks can correctly fail on thin borders that previously disappeared during resizing. Cross-folder variant collisions receive folder-qualified names; ambiguous names within one folder are rejected with an actionable error. Unsupported stylesheet dependency references are reported; CSS URL escapes and dependencies embedded inside non-CSS files are not followed.

Detailed capture-failure reasons, catalogue label mapping, and platform-aware baseline handling remain follow-ups.

adamXbot and others added 13 commits October 30, 2026 16:24
…ach OS

The PR preview publisher spliced the workflow_dispatch run_id input straight
into a shell script, so whatever a person typed into that box ran as shell.
The step now receives both the manual input and the workflow_run ID through
the environment, accepts only a plain number, and never echoes the value into
the log. Tests run the step under bash with hostile inputs and check that no
shell step in the generated publisher interpolates an expression.

The unit test job now runs the whole suite on macOS and Windows as well as
on each supported Python on Linux, which also covers everything the separate
profile-recovery subset did, so that job is folded in.

The blob hash test asked git for a hash through the working-tree filters,
so core.autocrlf=input made it a test of the developer's git configuration;
it now asks for the unfiltered reading under every autocrlf setting. The
README says the unit tests need the [images] extra and why.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
user.js is now read and written as bytes (surrogateescape), so non-UTF-8
bytes, CRLF/CR endings and a missing final newline survive install,
upgrade, rollback and uninstall exactly. Marker lines in a theme's
configuration/user.js are neutralised so they can no longer end the block
early and stack prefs on every reinstall.

Import-site search now skips commented-out @imports and respects strings.
Selected optional sheets bring their local nested @imports and url()
files along to the same relative place, bounded and confined to the theme
and chrome/; anything not carried along is recorded in `sheet_notes` and
printed. `fxcss install` lists the theme's pref names before confirming.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
compare_view scaled each screenshot to the 960px panel width before
diffing, so LANCZOS blended a 1px border on a 1280px capture, or a 1 CSS px
border at DPR 2, under the noise threshold and the view read as identical.
Each side was also scaled by its own factor, so captures of different widths
differed across their whole shared region.

Diff the padded captures at their own resolution, then scale both sides by
one factor for the panels and shrink the mask so any changed capture pixel
keeps its panel pixel. Change pictures take their mask from the
full-resolution crop the same way. Box and frame stay in panel coordinates,
so grouping, layout placement and the preview comment are unchanged;
changed_pixels and total_pixels are now capture pixels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e names distinct identities

build_profile and reload_theme wrote the fxcss placeholder over a
customChrome.css the theme itself ships, so previews lacked part of the
theme that install keeps. Both now only create the placeholder when the
theme has none.

find_variant_sheets let a later sheet silently replace an earlier one
with the same slug. Sheets in different folders are now told apart by
folder (custom-tabs, optional-tabs); sheets in one folder that differ
only in case or punctuation raise a ValueError naming both files, which
tweaks, init, shot and check report as an error and shell completion
swallows.

Live captures whose URLs differ only in scheme, www., query, fragment
or a truncated path shared a slug and overwrote each other. A new
live_capture_names allocator keeps unique names as they were and
numbers clashing URLs in request order without taking a name another
URL holds.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@adamXbot
adamXbot force-pushed the fix/review-round-two branch from 1ebe0c9 to 4e3ffba Compare October 30, 2026 05:25
@AdamXweb
AdamXweb merged commit fa9b5bc into main Oct 30, 2026
18 checks passed
@AdamXweb
AdamXweb deleted the fix/review-round-two branch October 30, 2026 10:30
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