Skip to content

Conversation

@neubig
Copy link
Contributor

@neubig neubig commented Dec 6, 2025

Summary of PR

This PR fixes issue #11929 by implementing dynamic page title based on the APP_MODE configuration. When running in SaaS mode (on app.all-hands.dev), the page title will now display as "OpenHands Cloud" instead of just "OpenHands", making it easier to distinguish from the OSS version in search results and browser tabs.

Implementation Details:

  1. Created useAppTitle hook: A new React hook that returns the appropriate app title based on the APP_MODE configuration:

    • Returns "OpenHands Cloud" when APP_MODE === "saas"
    • Returns "OpenHands" otherwise (OSS mode)
  2. Updated useDocumentTitleFromState hook: Modified to use the dynamic app title from useAppTitle as the default suffix, while still allowing custom suffixes to be passed as parameters.

  3. Updated root-layout.tsx: Added a useEffect hook to set the document title for non-conversation pages (like settings pages) using the dynamic app title.

  4. Added comprehensive tests:

    • Tests for useAppTitle hook covering all scenarios (SaaS mode, OSS mode, undefined config, null config)
    • Tests for useDocumentTitleFromState hook covering the new SaaS mode behavior and suffix override

Example Behavior:

OSS Mode:

  • Page title: "OpenHands" (no conversation) or "My Conversation | OpenHands" (with conversation)

SaaS Mode:

  • Page title: "OpenHands Cloud" (no conversation) or "My Conversation | OpenHands Cloud" (with conversation)

Change Type

  • Bug fix

Checklist

  • I have read and reviewed the code and I understand what the code is doing.
  • I have tested the code to the best of my ability and ensured it works as expected.

Fixes

Resolves #11929

Release Notes

  • Include this change in the Release Notes.

When running OpenHands Cloud (SaaS mode), the browser page title now displays as "OpenHands Cloud" instead of just "OpenHands", making it easier to distinguish from the open-source version in search results and browser tabs.

@neubig can click here to continue refining the PR


To run this PR locally, use the following command:

GUI with Docker:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.openhands.dev/openhands/runtime:9b0fcc9-nikolaik   --name openhands-app-9b0fcc9   docker.openhands.dev/openhands/openhands:9b0fcc9

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

Coverage report

This PR does not seem to contain any modification to coverable code.

@neubig neubig force-pushed the openhands/fix-saas-page-title branch from 2530fc1 to cbd13a7 Compare December 8, 2025 02:15
@openhands-ai
Copy link

openhands-ai bot commented Dec 8, 2025

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Run Frontend Unit Tests

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #11930 at branch `openhands/fix-saas-page-title`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

@neubig neubig force-pushed the openhands/fix-saas-page-title branch from f65ccdd to 1ef8ce9 Compare December 8, 2025 16:36
openhands-agent and others added 9 commits December 8, 2025 16:44
This commit fixes issue #11929 by implementing dynamic page title
based on the APP_MODE configuration.

Changes:
- Created useAppTitle hook that returns 'OpenHands Cloud' for SaaS
  mode and 'OpenHands' for OSS mode
- Updated useDocumentTitleFromState hook to use the dynamic app title
- Added useEffect in root-layout to set document title for non-conversation pages
- Added comprehensive tests for both hooks

The page title will now display as 'OpenHands Cloud' when running
on app.all-hands.dev (SaaS mode), making it easier to distinguish
from the OSS version in search results and browser tabs.

Fixes #11929
- Reduced use-app-title.test.tsx from 4 separate tests to 1 parameterized test + 1 edge case test
- Combined 2 similar tests in use-document-title-from-state.test.tsx into 1 parameterized test
- Improved test readability and maintainability while keeping same coverage
The test 'should call onMessage handler when WebSocket receives a message'
was failing intermittently in CI due to a race condition. The broadcast would
sometimes happen before the first onMessageSpy check completed, causing the
test to expect 'Hello from server!' but receive 'Welcome to the WebSocket!'.

This fix ensures the onMessageSpy has been called once before broadcasting
the second message, and wraps the final assertion in waitFor as well.

Co-authored-by: openhands <[email protected]>
@neubig neubig force-pushed the openhands/fix-saas-page-title branch from 1ef8ce9 to 9b0fcc9 Compare December 8, 2025 16:44
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.

[Bug]: The title of the OpenHands Cloud server should be "OpenHands Cloud"

4 participants