Skip to content

ui: review fixes for native lowering and style if - #3598

Merged
BaseMax merged 10 commits into
mainfrom
fix/review-native-lowering
Nov 17, 2026
Merged

BaseMax merged 10 commits into
mainfrom
fix/review-native-lowering

Conversation

@BaseMax

@BaseMax BaseMax commented Nov 17, 2026

Copy link
Copy Markdown
Member

Follow-up to the review comments left on #3527 and #3550.

What changed:

  • native style blur handlers are registered again: the attribute is classified as an event before its value is replaced, and both ln_attrs and ln_style_attrs skip it as a style
  • native style lists keep the unit of literal items (padding = 10%, 20% stays 10%, 20%)
  • a style if with no earlier value no longer fails: the empty fallback is typed as text on web and native, so colour names (orange) and numbers (opacity = 0.5, padding = 24) work without a base value, and a constant false condition declares nothing instead of E018
  • a style if only overrides attributes written before it; an attribute written after the block wins
  • chains that never mention an attribute no longer clone the accumulated fallback
  • design note: a style condition must have no side effects

Examples:

if big:
    background = orange
    opacity = 0.5
    padding = 24
end

button: blur = (): println "blurred" end content = "B" end
box: padding = 10%, 20% end

Tests: tests/{en,fa}/ui/style_lists and style_if_nobase (headless native), tests/{en,fa}/page/components/if_style_edges.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc76b8f5-b199-404b-97fa-2dde5ee743aa
Commits

Reviewing files that changed from the base of the PR and between 802c990 and e8bb000.

Files ignored due to path filters: 2

  • tests/en/ui/style_if_nobase.out is excluded by !**/*.out
  • tests/fa/ui/style_if_nobase.out is excluded by !**/*.out
Files selected for processing: 16

  • compiler/parser/parser_layout.salam
  • compiler/sal_layout/layout_gen_element.salam
  • compiler/sal_layout/layout_lower.salam
  • compiler/sal_layout/layout_native.salam
  • compiler/semantic/sema_layout_check.salam
  • docs/design/UI_STATES_THEMES.md
  • tests/en/page/components/if_style_edges.salam
  • tests/en/ui/style_if_nobase.salam
  • tests/en/ui/style_if_nobase.script
  • tests/en/ui/style_lists.salam
  • tests/en/ui/style_lists.script
  • tests/fa/page/components/if_style_edges.salam
  • tests/fa/ui/style_if_nobase.salam
  • tests/fa/ui/style_if_nobase.script
  • tests/fa/ui/style_lists.salam
  • tests/fa/ui/style_lists.script
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@BaseMax
BaseMax marked this pull request as ready for review November 17, 2026 15:58
@BaseMax
BaseMax requested a review from a team as a code owner November 17, 2026 15:58
@BaseMax
BaseMax merged commit 7c08d69 into main Nov 17, 2026
33 of 34 checks passed
@BaseMax
BaseMax deleted the fix/review-native-lowering branch November 17, 2026 16:09
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.

1 participant