Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set page title to documentTitleSignal #19329

Merged
merged 2 commits into from
May 13, 2024
Merged

Conversation

tltv
Copy link
Member

@tltv tltv commented May 8, 2024

UIInternals#setTitle(String) sets page title via JavaScript to document.title and optionally window.Vaadin.documentTitleSignal.value where documentTitleSignal is expected but not limited to be Signal type with a value field. This allows Hilla main layout, when used, being kept in sync with the Flow page title even when set via PageTitle annotation or HasDynamicTitle interface.

Fixes: #19200

`UIInternals#setTitle(String)` sets page title via JavaScript to `document.title` and optionally `window.Vaadin.documentTitleSignal.value` where documentTitleSignal is expected but not limited to be Signal<string> type with a value field. This allows Hilla main layout, when used, being kept in sync with the Flow page title even when set via PageTitle annotation or HasDynamicTitle interface.

Fixes: #19200
@tltv tltv marked this pull request as draft May 8, 2024 07:27
Copy link

github-actions bot commented May 8, 2024

Test Results

1 103 files  ±0  1 103 suites  ±0   1h 23m 24s ⏱️ + 2m 16s
7 010 tests +1  6 961 ✅ +1  49 💤 ±0  0 ❌ ±0 
7 384 runs  +5  7 325 ✅ +5  59 💤 ±0  0 ❌ ±0 

Results for commit 513e01c. ± Comparison against base commit af90831.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@mshabarov mshabarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that with this patch and main layout changes the Flow page title is shown on the navigation bar in the same way as Hilla shows it.

Copy link

sonarcloud bot commented May 10, 2024

Quality Gate Passed Quality Gate passed

Issues
7 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mshabarov mshabarov merged commit aa507e6 into main May 13, 2024
26 checks passed
@mshabarov mshabarov deleted the fix/19200-flow-page-title branch May 13, 2024 08:49
vaadin-bot pushed a commit that referenced this pull request May 13, 2024
`UIInternals#setTitle(String)` sets page title via JavaScript to `document.title` and optionally `window.Vaadin.documentTitleSignal.value` where documentTitleSignal is expected but not limited to be Signal<string> type with a value field. This allows Hilla main layout, when used, being kept in sync with the Flow page title even when set via PageTitle annotation or HasDynamicTitle interface.

Fixes: #19200

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
mshabarov added a commit that referenced this pull request May 13, 2024
`UIInternals#setTitle(String)` sets page title via JavaScript to `document.title` and optionally `window.Vaadin.documentTitleSignal.value` where documentTitleSignal is expected but not limited to be Signal<string> type with a value field. This allows Hilla main layout, when used, being kept in sync with the Flow page title even when set via PageTitle annotation or HasDynamicTitle interface.

Fixes: #19200

Co-authored-by: Tomi Virtanen <tltv@vaadin.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flow page title is not propagated to the top part of the app layout in a Hilla main layout
3 participants