Repository navigation
Conversation
Several React examples showed code that only exists for the docs site, so a reader who copied them got unresolved imports or calls to functions they did not have: - Style imports that only feed the hidden reactExample() call (Confirm Dialog, Dialog, Login) and inline host styles (App Layout, Login, Rich Text Editor), now in -styles.ts files with hidden imports. - The navigation patches that keep links inside the example frame (App Layout, Side Nav, Breadcrumbs, Tooltip). The patch functions now accept null, so the examples pass them as a hidden callback ref instead of a visible useRef and useEffect. - The fake upload files and the mock error response (Upload). The inline createFakeFiles() functions of the clear, start and retry button examples move to the mock-files modules, also for Lit. Also unhides imports that visible code uses (Button Grid, Context Menu, Badge). Fixes #2730 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6678.fly.dev Changed pagesAdded content is highlighted in green; removed content is marked in red on each page.
Other changed files
Built from a2e3494 |
vaadin-review-bot
left a comment
There was a problem hiding this comment.
Reviewed the changes — left 1 comment.
| Finding | |
|---|---|
The new helper calls _updateTouchOptimizedMode(), which no longer exists in App Layout |
peholmst
commented
Nov 13, 2026
| @@ -22,35 +16,19 @@ const linkStyle = { | |||
| }; | |||
|
|
|||
| function Example() { | |||
Member
Author
There was a problem hiding this comment.
This example does not render at all. The currently published example also doesn't work. The lit version works, though.
The React bottom navbar example called _updateTouchOptimizedMode(), which App Layout does not have, so the example threw and rendered blank. Setting --vaadin-app-layout-touch-optimized is enough: App Layout reads it when it becomes ready. Set it in a hidden style attribute and drop the enableTouchOptimizedMode() helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #2730.
The docs show the full source of each example with the
hidden-source-linelines removed. Several React examples still showed code that only exists for the docs site, so copying them into an application gave unresolved imports or calls to functions the reader doesn't have. For example, the Confirm Dialog page still showsimport confirmDialogBasicStyles from './confirm-dialog-basic-styles';.The Lit variants already hid these helpers. This change brings the React variants in line:
reactExample()call are now hidden (Confirm Dialog, Dialog, Login). The inlinehostStylesin App Layout, Login and Rich Text Editor move to-styles.tsfiles with a hidden import. Prettier formats CSS insidecsstemplates and would move per-line markers.null, so the examples pass them as a hidden callback ref,ref={patchSideNavNavigation} // hidden-source-line, instead of a visibleuseRefanduseEffect. The bottom navbar example now forces the touch-optimized mode with a hiddenstyleattribute, as the Flow variant does. Its old code also called_updateTouchOptimizedMode(), which App Layout doesn't have. The React example threw and rendered blank, also on the published docs.filesbinding, theuseComputed()call and the mock error response are hidden. The inlinecreateFakeFiles()functions of the clear, start and retry button examples move to theupload-demo-mock-filesmodules, for Lit too.Button), Context Menu best practices (useCallback) and the Lit Badge table (DataService).Where the hidden attribute was the tag's only one, the line uses
hidden-source-line-trim, so the tag renders as<Breadcrumbs>rather than<Breadcrumbsand>on separate lines. This follows the published Lit Upload example.Left as they are: the shared sample data (
DataService, generated types), and the placeholder content in Split Layout (MasterContent/DetailContent) and Dashboard (mock-widgets). Every framework variant uses these on purpose.Checks
frontend/demo.@lit/reactanduseMergedRefssources: both call function refs with the element, and withnullon unmount.🤖 Generated with Claude Code