Conversation
Adds a new use-cases module mirroring the geolocation/signals layout, covering the Clipboard API requirements from vaadin/platform#8759 and the Flow PR vaadin/flow#23615: UC1 — copy static text on click (with success/error callbacks) UC2 — copy current value of a component UC3 — copy image UC4 — paste text and HTML UC5 — paste files UC6 — copy via a context-menu item UC7 — detect availability and degrade gracefully UC7 references a Clipboard.isAvailable() that is not yet in the snapshot API; the call is stubbed locally to return true so the module compiles, with the view's enabled/disabled branches kept in place for when the real method lands. The clipboard module overrides flow.version to 25.2.clipboard-SNAPSHOT (the build from the feature branch); vaadin.version stays on the parent's regular release line so signals/geolocation are unaffected.
Pasted HTML was inserted live into the page via Html, so its CSS and markup could break the surrounding layout. Render the preview inside a sandboxed IFrame (srcdoc) and show the raw markup as escaped text in a monospace block alongside it.
The framework's paste handler uploads files before invoking the server-side listener, so a server-driven spinner only appears after the upload is already done. Toggle an indeterminate ProgressBar from a capture-phase JS paste listener so it shows the moment the upload starts, then hide it from the existing server-side listener once the upload+roundtrip completes.
The Flow PR moved the Clipboard API from com.vaadin.flow.component.page to com.vaadin.flow.component.clipboard and added the hooks the views were previously working around or stubbing: - UC2/UC3 use the new (target, source, onSuccess, onError) overloads of copyOnClick / copyImageOnClick to surface success/failure notifications. - UC5 drops the capture-phase JS spinner workaround in favour of addPasteStartListener (show) + addPasteListener (hide on success) + addPasteFailedListener (hide and notify on per-file failure), which closes the previously-unhandled "upload failed" path. - UC7 replaces the always-true isClipboardAvailable() stub with Clipboard.availabilityHintSignal(), observed via Signal.effect so the UI reacts as the value resolves from UNKNOWN to AVAILABLE or UNSUPPORTED.
Mirrors the pattern from geolocation/page-visibility (PR #231): a fixed top-right "View source" link whose href is rebuilt per route in beforeEnter, hidden for non-*View targets.
Runs the same flyctl deploy command as .github/workflows/fly-deploy.yml for one module at a time. Falls back to ~/.vaadin/proKey when VAADIN_PRO_KEY is not in the environment.
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.
Adds a new use-cases module mirroring the geolocation/signals layout, covering the Clipboard API requirements from vaadin/platform#8759 and the Flow PR vaadin/flow#23615:
UC1 — copy static text on click (with success/error callbacks)
UC2 — copy current value of a component
UC3 — copy image
UC4 — paste text and HTML
UC5 — paste files
UC6 — copy via a context-menu item
UC7 — detect availability and degrade gracefully
UC7 references a Clipboard.isAvailable() that is not yet in the snapshot API; the call is stubbed locally to return true so the module compiles, with the view's enabled/disabled branches kept in place for when the real method lands.
The clipboard module overrides flow.version to 25.2.clipboard-SNAPSHOT (the build from the feature branch); vaadin.version stays on the parent's regular release line so signals/geolocation are unaffected.