JS port: desktop native themes, page settings, and fixes for #5910 #5912 - #5917
shai-almog wants to merge 12 commits into
Conversation
…t fixes behind #5910 #5912 Native theme mode on the JavaScript port: - nativeTheme=native gives a desktop browser its OS theme (Fluent, Aqua, Adwaita); javascript.desktopTheme pins one. Phones and tablets keep iOS/Android themes. - javascript.titleBar=toolbar (default) keeps a desktop-styled Toolbar; the desktop themes gained TitleCommand/BackCommand/SideCommand/side-menu UIIDs for it. - javascript.titleBar=html draws an HTML title bar and menu bar above the app. - The builder ships only the native themes the app's hints can reach. - Theme/title-bar/text-selection hints now reach the running app. index.html (#5909 #5911 #5913 #5914): viewport meta, display name as title, notranslate and darkreader-lock by default with opt-out hints. Opt-in javascript.textSelection (#5915) via TextSelection.setDefaultSelectable. Fixes: - #5910: the wheel scrolled the Form itself past the content's end (core); a theme refresh on show dropped the dialog backdrop painter; the frame clear ran on frames that did not repaint the whole screen. - #5912: touch lists and pointerType were never sent to the worker; the move listeners were never invoked; mouse and touch handlers raced for the press; a tap's release overtook its press. - Toolbar commands never reached the native menu bar under commandBehavior Native. - #5774: JS RTA culled classes created by Class.forName(name).newInstance(). scripts/test-javascript-composited-rendering.mjs drives a fixture app with real wheel, mouse and touch input in Chromium, Firefox and phone emulation and reads the composited page; it fails on the previous master. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5a3f6c02d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 172 screenshots: 172 matched. Benchmark ResultsDetailed Performance Metrics
|
Cloudflare Preview
|
|
Compared 157 screenshots: 157 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 172 screenshots: 172 matched. Benchmark ResultsDetailed Performance Metrics
|
…ore theme, embedded forms - Theme pruning keeps every theme when the application's own code names one of the theme hints (it can set them with Display.setProperty at run time); the scan skips framework classes, whose build-hint annotations spell the names too. - HTML menu items no longer carry a permanent disabled attribute; the look is refreshed on open and dispatchNativeMenuCommand refuses disabled commands. - The HTML chrome is installed before the theme applies, so commandBehavior Native is not normalised away and Toolbar-less forms publish their MenuBar. - The wheel walk stops only at the ROOT top level; an embedded Form is skipped and the scrollable host above it still takes the wheel. - scripts-javascript.yml: the composited test paths trigger on master pushes too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cf7606f18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Compared 193 screenshots: 193 matched. |
CI:
- DialogBackdropTest installed a real theme; several classes cache theme
constants in statics, which failed eight unrelated tests later in the run.
The theme-installing variant is gone (full core-unittests: 7402 passing).
- Reseeded DesktopMode and ToolbarTheme_{light,dark} for Linux (x64, arm) and
Windows: the desktop themes now style the Toolbar's buttons, and with the
Toolbar's commands reaching the native menu bar that bar is shown, which
shortens the content area. The arm64 and x64 captures are identical.
Review:
- Each press gets its own release slot, so a quick second tap no longer drops
the first tap's parked release (mouse and touch).
- Only pointermove is registered; mousemove duplicated every drag step.
- HTML menu accelerators are bound on the main thread (browser_bridge.js), where
preventDefault works, and activate the menu item.
- Long HTML menus scroll within the viewport.
- The theme scan skips only the framework's annotations and impl packages, so
apps and cn1libs in com.codename1.* packages are still seen.
- The composited test resolves a relative bundle path.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65c4f2076c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Compared 172 screenshots: 172 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 172 screenshots: 172 matched. |
|
Compared 172 screenshots: 172 matched. |
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
…, copy loop, zoom wording - A release takes its press slot at handler entry, before any JSO yield, so a quick second tap cannot redirect the first release to the second press. - The text-selection hint enables selection only on a root form; on a dialog hosted in another surface the listeners landed on the host and outlived it. - The copy listener ignores the copy event the port's own execCommand fallback raises, which otherwise copied again and cycled. - The viewport comment and the guide no longer claim pinch zoom over the app: the canvas claims touch gestures so apps' own two-finger gestures work. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da5ba6f100
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- HTML menu bar: two delegated listeners on the menu bar, installed once, find the command by data attribute. Per-item listeners were worker callbacks the bridge keeps for the life of the page, so every rebuild leaked its commands. - Copy loop guard marks the exact event the execCommand fallback raises (data-cn1-self-copy on its textarea, forwarded as cn1SelfCopy) instead of a one-second window that also dropped a user's second copy. - Menu accelerators are not rejected on the possibly stale aria-disabled marker; dispatchNativeMenuCommand checks the command's current state. - javascript.native.theme is trimmed at run time, as the build prunes it. - A source-checkout JS build stages the native themes from Themes/ before pruning, and pruning never runs when none of the themes to keep is present. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d094d96f63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ion on form change - browser_bridge.js matches Cmd on a Mac and Ctrl elsewhere, as the menu shows the shortcut, instead of either on every OS. - setCurrentForm drops the cached text selection, so Ctrl/Cmd+C on a new screen no longer copies text selected on the previous one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5185c3a83
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Toolbar: adding to the left bar, right bar or overflow, and removing a command, republish the native menu while the Toolbar is hidden by the desktop chrome; only the side-menu paths did. - The runtime theme resolver trims and ASCII-folds every theme hint exactly as the build's pruning does, so both pick the same theme. - The HTML chrome's height is published as --cn1-chrome-top and the fixed capture overlays offset themselves by it. - The shared document copy/context-menu listeners are reference counted, so disabling selection on one form no longer breaks the others. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cac268c12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Resources.openLayered("/AndroidMaterialTheme") appends ".res" itself, so the
application's constant never contains the extension and the scan missed it;
pruning then deleted a theme the app opens. The bare name, with or without a
leading slash, now counts when it is a whole constant-pool string.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d9dc8d173
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…s, early moves
- javascript.pruneThemes=false ships every native theme, for an application
that loads a theme by a name it computes or reads from configuration.
- The HTML menu keeps icon-only commands (new Command("", icon)) and draws the
icon; with the Toolbar hidden the menu is their only route.
- A drag that arrives while its press is still in flight waits in the press's
slot and runs after the press, for touch and mouse alike.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb584abbc6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…f native menus - A touch press records its own coordinates on its slot and the release uses them, so a release parked until after the next touchstart no longer fires at the second tap's position. - Toolbar.getAllNativeMenuCommands leaves the search command out: it opens a search bar inside the Toolbar that native chrome detaches. showSearchBar returns instead of throwing when the Toolbar is detached. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd35c5e184
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- touchend reads and clears touchDown before any JSO yield, so a quick second tap's touchstart is no longer mistaken for a second finger and dropped. - A press slot is marked releasing when its release handler starts; a move that resumes after that is dropped instead of dispatched after the release. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58aea39169
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…on any outside press - A menu panel is capped at the window width and shifted left when it would cross the right edge (measured on the main thread when it opens). - Material command icons are drawn in the menu's own text colour for the current scheme and the menu bar is rebuilt when the colour scheme or density changes. - Open menus close on a press anywhere outside them, not only on the canvas; the listener runs on the main thread in capture phase. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Native theme mode for the JavaScript port, plus the fixes for issues #5909, #5910, #5911 and #5912, the three discussions #5913, #5914 and #5915, and a likely fix for #5774. The cloud builder mirror is a separate BuildDaemon PR.
Native theme mode in the browser
nativeTheme=native, a desktop browser gets its operating system's desktop theme: Windows → Fluent, Mac → Aqua, Linux and anything else → Adwaita. Phones and tablets, iPad included, keep the iOS and Android themes. The newjavascript.desktopTheme=auto|fluent|aqua|adwaita|nonehint pins one theme or turns the desktop themes off.javascript.titleBar=toolbar(default). The Toolbar stays inside the app. The three desktop themes gainedTitleCommand,BackCommand,MenuButton,SideNavigationPanelandSideCommandstyles (light and dark) for it, and the.resfiles were rebuilt.javascript.titleBar=html. An HTML title bar and menu bar sit above the app (JavaScriptDesktopChrome). Commands are grouped exactly as on the native Windows menu bar.JavaScriptBuildHints) deletes every theme the app's hints can't reach. Themes the app opens by name are kept. For example, a default app ships 2 themes instead of 10.nativeTheme,ios.themeModeandand.themeModehad no effect on the JS port.Behaviour change: archetype projects set
nativeTheme=modern, so after this they get the modern themes in the browser.Page settings (#5909 #5911 #5913 #5914)
The translator's
index.htmlnow carries:viewportmeta tag that leaves pinch zoom enabled;notranslateandtranslate="no", whichjavascript.allowBrowserTranslation=trueremoves;darkreader-lock, whichjavascript.darkreaderLock=falseremoves.Only meta tags and one attribute are added, so the content-security-policy hashes are unchanged.
Text selection (#5915)
javascript.textSelection=truemakes read-only text selectable throughTextSelection.setDefaultSelectable. With a mouse, press and drag; on a touch screen, long-press, so a swipe still scrolls. Buttons, editable fields and text inside lead components are excluded.Also fixed:
#5910: toolbar scrolled away, dialog over a blank page
Display.scrollAxisForWheelwalked past the content pane to the Form, whoseisScrollableY()just reports the content pane's. The wheel then scrolled the Form's own position, taking the Toolbar off the top and leaving a blank band below.refreshThemeIfStalere-themed every form on its first show. For a Dialog, that threw away the tinted-backdrop paintershowModalhad just installed.#5912: no touch scrolling, lost taps
Four separate bugs:
pointerTypeto the app, so every touch handler threw a NullPointerException.Object, so calls on them failed with "Missing virtual method".EventUtiland never called, so mouse drags didn't scroll either.Other
Form.initComponentImpl: the native themes'commandBehavior: Nativepublished the (empty) MenuBar commands instead of the Toolbar's, so the native menu bar came up empty. This affects the native desktop ports too.Class.forName(name).newInstance(). A string literal naming a class in the program now counts as creating it. boardspace buildscommon.Saltthis way; I couldn't build boardspace itself, so this is verified with a small reproducing test, not the app.Tests
scripts/test-javascript-composited-rendering.mjsplus thescripts/javascript/composited-appfixture, added toscripts-javascript.yml(which now also installs Firefox). It checks what the browser actually shows, using real wheel, mouse and touch input in Chromium, Firefox and phone emulation. The existing screenshot suite can't catch these bugs, because its capture reads the app's canvas and switches off the text layer. Against a build of the previous master it fails 6 checks; on this branch all 16 pass.ScrollWheelGestureTest,DesktopChromeTest,TextSelectionTest,DialogBackdropTest,JavaScriptBuildHintsTest,JavascriptPageSettingsTest, and a newJavascriptRuntimeSemanticsTestcase. The wheel-scroll, menu-bar-command and class-by-name tests were each confirmed to fail with their fix reverted.🤖 Generated with Claude Code