Skip to content

[Feature-Tab-Title]: Tab title should reflect current item's title #276

@Castro19

Description

@Castro19

💡 User Story

As a logged-in user, I want the browser tab title to reflect the current page’s content (chat log, flowchart, or calendar title) so that I can easily distinguish between open tabs and navigate more intuitively.

📖 Description

There is an issue with how the tab title is updated when navigating using the ProtectedRoute component. When a logged-in user attempts to navigate to /login or /register, they are correctly redirected to /chat, but the tab title does not update to reflect the new location.

This feature aims to ensure:

  • react-helmet dynamically updates the tab title based on the current page's context.
  • On /chat, if a specific chat is active, the tab title should reflect the chat log title.
  • On /flowchart, the tab should reflect the current flowchart’s title.
  • On /calendar, the title should reflect the current calendar name.

If no specific entity is selected:

  • Default to generic titles:
    • Chat
    • Flowchart
    • Schedule Builder (for calendar)

The tab title should also correctly update after automatic redirects (e.g., via ProtectedRoute).

✅ Acceptance Criteria

  • ✅ Navigating to /chat reflects the current chat log title in the tab.
  • ✅ Navigating to /flowchart reflects the current flowchart title.
  • ✅ Navigating to /calendar reflects the current calendar title.
  • ✅ Navigating to /login or /register while logged in redirects to /chat and updates the tab title accordingly.
  • ✅ Default titles are used when no specific entity is selected.
  • ✅ Title updates correctly on initial load, navigation, and redirects.

📌 Technical Details

  • Use react-helmet in each of the Chat, Flowchart, and Calendar components to dynamically set the document title.
  • Extract the title from application state (Redux).
  • Ensure ProtectedRoute uses useEffect or a similar hook to allow the component it redirects to time to render and update the helmet title.
  • Consider using a global <Helmet> handler in a layout component if title logic spans multiple areas.

🖼️ UI/UX Mockups (If applicable)

N/A – Browser tab behavior only.

📎 Related Issues or Dependencies

  • Related to redirect handling in ProtectedRoute
  • Depends on context/state management structure for titles

🚀 Priority & Story Points

  • Priority: Medium
  • Story Points: 3

Metadata

Metadata

Assignees

Labels

enhancementImprove an existing featurenew featureAdd a suggested feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions