Skip to content

Add URL hash state persistence for raw CSS input#223

Draft
bartveneman wants to merge 2 commits intomainfrom
claude/implement-issue-188-no2VM
Draft

Add URL hash state persistence for raw CSS input#223
bartveneman wants to merge 2 commits intomainfrom
claude/implement-issue-188-no2VM

Conversation

@bartveneman
Copy link
Member

Summary

This PR adds the ability to persist and share raw CSS input through URL hash state, allowing users to share their CSS analysis via URL without exposing sensitive query parameters.

Key Changes

  • InputModeSwitcher: Added default_tab prop to allow dynamic tab selection based on URL state, using untrack() to prevent reactivity issues during initialization
  • Form component:
    • Integrated HashState to manage raw CSS persistence in the URL hash
    • Added logic to detect and restore the raw CSS tab when hash state contains CSS data
    • Modified form submission to preserve the hash (containing raw CSS state) while removing query parameters (url and prettify)
    • Bound the raw CSS textarea to the hash state for automatic synchronization
  • Dependencies: Added untrack import from Svelte for proper reactive state handling

Implementation Details

  • The raw_hash_state is initialized with an empty CSS string and automatically syncs with the textarea input
  • The initial_tab is determined by checking if the hash state contains CSS data, defaulting to 'url' tab otherwise
  • Query parameters are cleaned up on form submission while preserving the hash for sharing purposes
  • This enables users to share raw CSS analysis links without exposing URL/prettify parameters in the shareable URL

https://claude.ai/code/session_016foMJWiaAwuMiU4VcrL5AV

claude added 2 commits March 17, 2026 18:27
- Integrate HashState into the raw CSS form tab so the textarea content
  is automatically encoded in the URL hash as the user types
- Auto-switch to the "Paste CSS" tab on page load when a hash is present,
  pre-populating the textarea from the encoded state
- Add default_tab prop to InputModeSwitcher to support the initial tab selection
- Preserve the URL hash on raw CSS form submission instead of clearing it

https://claude.ai/code/session_016foMJWiaAwuMiU4VcrL5AV
@netlify
Copy link

netlify bot commented Mar 17, 2026

Deploy Preview for projectwallace ready!

Name Link
🔨 Latest commit db05ba5
🔍 Latest deploy log https://app.netlify.com/projects/projectwallace/deploys/69b9a509d15e3c0008032a90
😎 Deploy Preview https://deploy-preview-223--projectwallace.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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