Skip to content

editor: rewrite the page on the standard style attributes and components - #3572

Closed
BaseMax wants to merge 2 commits into
mainfrom
editor/standard-ui
Closed

BaseMax wants to merge 2 commits into
mainfrom
editor/standard-ui

Conversation

@BaseMax

@BaseMax BaseMax commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

The editor page broke in two ways after the style standard landed: the JS backend bug fixed in #3564 (buttons threw on the first click), and the standard base sheet, which gives every element display:flex; flex-direction:column, so the old raw CSS (which assumed row) stacked the toolbar vertically. This rewrites the page on the standard.

What changed:

  • editor/ui.salam (new): components Toolbar, Brand, Controls, MenuToggle, Segmented, SegButton, Toggle, DropdownButton, DropdownList, RunButton, Pane, PaneHead, IconButton, Gutter, AnimBar, AnimButton, Scrim, built from standard attributes with layout = row, hover: and disabled states, enum and bool parameters.
  • editor/page.salam: theme as light dark(a, b) colour constants, page attributes, the body in components. The single 27 KB raw style string is gone; a 130 line raw block (STATE_CSS) remains.
  • editor/app.salam: segmented buttons read data-value for mode, language and view (was three different attributes).
  • Tests: tools/bash/check-editor-page.sh builds the page and checks ids and data attributes; tools/js/editor-click-test.js loads the built page in jsdom and clicks mode, language, theme, auto-run, dropdown and menu. Both run in the editor build job (jsdom is installed with npm, about 20 MB).

Still raw, and why:

  • classes toggled by app.salam (.seg-btn.active, .toggle.on, .dropdown.open, .copied, .dragging, .status.*, .output.*, .anim-*): the page and the script do not share state, so a page if block cannot see them.
  • markup the script injects with SetHtml (highlighter tokens, dropdown items, autocomplete chips, line numbers): descendant selectors.
  • mask-image icons (logo, copy, check) and the ::before error markers: not in the standard.
  • the mobile menu (@media (max-width: 1024px), body.menu-open) and the stacked split under 900px: environment conditions are not on main yet (ui: style if review fixes, tab size and touch action properties #3563 is open).
  • main.split grid columns and rows from --col-a and --row-a set by the drag handler, [dir=rtl] rules, tab size and resize: none, color-scheme per data-theme.

Examples: Seg(name, text, views) wraps SegButton(value, text, views, only) children; colours like FG := "light dark(#1b2030, #e6e9ef)".

Tested: built with a compiler from main in headless Chromium and checked computed styles and boxes (toolbar row, split 637+6+637, textarea and highlight layers identical, highlight tokens inline, RTL control panel, mobile menu opens at 800 px with scrim); jsdom click test passes 13 of 13.

Summary by CodeRabbit

  • New Features
    • Updated the editor page with a responsive layout, refreshed styling, and shared light and dark theme colors.
    • Added a toolbar, menus, editor and preview panes, and animation controls.
    • Improved mode, language, and view controls, including clearer control states and labels.

@BaseMax
BaseMax requested a review from a team as a code owner November 17, 2026 11:36
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The editor page now uses Salam-native page and UI declarations, with shared styles and component definitions. Editor controls use data-value for mode, language, and view state. The build workflow compiles and checks the generated page, then runs jsdom interaction checks.

Changes: Editor page

Layer / File(s) Summary
Page and UI declarations
editor/ui.salam, editor/page.salam, editor/README.md, .gitignore
The page now defines shared styles and uses Salam-native declarations for its structure and UI components. The README describes the roles of page.salam and ui.salam, and .gitignore allows ui.salam.
Editor control values
editor/app.salam
Mode, language, and view state lookups, label selection, click handlers, and initialization now read control values from data-value.
Build and interaction checks
.github/workflows/editor-playground-build.yml, tools/bash/check-editor-page.sh, tools/js/editor-click-test.js
The workflow includes tools/js/* in its trigger paths and checks the generated page with a shell check and jsdom interaction tests.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Change: Bug fix

Possibly related PRs

  • SalamLang/Salam#3563: Changes style fallback behavior and standard style attributes used by the editor page rewrite.

Suggested labels: tests

Suggested reviewers: jbampton, bdadmehr0

Merge Risk: Minimal · up to de23d

This change moves the editor page onto standard style attributes and shared components, and switches the segmented controls to data-value. The reviewed checks found no concrete regression, and the generated-page and click tests in CI cover the changed controls. The remaining risk is ordinary visual verification, which is low.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the editor page is rewritten on the standard style attributes and components, which matches the raw_summary (new ui.salam components, page.salam rewritten with Salam-n…
Description check Passed The description follows the template's main ideas. It gives the reason for the change, lists the proposed changes by file, and explains how the change was tested, including the build, computed-style c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the editor page is rewritten on the standard style attributes and components, which matches the raw_summary (new ui.salam components, page.salam rewritten with Salam-native declarations, and the removal of embedded CSS) and the PR objectives. It is specific and concise, and no unrelated changes are described.

Full details: Description check

Explanation

The description follows the template's main ideas. It gives the reason for the change, lists the proposed changes by file, and explains how the change was tested, including the build, computed-style checks in headless Chromium, and the jsdom click test (13 of 13). It also notes what remains raw and why. It lacks an explicit 'Related Issue' section that references a closing issue; it cites #3564 and #3563 as context, but does not state 'Closes #...' or identify an issue this PR resolves. The Checklist section is also absent, so the author has not confirmed the template's checklist items.

Resolution

Optional: add a 'Related Issue' reference (for example, a Closes line if an issue applies) and complete the template checklist, including the documentation and test items that apply to this change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

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: f55bbc9b-172f-4f16-b8ac-8e7d16026e63
Commits

Reviewing files that changed from the base of the PR and between a05de64 and de23d4a.

Files selected for processing: 8

  • .github/workflows/editor-playground-build.yml
  • .gitignore
  • editor/README.md
  • editor/app.salam
  • editor/page.salam
  • editor/ui.salam
  • tools/bash/check-editor-page.sh
  • tools/js/editor-click-test.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@deepsource-io

deepsource-io Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in a05de64...de23d4a on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Nov 17, 2026 11:36a.m. Review ↗
Secrets Nov 17, 2026 11:36a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@BaseMax

BaseMax commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

Superseded by #3573, which merged the same page rewrite and a jsdom page test.

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