Skip to content

Support contentless activity in livestream#5430

Merged
compulim merged 54 commits intomicrosoft:mainfrom
compulim:feat-conclude-empty-livestream
Mar 12, 2025
Merged

Support contentless activity in livestream#5430
compulim merged 54 commits intomicrosoft:mainfrom
compulim:feat-conclude-empty-livestream

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented Feb 25, 2025

Changelog Entry

Description

This PR will add support of contentless activity in livestream.

Contentless activity are activities that will not be rendered. It includes activities without text and attachments.

In a livestream, activity without text content and attachments will be rendered as typing indicator and would not fade away until the livestream concluded.

When a livestream is concluded with a contentless activity, its message bubble will be removed.

Contentless activity in livestream

Contentless activity in livestream will show up as a typing indicator that will only go away when the livestream is concluded.

Design

Currently, contentless activity includes only activities without text and attachments. In future, we may consider activities which are not rendered by any activity and attachment middleware as well.

Specific Changes

  • Code: Added new livestreaming type "contentless"
  • Code: Added internal useReduceActivities hook to process incremental changes to activities
  • Code: Reworked "typing" state
    • Handling multiple set of activities
      • Previously, it will only look at one set of activity (livestream or typing)
      • Now, it will compute the typing state based on all active set of activities
      • This support 2+ livestreams, say: A open, B open, B close. It will still show typing because A is open, this is previously not possible
    • Move to useReduceActivities to enable incremental computation
      • When useActivities() state hook is updated, it will recompute from the position where the change occurred
      • Intermediate values will be saved internally in useReduceActivities
    • Contentless activity in livestream
      • Will now show as typing indicator and it will not fade away until the livestream is closed
  • Code: Livestream will now support attachment in carousel layout
  • Docs: Added "contentless activity" to LIVESTREAMING.md
  • Test: Added <WebChatDecorator> to all tests related to livestreaming
  • Test: Upgraded __tests__/sendTypingIndicator to "html2"
  • Test: Disabled some ESLint rules by default via .eslintrc
  • Test: Fixed flaky tests conversationStartProperties.*
  • Test: Fixed renderHook not working with props in rerender
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim force-pushed the feat-conclude-empty-livestream branch from 2dc4c3d to 666d7c1 Compare March 11, 2025 18:08
@compulim compulim changed the title [WIP] Conclude livestream with empty content Support contentless activity in livestream Mar 12, 2025
@compulim compulim marked this pull request as ready for review March 12, 2025 07:01
OEvgeny
OEvgeny previously approved these changes Mar 12, 2025
OEvgeny
OEvgeny previously approved these changes Mar 12, 2025
Copy link
Copy Markdown
Collaborator

@OEvgeny OEvgeny left a comment

Choose a reason for hiding this comment

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

Approved with another question

@compulim compulim enabled auto-merge (squash) March 12, 2025 18:08
@compulim compulim merged commit 706dcd7 into microsoft:main Mar 12, 2025
25 checks passed
@compulim compulim deleted the feat-conclude-empty-livestream branch March 12, 2025 18:09
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