Skip to content

[Chat] introducing new type for future scalability#3156

Merged
JoshuaLai merged 33 commits intomainfrom
chat/teaminteropfilemetadata
Jul 14, 2023
Merged

[Chat] introducing new type for future scalability#3156
JoshuaLai merged 33 commits intomainfrom
chat/teaminteropfilemetadata

Conversation

@JoshuaLai
Copy link
Copy Markdown
Member

What

Per refactor conversation:
Introducing a 2 new types: CustomFileMetadata and TeamsInteropFileMetadata
The old FileMetadata is now export type FileMetadata = CustomFileMetadata | TeamsInteropFileMetadata;
This gives us more flexibility to introduce new types in the future.

Why

Instead of introducing new optional properties in the future we can instead just introduce a new type to perform type safe checks against.

How Tested

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2023

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2023

Calling bundle size is not changed.

  • Current size: 10019724
  • Base size: 10019724
  • Diff size: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2023

Chat bundle size is increased❗.

  • Current size: 2249617
  • Base size: 2249145
  • Diff size: 472

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2023

CallWithChat bundle size is increased❗.

  • Current size: 10662115
  • Base size: 10661643
  • Diff size: 472

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2023

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "update_snapshots" label to the PR for updating the snapshot.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2023

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "update_snapshots" label to the PR for updating the snapshot.

Comment thread packages/communication-react/review/beta/communication-react.api.md Outdated
Comment thread packages/communication-react/review/beta/communication-react.api.md Outdated
Comment thread packages/communication-react/review/beta/communication-react.api.md Outdated
Comment thread packages/react-components/src/components/MessageThread.test.tsx Outdated
Comment thread packages/react-components/src/components/FileDownloadCards.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@JoshuaLai JoshuaLai marked this pull request as ready for review June 15, 2023 19:35
@JoshuaLai JoshuaLai requested review from a team as code owners June 15, 2023 19:35
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "update_snapshots" label to the PR for updating the snapshot.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

Failed to pass the Static HTML UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "update_snapshots" label to the PR for updating the snapshot.

// (undocumented)
previewUrl?: string;
url: string;
payload?: Record<string, string> | undefined;
Copy link
Copy Markdown
Contributor

@PorterNan PorterNan Jul 14, 2023

Choose a reason for hiding this comment

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

You don't need to add | undefined if the property is defined by ?:

// @beta
export interface ImageFileMetadata extends BaseFileMetadata {
// (undocumented)
attachmentType: 'inlineImage' | 'attachedImage';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to use only one attachmentType for one type
The attachmentType property is more like a kind property for identify the object type, so a one to one mapping would be nice
or we use another parameter name as kind and this one is dedicated for attachedImage or inlineImage

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Confirmed that we can remove the attachedImage type since it is not being used

export type FileMetadata = FileSharingMetadata;

// @beta
export interface FileSharingMetadata extends BaseFileMetadata {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like this is a beta type leak? Or please mark these classes as //@public if there are for stable

@JoshuaLai JoshuaLai enabled auto-merge (squash) July 14, 2023 22:59
@github-actions
Copy link
Copy Markdown
Contributor

@JoshuaLai JoshuaLai merged commit 33592e0 into main Jul 14, 2023
@JoshuaLai JoshuaLai deleted the chat/teaminteropfilemetadata branch July 14, 2023 23:17
carocao-msft added a commit that referenced this pull request Jul 25, 2023
…rload with options bag (#3337)

* fix mobile but

* Change files

* Duplicate change files for beta release

* new join call api

* Change files

* Duplicate change files for beta release

* videoOption type

* [bugfix][a11y] Label side pane tab header currently active tab as aria-label (#3345)

* Add selected state to side pane tabheader tabs

* [Chat] introducing new type for future scalability (#3156)

* [Chat] Fix chat sample app conditional comment (#3314)

* Fix conditional comments for Chat sample app

* Change files

* Duplicate change files for beta release

* Add type check to stable sample chat app

* [Chat] cleaning up some unused property for FileMetaData (#3347)

* [BugFix] Update Captions banner to not obstruct verticalGallery controls on landscape mobile (#3305)

* move control bar to left when landscape mode

* refactor captions styles

* move styling changes to component

* remove CC demo code.. oops.

* Change files

* Duplicate change files for beta release

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Change control bar positioning logic

* fix legacy control view

* remove test.only

* change to move control bar when container is 16:9

* address comments

* fix stable build

* Update change/@azure-communication-react-20b35cc7-52f0-40ed-8502-191c5fe29c38.json

Co-authored-by: edwardlee-msft <edwardlee@microsoft.com>
Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

* update contol bar movement

* control bar movement

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

* fix nits

---------

Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: edwardlee-msft <edwardlee@microsoft.com>

* If video effect fails, none effect in picker is highlighted (#3334)

* If video effect fails, none effect in picker is highlighted

* Change files

* Duplicate change files for beta release

* Minor changes

* Fix unread chat messages badge on the CallWithChatComposite being cleared when the call goes on hold (#3332)

* Added capabilites feature to stateful client (#3340)

* Added capabilites feature to stateful client

* Change files

* Duplicate change files for beta

* update api undocumented comment

---------

Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>

* [Chat] Fix mention popover position incorrect when insert mention in the middle of long text (#3348)

* Fix Mention Popover's position is too low when insert mention in the middle of a very long text

* Change files

* Duplicate change files for beta release

* [A11y bugfix] Fix video effects pane tab ordering on call screen (#3351)

* add focus zones

* Change files

* Duplicate change files for beta release

* fix nit

* Effects pane header misaligned (#3338)

* Effects pane header misaligned

* Change files

* Duplicate change files for beta release

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

* Minor changes

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallWithChatComposite browser test snapshots

* Update packages/react-composites CallComposite browser test snapshots

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix breaking change check by ensuring dependencies are installed for the base branch (#3356)

* Update pnpm version to 8.6.9 (#3357)

* Fix bug where captions keep scrolling to the bottom when new captions are received  (#3353)

* scrolling bug

* Change files

* Duplicate change files for beta release

* api

* file

* file

* lint

* update storybook

* update storybook

* update

* update

---------

Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
Co-authored-by: edwardlee-msft <edwardlee@microsoft.com>
Co-authored-by: JoshuaLai <9044372+JoshuaLai@users.noreply.github.com>
Co-authored-by: Leah Xia <107075081+Leah-Xia-Microsoft@users.noreply.github.com>
Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: prabhjot-msft <97124699+prabhjot-msft@users.noreply.github.com>
Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com>
Co-authored-by: mgamis-msft <79475487+mgamis-msft@users.noreply.github.com>
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.

4 participants