Skip to content

Activity Log: filter bar design#15468

Merged
leandroalonso merged 16 commits intodevelopfrom
task/design_filter_bar
Dec 17, 2020
Merged

Activity Log: filter bar design#15468
leandroalonso merged 16 commits intodevelopfrom
task/design_filter_bar

Conversation

@leandroalonso
Copy link
Copy Markdown
Contributor

@leandroalonso leandroalonso commented Dec 10, 2020

Part of #15192

Adds filter bar design + few enhancements on the calendar.

To test

  1. Open Activity Log
  2. Play with date range and activity type filters :)

Please, test by:

  1. Running it on iPad and iPhone
  2. Light and dark mode

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@leandroalonso leandroalonso added this to the 16.4 milestone Dec 10, 2020
@leandroalonso leandroalonso self-assigned this Dec 10, 2020
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Dec 10, 2020

You can test the changes on this Pull Request by downloading it from AppCenter here with build number: 39527. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Dec 10, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

Copy link
Copy Markdown
Contributor

@emilylaguna emilylaguna left a comment

Choose a reason for hiding this comment

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

Heya, looking good. I love the speed of the calendar now 👍

Do we need to show the scrollbars here?
RTL: I think the filter icon should be fully aligned to the right of the view
RTL: There are some overlapping issues

Comment on lines +165 to +199
let filterIcon = UIImageView(image: UIImage.gridicon(.filter))
filterIcon.tintColor = .listIcon
filterIcon.heightAnchor.constraint(equalToConstant: Constants.filterHeightAnchor).isActive = true
filterStackView.alignment = .center
filterStackView.spacing = Constants.filterStackViewSpacing
filterStackView.addArrangedSubview(filterIcon)
let scrollView = UIScrollView()
scrollView.canCancelContentTouches = true
filterStackView.addArrangedSubview(dateFilterChip)
filterStackView.addArrangedSubview(activityTypeFilterChip)
scrollView.addSubview(filterStackView)
containerStackView.addArrangedSubview(scrollView)
filterStackView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
filterStackView.leftAnchor.constraint(equalTo: scrollView.leftAnchor),
filterStackView.topAnchor.constraint(equalTo: scrollView.topAnchor),
filterStackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor),
scrollView.heightAnchor.constraint(equalTo: filterStackView.heightAnchor)
filterStackView.leftAnchor.constraint(equalTo: scrollView.leftAnchor, constant: Constants.filterBarHorizontalPadding),
filterStackView.rightAnchor.constraint(equalTo: scrollView.rightAnchor, constant: Constants.filterBarHorizontalPadding),
filterStackView.topAnchor.constraint(equalTo: scrollView.topAnchor, constant: Constants.filterBarVerticalPadding),
filterStackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: Constants.filterBarVerticalPadding),
scrollView.heightAnchor.constraint(equalTo: filterStackView.heightAnchor, constant: 2 * Constants.filterBarVerticalPadding)
])

setupDateFilter()

setupActivityTypeFilter()

let separator = UIView()
separator.translatesAutoresizingMaskIntoConstraints = false
scrollView.addSubview(separator)
NSLayoutConstraint.activate([
separator.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: 16),
separator.leftAnchor.constraint(equalTo: scrollView.leftAnchor),
separator.widthAnchor.constraint(equalTo: scrollView.widthAnchor),
separator.heightAnchor.constraint(equalToConstant: 1)
])
WPStyleGuide.applyBorderStyle(separator)
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.

