davidortinau/sentencestudio/blazor-nav-state-preservation
Claude Code and agent skill by davidortinau/sentencestudio
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install davidortinau/sentencestudio/blazor-nav-state-preservationSKILL.md
Skill: Blazor Nav State Preservation
Preserve page state across Blazor navigations using an in-memory store keyed by a URL query parameter.
When to Use
- A Blazor page shows results of an expensive operation (import, AI generation, search)
- User navigates away (e.g., to a detail page) and needs to return to the same results via browser Back
- Blazor re-initializes the component on each navigation, losing in-memory state
Pattern
1. Create a Store Service
- Use
ConcurrentDictionary<Guid, (T Result, DateTime ExpiresAt)>internally - TTL of 30 minutes with lazy eviction on Save/TryGet
- Register as Singleton for single-user apps, Scoped for multi-user
2. After Operation Completes
3. On Page Init
4. On Reset/New Operation
Clear the URL: NavManager.NavigateTo("/my-page", forceLoad: false);
Why This Works
- Browser Back preserves the URL query string, so the GUID key survives navigation
- No JS interop needed (unlike SessionStorage)
- Works identically in MAUI Hybrid and Blazor Server
- GUID is opaque — no data leakage in URL
Gotchas
- Server restart clears the store. Acceptable for transient result data.
- Don't use for data that must survive app restarts — use a database or local storage instead.
- If the app becomes multi-user, switch to Scoped lifetime + per-user key prefixing.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.squad/skills/blazor-nav-state-preservation/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davidortinau/sentencestudio/blazor-nav-state-preservation)