Repository navigation
Add transition prop: CSS shorthand string, web emit, no-op decode elsewhere - #186
Merged
Merged
Conversation
…ewhere A new `transition` prop carries the CSS transition shorthand verbatim (`"<property> <duration> [<easing>] [<delay>]"`, comma-separated list allowed). Admission follows the hover-*/state-channel table: every non-root, non-tooltip, non-modal kind, plus the restrictive kbd via its kindProperties entry. - schema/components.json: Transition / transition entry + kbd prop - Lui_protocol: property variant, admission arms, and a minimal transition_supported validator (property ident + 1-2 <time> tokens, remaining tokens ident or ident(args); parens keep easing arg lists inside tokens and stop comma splits). Garbage is rejected through the existing invalid-argument path. - Lui_ui/Lui_elements: setter + ?transition on the 64 admitted constructors; apply_universal applies it like the other universals. - Web: emits literal `transition: <value>` (syntax IS CSS shorthand). - gpui: no CSS transitions and no lerp path for hover/pressed merges, so the value is validated at the wire boundary (Rust mirror of the OCaml validator) and intentionally never applied — documented in style.rs. - apple/android: same admission + validation mirrors, never rendered. - Regenerated: protocol.mli, wire_schema.ml, LUIWireSchema.swift, LuiWireSchema.kt, wire_schema.rs, protocol_rules.rs, lui_json_view.ml. - tools/gen_json_view.py: also skip the flex_wrap and list_marker named arg types (no JSON-view decoders) so the file is regenerable again. - Tests: transition admission + shorthand acceptance/rejection cases. Not in scope: a `transform` prop — element transforms need real work on gpui (element vs paint transform), skipped per the no-transform-engine rule.
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
Adds a
transitionprop so the ~45transition:declarations currently stranded in logseq'sresources/csscan migrate onto typed LUI props (logseqrefactor/luiwork). Follows the additive pattern from #185: schema entry → per-kind admission →Lui_protocolvalidation →?transitionon every admittedLui_elementsconstructor → per-host decode.The value is the CSS shorthand verbatim —
"<property> <duration> [<easing>] [<delay>]", comma-separated list allowed:root/tooltip/modal surfaces, plus restrictivekbdvia itskindPropertiesentry — 64 constructors get?transition.Lui_protocol.transition_supported, mirrored in Rust/Swift/Kotlin): each segment needs a CSS<ident>property + 1–2<time>tokens (s/ms, bare0allowed); remaining tokens must beidentorident(args)(paren-aware tokenizing socubic-bezier(0.4, 0, 0.2, 1)commas don't split segments). Garbage rejects via the existingInvalid_argumentpath.transition:— the wire syntax is CSS shorthand.P::Transitionarm +transition_supportedinvalidation.rs) but intentionally never applied — documented instyle.rs.lui_protocol.mli,lui_wire_schema.ml,LUIWireSchema.swift,LuiWireSchema.kt,wire_schema.rs,protocol_rules.rs,lui_json_view.ml(?transitionauto-decodes fromv_str).tools/gen_json_view.py: addedflex_wrap/list_markernamed arg types to the existing no-decoder skip set — the generator was un-runnable since Add CSS-adjacent capability props: sticky, display values, font-family, text-decoration, list-style, flex-wrap, hover fg/border #185 added them; required for regeneration. Both stay view-model-invisible, same asdisplay.Not included: a
transformprop — element transforms need real work on gpui (element vs paint transform), so it stays out per the no-transform-engine rule.Verified:
dune build,dune runtest(107 tests, +transition assertions),node --test tooling/test/*.mjs(8/8),cargo check -p lui-core -p lui-gpui.Link to Devin session: https://app.devin.ai/sessions/d768c1bf809c48a7a5dffaf7b1370941
Open in Devin Desktop: https://app.devin.ai/desktop/session/d768c1bf809c48a7a5dffaf7b1370941?variant=devin
Requested by: @tiensonqin