Keep dialog tiers relative to the dialog z-index token - #252
Merged
Conversation
Assigning a dialog a stacking tier resolved its z-index to a bare number built on the hardcoded 1100 default, which discarded any override of --cratis-z-index-dialog the application had set. The token was only ever consulted as the pre-tier fallback, so the moment the tier landed the override was gone. That is backwards for a token whose whole purpose is to let an application place dialogs in its own stacking order. Cratis Studio raises it to 10100 so dialogs clear the 9999 full-screen overlay its settings pages live in; with the tier applied, every one of those dialogs dropped back to 1100 and rendered behind the overlay that opened it - in the DOM, focusable, and completely invisible. Resolve a tier to a CSS expression relative to the token instead, and compose popover offsets onto that expression rather than adding to a number. The first tier is the token itself, so a lone dialog stacks exactly where it did before tiering existed. The specs that measure stacking order parsed those numbers straight out of the DOM, so they now share a resolveZIndex helper that substitutes the custom property and folds the calc() arithmetic jsdom does not evaluate itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D6XsJXFcUfr9FZnf3EuyCp
Nothing exercised the dialog stack registry directly, which is how a tier resolving to a bare number shipped: every existing spec set the z-index token to its own default, so a hardcoded 1100 and a resolved token were indistinguishable. Cover the registry itself, and add a dialog-level spec that raises the token the way an application does and asserts the rendered dialog still clears the chrome it was opened from. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D6XsJXFcUfr9FZnf3EuyCp
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.
Fixed
--cratis-z-index-dialogoverride when they are assigned a stacking tier. Assigning a tier previously resolved the dialog's z-index to a bare number built on the built-in 1100 default, discarding the override — so a dialog opened from inside application chrome that the token had been raised above rendered behind it, present in the DOM but invisible.