Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add desktop content switcher to the home page #613

Merged
merged 4 commits into from
Jan 19, 2022
Merged

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Jan 17, 2022

Fixes

Related to #592

Description

This PR adds a Content Type switcher to the desktop version of the homepage. I've done it to test out how well the content switcher popover works when not in the header, and to see how best to handle state. It turns out that to make the component work well both in the header and on the homepage, it is easier to handle state (i.e. currently selected item) of the VContentTypePopover from the parent.

Testing Instructions

Run pnpm run dev, and open the home page. You should be able to see the content switcher inside the search bar, and also to select a content type from the dropdown (popover). The search itself is not functioning yet.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon 🌟 goal: addition Addition of new feature 🕹 aspect: interface Concerns end-users' experience with the software labels Jan 17, 2022
@obulat obulat added this to the Redesign milestone Jan 17, 2022
@obulat obulat requested a review from a team as a code owner January 17, 2022 11:44
@obulat obulat self-assigned this Jan 17, 2022
Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

How does this PR related to #607 ?

src/composables/use-content-type.js Outdated Show resolved Hide resolved
Comment on lines +62 to +67
const labelKey = {
image: 'search-type.image',
audio: 'search-type.audio',
all: 'search-type.all',
video: 'search-type.video',
}[props.activeItem]
Copy link
Contributor

Choose a reason for hiding this comment

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

I always liked this approach to mapping variables to a different result (using an object inline). 🙂

@obulat
Copy link
Contributor Author

obulat commented Jan 17, 2022

How does this PR related to #607 ?

I have been thinking about the Content Switcher only as part of the Header for a very long time. And just a couple of days ago I looked at the homepage, and realized that the same component is used inside the search bar. This made me rethink the organization of all of the components related to the switching of content types.
I will use the changes from this PR in #607.

Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

Oh, what an amazing surprise, I assumed this would be on the old homepage! This is great. @dhruvkb I want to make sure you're aware of this since you're working on finishing the homepage.

@zackkrida
Copy link
Member

@dhruvkb feel free to merge this without additional review if it is helpful to your homepage PR; the specific details can be discussed there.

@fcoveram fcoveram mentioned this pull request Jan 19, 2022
13 tasks
@dhruvkb
Copy link
Member

dhruvkb commented Jan 19, 2022

It will definitely be very useful, let me resolve the conflicts and merge it. Tagging @obulat for the notification.

@dhruvkb dhruvkb merged commit 7aaf745 into homepage Jan 19, 2022
@dhruvkb dhruvkb deleted the add_desktop_switcher branch January 19, 2022 15:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕹 aspect: interface Concerns end-users' experience with the software 🌟 goal: addition Addition of new feature 🟨 priority: medium Not blocking but should be addressed soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants