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

Adding unread dot view to TableViewCell #1446

Merged
merged 11 commits into from
Dec 20, 2022

Conversation

sophialee0416
Copy link
Contributor

@sophialee0416 sophialee0416 commented Dec 8, 2022

Platforms Impacted

  • iOS
  • macOS

Description of changes

Adding a new "unread dot" view to the TableView Cell.

Binary change:

File Before After Delta
libFluentUI.a 28,593,248 bytes 28,617,896 bytes +24,648 bytes
TableViewCell 818,360 bytes 835,600 bytes +17,240 bytes
TableViewCellTokenSet 118,528 bytes 118,424 bytes -104 bytes

Verification

Default In Selection Mode
image image
image image
image image

Testing RTL:
image

Testing unread/read dot changes in Selection mode:
Simulator Screen Recording - iPhone 14 Pro Max - 2022-12-09 at 17 41 56

Testing theming:
Simulator Screen Recording - iPhone 14 Pro Max - 2022-12-09 at 17 43 37

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@sophialee0416 sophialee0416 requested a review from a team as a code owner December 8, 2022 03:50
@sophialee0416 sophialee0416 changed the title Adding leading view Adding additional leading view to TableViewCell Dec 8, 2022
@sophialee0416
Copy link
Contributor Author

I also made this little property take in any UIView, but if we want to be more strict about this particular property and only make it as a dot, I can happily make that change as well.

@edjamesmsft
Copy link
Contributor

Nit: could you explain in the PR description a bit more thoroughly what this change is and why?

@sophialee0416 sophialee0416 added the API break This PR introduces a breaking API change label Dec 20, 2022
@sophialee0416
Copy link
Contributor Author

Interestingly, I think changing to CALayer for the unread dot might have increased the binary size further as opposed to using a UIView.

@edjamesmsft
Copy link
Contributor

Interestingly, I think changing to CALayer for the unread dot might have increased the binary size further as opposed to using a UIView.

Do you know by how much? But either way, if the CALayer is more expensive, go for the UIView unless there are clear functional benefits to using the CALayer.

@sophialee0416
Copy link
Contributor Author

Interestingly, I think changing to CALayer for the unread dot might have increased the binary size further as opposed to using a UIView.

Do you know by how much? But either way, if the CALayer is more expensive, go for the UIView unless there are clear functional benefits to using the CALayer.

It was by 4kB I think? It might be because we weren't drawing any views prior. I think sticking to CALayer will be better for now

