Extract inline styles to external CSS and improve code quality - #2
Merged
Conversation
- security: escape contaminant descriptions in main.js innerHTML to prevent XSS - security: reject null bytes in Proven_SafePath.isSafe (truncation attack) - perf: fix O(n²) loops in Proven_SafeHex.encodeSpaced, decodeToString, and Proven_SafeString.fromCodePoints (preallocate arrays, use Array.join) - lang policy: convert .ts test files to .js (TypeScript is banned) - config: replace remaining TAURI_/src-tauri references in vite.config.js with GOSSAMER_/target (repo migrated to Gossamer in 1b32494) - a11y: add role="status"/role="alert" + aria-live on status, error, and preview/verify panels - dx: split inline <style> from index.html into src/styles/shell.css so Vite can HMR it alongside main.css - dx: add `deno task test` for running the Deno test suite Regenerates .res.js outputs and lib/ocaml/ build artefacts. https://claude.ai/code/session_01ApYxQtnUdsJ9BpmEfBUe8W
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This PR refactors the stylesheet organization and improves code quality across the codebase by extracting inline styles to an external CSS file, optimizing array operations in ReScript modules, and enhancing security checks.
Key Changes
Styling & Build
index.html<style>tag into newsrc/styles/shell.cssfile with SPDX license headersrc/main.jsto load extracted stylesvite.config.jsto ignoretarget/directory instead ofsrc-tauri/Accessibility Improvements
index.html:role="status"andaria-live="polite"to status indicatorsrole="alert"andaria-live="assertive"to error containeraria-labelandaria-liveattributes to preview and verification panelsReScript/OCaml Optimizations
Proven_SafeHex.res: RefactoreddecodeToStringto useArray.map+Array.joininstead of mutable ref with forEachProven_SafeHex.res: OptimizedencodeSpacedandencodeSpacedUppercaseto use pre-allocated arrays with indexed assignment instead of array concatenation in loopsProven_SafePath.res: AddedhasNullBytefunction to detect null byte injection attacks (security hardening)Proven_SafePath.res: UpdatedisSafeto check both traversal and null byte conditionsProven_SafeString.res: RefactoredfromCodePointsto use pre-allocated array instead of mutable refTesting & Configuration
testtask todeno.jsonImplementation Details
Array.makeand indexed assignment (Array.setUnsafe) for better performancehttps://claude.ai/code/session_01ApYxQtnUdsJ9BpmEfBUe8W