Repository navigation
docs(events): document every State setting and make the Events and State pages easier to skim - #855
Merged
Merged
Conversation
…ate pages easier to skim - Event state page: new "State settings" section with a table and one subsection per setting (_public, _model, _storage, _max_bytes, _max_age): what it does, default, accepted values, invalid values, example. Headings renamed to say what each section helps with; the input-binding section moved down; the handler example reads State into local names first. - Server events page: "Set a signing secret" split into Django, rotation and deploy subsections, with the deploy rotation as numbered steps. - API reference: Attributes sections in the Component.State and Component.Events docstrings, and the docs site gives each Attributes row its own anchor (skipped when a member already has that name). - Other pages link the new sections instead of repeating them; links to renamed anchors are updated. - writing-docs.md: a heading that gives an instruction must still name its subject. Closes #852 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 24, 2026
JuroOravec
added a commit
that referenced
this pull request
Nov 24, 2026
…enewal #855 turned the State guide into a "State settings" section with one subsection per setting. The renewal text now lives in the `_max_age` subsection, in that format, and the other pages keep #855's wording with the renewal facts added. Conflicts resolved: - docs_site/content/events/state.md: #855's structure and anchors win. The "Set State lifetime" subsection says when a token is renewed, what does not renew it, and what a renewal sends; the "Choose where data lives" row says a call in the second half of the lifetime gets a new token. - docs_site/content/security.md: points to the `_max_age` subsection for the setting and keeps the renewal and replay explanation. - docs_site/content/about/versioning.md, docs_site/content/performance/ cache-backends.md: #855's text plus the renewal sentence. - packages/py/citry/citry/component.py: the State docstring keeps #855's per-setting list and its `_max_age` entry gains the renewal sentence. Wording fix: a token reaches server and proxy logs only for a handler that opts into GET (`methods=("GET",)` or `_methods`) and declares `state`; handlers use POST by default. security.md, design section 7.1, and the State token row in trust_boundaries.md now say so. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
Closes #852
What changed
Event state (
docs_site/content/events/state.md)_public,_model,_storage,_max_bytesand_max_age. Each one covers what it does, its default, the values it accepts, what happens on an invalid value, a short example, and a link to its API reference row.stateparameter".refreshexample reads State values into local names first.Server events (
docs_site/content/events/index.md): "Set a signing secret" now has three subsections, "Use Django's secret key", "Rotate a secret" and "Rotate during a deploy". The deploy rotation is written as numbered steps.API reference
Component.StateandComponent.Eventsdocstrings each get anAttributes:section, one row per setting (type, default, meaning, link to the guide).Eventslists_guard,_context,_csrf,_methods,_debounce,_throttle, and_render_inputs(marked experimental).Attributes:row its own anchor, such as#citry-component-state-max-age, so the guide can link to it. A row whose name is also a rendered member gets no second anchor, so ids stay unique. Tests for both cases are indocs_site/tests/test_reference.py.Links
versioning.md("State token lifetime"),security.md,performance/caching.md,performance/cache-backends.md,advanced/subclassing.md, the migration guides and the 1.0.0 upgrade guide link to the new sections instead of repeating them.docs_site/content. The archiveddocs_site/versions/*stay as they are.CHANGELOG.mdlinks only to anchors that still exist.Writing rule:
docs/best-practices/writing-docs.md, "Write short headings", now uses "Pass every input" versus "Access State in handlers" as an example.Where the docs follow the code instead of the issue
The issue says the
_max_ageclock restarts on every server event. In the code, Citry issues a new token, and so restarts the clock, only when it renders the component or when a call changes State (including browser writes). A call that does neither keeps the old token and its expiry (_resign_stateinext/events/dispatcher.py). The page says this.Follow-ups
_guardand_contextare taught in Security,_csrfin "Use your own token", and_methods,_debounceand_throttleonly through the matching@event(...)options.Checks
python -m docs_site build-check: 0 errors, 0 warnings, 31 info. The info lines are the sameheading_lengthnotes as onmain; none is on the Events pages.pytest docs_site/tests docs_site/examples: 1278 passed, 10 skipped. That run came before the last round of review edits, which changed only page text and docstrings. After them,docs_site/tests/test_reference.pypassed again.ruff checkandruff format --checkpass on the changed Python files.docs-cold-readerpass and by an independent technical and prose review. Their findings are folded in.Versioning and changelog
Docs only, plus docstring edits and docs-site build code (not a published package). Nothing changes behavior covered by the 1.x promise: the PR documents setting names that
versioning.mdalready covers. No changelog entry.🤖 Generated with Claude Code