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

feat(ui5-dynamic-page-title): implement snapped title on mobile #9898

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

kgogov
Copy link
Member

@kgogov kgogov commented Sep 18, 2024

Overview

We have enhanced the ui5-dynamic-page-title component to improve the user experience on mobile devices when the DynamicPageTitle is in its collapsed (snapped) state. You can now display a simplified, single-line title specifically designed for mobile screens. This feature optimizes the use of limited screen space on mobile devices by showing a concise title that remains always visible.

New Slot

  • snappedTitleOnMobile
    • This slot allows you to provide custom content (typically a ui5-title component) that will be displayed as the title on mobile devices when the header is in its snapped state. The content set in this slot overrides other title content during the snapped state on mobile devices.

Usage

To utilize this feature, place a ui5-title into the snappedTitleOnMobile slot of the ui5-dynamic-page-title component. This content will be displayed on mobile devices when the header is snapped.

Example

<ui5-dynamic-page>
  <ui5-dynamic-page-title slot="titleArea">
    <!-- Main title displayed when the header is expanded or on non-mobile devices -->
    <ui5-title slot="heading">Full Title</ui5-title>

    <!-- Simplified title displayed on mobile devices when the header is snapped -->
    <ui5-title slot="snappedTitleOnMobile">Mobile Snapped Title</ui5-title>

    <!-- Additional title content -->
    <p slot="subheading">Subheading Text</p>
    <ui5-tag slot="content">Tag Content</ui5-tag>
  </ui5-dynamic-page-title>

  <!-- DynamicPageHeader and content slots -->
  <ui5-dynamic-page-header slot="headerArea">
    <!-- Header content -->
  </ui5-dynamic-page-header>

  <!-- Page content -->
  <div>
    <!-- Your page content here -->
  </div>
</ui5-dynamic-page>

@kgogov kgogov force-pushed the feat-dp-snapped-title-on-mobile branch 2 times, most recently from 4c95948 to d61f6d6 Compare September 19, 2024 15:07
@kgogov kgogov marked this pull request as ready for review September 19, 2024 15:15
@kgogov kgogov force-pushed the feat-dp-snapped-title-on-mobile branch 3 times, most recently from 8fbc626 to a2bb1f1 Compare September 25, 2024 08:52
packages/fiori/src/DynamicPageTitle.ts Outdated Show resolved Hide resolved
packages/fiori/src/DynamicPageTitle.ts Outdated Show resolved Hide resolved
packages/fiori/src/DynamicPageTitle.ts Outdated Show resolved Hide resolved
packages/fiori/src/DynamicPageTitle.ts Show resolved Hide resolved
packages/fiori/src/DynamicPage.ts Show resolved Hide resolved
- Introduced `snappedTitleOnMobile` property to display a simplified
  title on mobile when the header is snapped.
- Added `snappedTitleOnMobileText` to define the text for the
  mobile-specific snapped title.
- This feature optimizes title display on small screens, improving
  mobile usability.
- Clicking the snapped title on mobile expands the header.
- On non-mobile devices, the standard title is displayed, ignoring the
  mobile-specific title.
- Addressed review comments by changing the implementation of the snapped title on mobile.
- Replaced properties with a slot for better flexibility and maintainability.
@kgogov kgogov force-pushed the feat-dp-snapped-title-on-mobile branch from 381cc8f to 22e26e1 Compare September 26, 2024 09:33
…bile

Refactored the implementation to pass the "snappedTitleOnMobile" state
from parent to child. This change ensures proper state management,
addressing previous review comments.
@kgogov kgogov force-pushed the feat-dp-snapped-title-on-mobile branch from 22e26e1 to 982ec0a Compare September 26, 2024 09:48
@kgogov kgogov merged commit b8b9a98 into main Sep 26, 2024
10 checks passed
@kgogov kgogov deleted the feat-dp-snapped-title-on-mobile branch September 26, 2024 13:25
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.

2 participants