This method is pretty messy. What do you think about doing something like:

        filterStackView.alignment = .center
        filterStackView.spacing = Constants.filterStackViewSpacing
        filterStackView.translatesAutoresizingMaskIntoConstraints = false

        let filterIcon = UIImageView(image: UIImage.gridicon(.filter))
        filterIcon.tintColor = .listIcon
        filterIcon.heightAnchor.constraint(equalToConstant: Constants.filterHeightAnchor).isActive = true

        filterStackView.addArrangedSubview(filterIcon)
        filterStackView.addArrangedSubview(dateFilterChip)
        filterStackView.addArrangedSubview(activityTypeFilterChip)

        let scrollView = UIScrollView()
        scrollView.canCancelContentTouches = true
        scrollView.addSubview(filterStackView)
        containerStackView.addArrangedSubview(scrollView)

        NSLayoutConstraint.activate([
            filterStackView.leftAnchor.constraint(equalTo: scrollView.leftAnchor, constant: Constants.filterBarHorizontalPadding),
            filterStackView.rightAnchor.constraint(equalTo: scrollView.rightAnchor, constant: Constants.filterBarHorizontalPadding),
            filterStackView.topAnchor.constraint(equalTo: scrollView.topAnchor, constant: Constants.filterBarVerticalPadding),
            filterStackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: Constants.filterBarVerticalPadding),
            scrollView.heightAnchor.constraint(equalTo: filterStackView.heightAnchor, constant: 2 * Constants.filterBarVerticalPadding)
        ])

        setupDateFilter()
        setupActivityTypeFilter()

        let separator = UIView()
        separator.translatesAutoresizingMaskIntoConstraints = false
        scrollView.addSubview(separator)
        NSLayoutConstraint.activate([
            separator.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor, constant: 16),
            separator.leftAnchor.constraint(equalTo: scrollView.leftAnchor),
            separator.widthAnchor.constraint(equalTo: scrollView.widthAnchor),
            separator.heightAnchor.constraint(equalToConstant: 1)
        ])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in f94c667

I also extracted the filter to its own file.

@osullivanchris
Copy link
Copy Markdown

osullivanchris commented Dec 11, 2020

Very slick, great job. A couple of really nice touches. The smart reselection of dates is great (adapting the start/end date whichever I'm closer to). Loading state works well. Generally feels very polished.

Minor details to consider:

  • its per design, but does the 'x' in the chip feel too heavy? Should we go with the grey we're using in icons?
  • Should we have a shadow beneath the selected dates on scroll? I never love when things just disappear behind nothing in the ui 😛
  • I noticed on landscape that when I selected one date, the layout for the date selection heading was off-center
  • Also noticed scrollbar as @emilylaguna mentioned

I haven't gotten the build working on my iPad yet but thought I'd share these. If I notice anything on iPad I'll add it later.

@jkmassel
Copy link
Copy Markdown
Contributor

👋 Howdy! Today's the day we're cutting the 16.4 release.

Because of that, this PR will be bumped to 16.5. If you need it to be part of 16.4, please merge it into the release/16.4 branch and DM me – I'll be happy to cut a new beta release!

@jkmassel jkmassel modified the milestones: 16.4, 16.5 Dec 14, 2020
@leandroalonso
Copy link
Copy Markdown
Contributor Author

@emilylaguna @osullivanchris ready for another review!

@leandroalonso leandroalonso mentioned this pull request Dec 15, 2020
13 tasks
Copy link
Copy Markdown
Contributor

@emilylaguna emilylaguna left a comment

Choose a reason for hiding this comment

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

Hey RTL is looking much better! I noticed a couple more things:

In LTR the bottom separator doesn't go all to the way to the end when scrolling:

Screen Shot 2020-12-16 at 10 24 26 AM

In RTL there is no separator at all 🤔
Screen Shot 2020-12-16 at 10 26 12 AM

@leandroalonso
Copy link
Copy Markdown
Contributor Author

@emilylaguna fixed in cedc3b1

Copy link
Copy Markdown
Contributor

@emilylaguna emilylaguna left a comment

Choose a reason for hiding this comment

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

👏 Nice, working very well now.

@leandroalonso leandroalonso merged commit e8db6b1 into develop Dec 17, 2020
@leandroalonso leandroalonso deleted the task/design_filter_bar branch December 17, 2020 12:56
@osullivanchris
Copy link
Copy Markdown

@emilylaguna @osullivanchris ready for another review!

All looks great now

  • 'x' on the chip works better slightly lighter
  • really nice job on the fade-out behind the calendar. Looks slick
  • landscape centring issue fixed
  • scrollbar hidden, looks much better

Noting you have a kinda animation going I think when the chip changes. I wasn't expecting it, but I think I like it.

Have not been able to view directly on iPad, but looks good based on screenshots.

Big 👍 from me.

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.

5 participants