@sophialee0416 sophialee0416 merged commit 34719d4 into microsoft:main Dec 20, 2022
@sophialee0416 sophialee0416 changed the title Adding additional leading view to TableViewCell Adding unread dot view to TableViewCell Jan 3, 2023
@edjamesmsft edjamesmsft mentioned this pull request Jan 25, 2023
11 tasks
edjamesmsft added a commit that referenced this pull request Jan 25, 2023
* SegmentedControl code clean up (#1432)

* fix rotation bug on segmented control (#1411)

* Fix pillMaskedLabelContainerView comment

* Fix update logic

* Make tokenSink and animation duration private

* Update selectionView on token update

Co-authored-by: Harrie Shin <hyshin@microsoft.com>

* Update to checkout v3 (#1459)

* Adding additional leading view to TableViewCell (#1446)

* Merge tokenized Tooltip into main (#1434)

* Bring Tooltip to main

* remove extra space

* Bring changes from theming fix

* [XCUITests] Launch tests for all controls (#1461)

* add launch tests

* remove test template

* update to use base class + resolve comments

* change back to swift + use extension

* change back to base class with overridden control name

* resolve comments

* Add documentation for Avatar (#1469)

* add documentation for avatar

* add swiftui usage example

* Add documentation for Button (#1471)

* Added button documentation

* Fix table in documentation

* Fix table

* Rename table sections + fix path and typo

* Resized documentation images

* Cleanup

* More cleanup

* Added names to documentation

* fix tooltip png filenames (#1473)

* Update Date Picker test to start from `now` to fix test failure (#1477)

* Update Date Picker test to start from today

* Add explicit type interface

* Create a Readme section for demo app controls (#1268)

* Added new readme icon

* Added a vc for the readme

* Created scroll view and labels

* Added a ReadmeStrings class

* Removing title + polishing readme class

* Added a few more readmes

* Revert "Added new readme icon"

This reverts commit c73665f.

* Moving constant values into a struct

* Moved strings to their respective demo controllers

* Change from readme button text to icon

* Added todo to change color to fluent 2 ramp

* Moved constants struct to top of the file

* Use NSLayourConstraint.activate

* Added tvc readme section

* Removed unnecessary function

* Make fields private

* Refactor + added a few readmes

* Added more readmes

* Cleanup

* Move constraints logic to viewDidLoad

* Moved private properties to bottom of file

* Change unavailable to unavailable (#1475)

* Centralize missing readme string (#1479)

* [XCUITests] Add macOS launch tests (#1484)

* add macos launch tests

* try adding to ci

* remove other build commands

* change arch

* change macOS version

* add back build commands

* Resolving height issue (#1485)

* [XCUITests] Add iOS XCUITests to CI (#1480)

* test adding ios tests to ci

* remove -ios

* try changing to Demo.Development

* add new scheme

* add executable to run

* check run

* uncheck run

* change back to Demo.Development

* remove scheme

* change to just test

* add back scheme

* remove other build commands

* add back debug build

* add test retries

* comment out non tokenized tests

* remove retries + turn off parallelism

* add back other tests

* test if all are going to command bar

* change tests back to controlName

* add tear down that deletes app

* remove setup logic

* add timeouts

* change timeout to 1

* add back other build commands

* remove scheme

* whitespace change

* update tearDown to use isFirstLaunch

* fix linting issue

* remove isFirstLaunch from UserDefaults and add #if DEBUG

* try moving navigation back to setUpWithError

* whitespace change

* Skip failing date picker tests (#1495)

* Fix BadgeField space bug (#1497)

* attempt to fix space bug

* add comment

* [XCUITests] Activity Indicator tests (#1493)

* initial activity indicator tests

* add transition to dark mode

* whitespace change

* add dark mode color assert

* add default color to identifier

* update comment

* add dark mode + update to use .*

* add #if DEBUG

* add #if DEBUG to SceneDelegate

* add constants

* add type

* change to hex code

* removing color tests

* Revert "removing color tests"

This reverts commit 79c20c0.

* removing color tests again

* remove SceneDelegate change

* small change

* make code more readable + have SwiftUI inherit from UIKit

* remove super

* [XCUITests] Indeterminate Progress Bar tests (#1503)

* add indeterminate progress bar tests

* update SwiftUI to inherit from UIKit

* remove super

* resolve comments

* Resolving demo conflicts

* Resolving TableViewCell merge conflicts

* Taking tokenized tooltip from main - no fluent2

* Getting TVC building again

* Updating tooltip tokens

* Fixing TVC sample data and demo project

* Fixing token values

Co-authored-by: huwilkes <67026548+huwilkes@users.noreply.github.com>
Co-authored-by: Harrie Shin <hyshin@microsoft.com>
Co-authored-by: Sophia Lee <sophia.lee0416@gmail.com>
Co-authored-by: Jeanie Huynh <31874971+jeaniehuynh@users.noreply.github.com>
Co-authored-by: Joanna Qu <55368679+joannaquu@users.noreply.github.com>
Co-authored-by: Lamine Male <106181067+laminesm@users.noreply.github.com>
harrieshin added a commit that referenced this pull request Mar 2, 2023
When #1446 introduced unread dot to tableviewcell, it started to customize accessibilityLabel of the cell. Couple of issues observed
(1) when tableview scrolls, and it dequeues an existing cell identifier, it will still contain the old accessibilityLabel value and not grab the latest title of the cell. We assume Apple behind the scene groups all the UILabel inside the cell and aggregate the cell's accessibilitylabel correctly. But, once you custom call accessibilityLabel and set it yourself, this hidden feature no longer works.

(2) unread dot assumes that the titleLabel.title is the right string. When in fact, it could be titleLabel.attributedString that has the right value for the cell.

We want to fix this bug quickly with minimal impact of loc and code changes. For now, similar to how we handle boolean cell (which is cell with uiswitch) move the "unread" string to AccessibilityValue instead. Currently our loc string is "%@, unread" which isn't ideal, but VoiceOver seems to just read out fine. We will need to refactor a bit later to get this corrected.
harrieshin added a commit to harrieshin/fluentui-apple that referenced this pull request Mar 2, 2023
…osoft#1618)

When microsoft#1446 introduced unread dot to tableviewcell, it started to customize accessibilityLabel of the cell. Couple of issues observed
(1) when tableview scrolls, and it dequeues an existing cell identifier, it will still contain the old accessibilityLabel value and not grab the latest title of the cell. We assume Apple behind the scene groups all the UILabel inside the cell and aggregate the cell's accessibilitylabel correctly. But, once you custom call accessibilityLabel and set it yourself, this hidden feature no longer works.

(2) unread dot assumes that the titleLabel.title is the right string. When in fact, it could be titleLabel.attributedString that has the right value for the cell.

We want to fix this bug quickly with minimal impact of loc and code changes. For now, similar to how we handle boolean cell (which is cell with uiswitch) move the "unread" string to AccessibilityValue instead. Currently our loc string is "%@, unread" which isn't ideal, but VoiceOver seems to just read out fine. We will need to refactor a bit later to get this corrected.
harrieshin added a commit that referenced this pull request Mar 2, 2023
… (#1619)

When #1446 introduced unread dot to tableviewcell, it started to customize accessibilityLabel of the cell. Couple of issues observed
(1) when tableview scrolls, and it dequeues an existing cell identifier, it will still contain the old accessibilityLabel value and not grab the latest title of the cell. We assume Apple behind the scene groups all the UILabel inside the cell and aggregate the cell's accessibilitylabel correctly. But, once you custom call accessibilityLabel and set it yourself, this hidden feature no longer works.

(2) unread dot assumes that the titleLabel.title is the right string. When in fact, it could be titleLabel.attributedString that has the right value for the cell.

We want to fix this bug quickly with minimal impact of loc and code changes. For now, similar to how we handle boolean cell (which is cell with uiswitch) move the "unread" string to AccessibilityValue instead. Currently our loc string is "%@, unread" which isn't ideal, but VoiceOver seems to just read out fine. We will need to refactor a bit later to get this corrected.
@sophialee0416 sophialee0416 deleted the tvcDot branch April 24, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API break This PR introduces a breaking API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants