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

feat(ONYX-1479): add quick links section #6354

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

dariakoko
Copy link
Contributor

Addresses ONYX-1479

Adds QuickLinks section to the list of HomeView sections
image

Co-authored-by: Mounir Dhahri <[email protected]>
@dariakoko dariakoko self-assigned this Jan 15, 2025
@artsy-peril
Copy link
Contributor

artsy-peril bot commented Jan 15, 2025


Warnings
⚠️ The V2 schema in this PR has breaking changes with Force. Remember to update the Force schema if necessary.

Field 'seoExperimentArtists' was removed from object type 'Query'
Field 'isInSeoExperiment' was removed from object type 'Artist'
Field 'teamName' was removed from object type 'Job'
Field 'seoExperimentArtists' was removed from object type 'Viewer'
Field 'homeViewTasksSection' was removed from object type 'AckTaskMutationPayload'
Field 'homeViewTasksSection' was removed from object type 'DismissTaskMutationPayload'

Generated by 🚫 dangerJS against 142eb4c

olerichter00
olerichter00 previously approved these changes Jan 15, 2025
Copy link
Contributor

@olerichter00 olerichter00 left a comment

Choose a reason for hiding this comment

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

Looks great 🌟

Comment on lines 29 to 34
/*
* A section type in the home view is specified declaratively
* as a GraphQL object that implements the HomeViewGenericSectionInterface
*
* Below we will configure its various fields.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹

Suggested change
/*
* A section type in the home view is specified declaratively
* as a GraphQL object that implements the HomeViewGenericSectionInterface
*
* Below we will configure its various fields.
*/


export const QuickLinks: HomeViewSection = {
id: "home-view-section-quick-links",
// TODO: add ContextModule quickLinks
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Co-authored-by: Mounir Dhahri <[email protected]>
Comment on lines 29 to 31
contextScreenOwnerId: {
type: GraphQLString,
description: "The owner ID for the context module",
Copy link
Member

Choose a reason for hiding this comment

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

@anandaroop @dblandin what do you think about this?

Copy link
Member

Choose a reason for hiding this comment

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

What is this used for? The only specific value I see currently is "/collect?price_range=*-1000" which doesn't read as an ID to me.

Is this needed value need for the analytics support?

Copy link
Member

Choose a reason for hiding this comment

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

yes, that's what we have in mind. We can also use the href as a payload for the tracking event. it's not clear so far.

Copy link
Member

Choose a reason for hiding this comment

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

To capture the href value, you could use destination_path which we've included in similar events.

artsy/cohesion#525

MounirDhahri
MounirDhahri previously approved these changes Jan 16, 2025
src/schema/v2/homeView/sectionTypes/QuickLinks.ts Outdated Show resolved Hide resolved
src/schema/v2/homeView/sectionTypes/QuickLinks.ts Outdated Show resolved Hide resolved
Copy link
Member

@dblandin dblandin left a comment

Choose a reason for hiding this comment

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

Looking good!

Some high-level feedback:

I like "QuickLinks" as the name of the specific section instance but I wonder if we can abstract the section type a bit more. Maybe "NavigationPills"?

That way, we can potentially have more than one instance of this section type in the schema. For example, maybe later on we have a need for two different section instances (e.g. "ForYouQuickLinks" and "ExploreQuickLinks") and each can be backed by the same "NavigationPills" section type.

What do you think?

Comment on lines 29 to 31
contextScreenOwnerId: {
type: GraphQLString,
description: "The owner ID for the context module",
Copy link
Member

Choose a reason for hiding this comment

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

What is this used for? The only specific value I see currently is "/collect?price_range=*-1000" which doesn't read as an ID to me.

Is this needed value need for the analytics support?

@MounirDhahri
Copy link
Member

That's great feedback @dblandin thanks

Comment on lines 29 to 31
contextScreenOwnerId: {
type: GraphQLString,
description: "The owner ID for the context module",
Copy link
Member

Choose a reason for hiding this comment

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

yes, that's what we have in mind. We can also use the href as a payload for the tracking event. it's not clear so far.

@@ -2,25 +2,25 @@ import { ContextModule, OwnerType } from "@artsy/cohesion"
import { HomeViewSection } from "."
import { HomeViewSectionTypeNames } from "../sectionTypes/names"

export const QuickLinks: HomeViewSection = {
export const NavigationPills: HomeViewSection = {
Copy link
Member

Choose a reason for hiding this comment

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

I believe that we don't need to rename this. Renaming the section type should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm I have the same question I'm asking here: is there a reason you want to keep different names?

Copy link
Member

Choose a reason for hiding this comment

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

Cross-linking this comment: artsy/cohesion#548 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think NavigationPills is a good name for the section type — but for this section instance I like the idea of calling it something else like QuickLinks. That way we decouple the section type from the specific, concrete section that uses it, as we have for the previous sections mentioned in Devon's linked comment.

This is of greater value for section types that can be re-used and I'm not sure if this one will be, but I think this is a good default for us to follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah omg, I get it now, thanks everyone for explaining!

}

export interface NavigationPill {
contextScreenOwnerId?: string | null
Copy link
Member

Choose a reason for hiding this comment

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

action item: to delete

Copy link
Member

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

Looking good!

I've just added some thoughts about naming and organization, similar to others' comments.

I'd be in favor of de-coupling the section type (NavigationPills) from the specific section instance (QuickLinks?) even if there isn't an immediately obvious opportunity for re-use of the section type.

The type:

// sectionTypes/NavigationPills.ts

export interface NavigationPill {
  
}

const NavigationPillType = new GraphQLObjectType<NavigationPill, >({
  name: "NavigationPill",
  ...
})

export const HomeViewNavigationPillsSectionType = new GraphQLObjectType({
  name: HomeViewSectionTypeNames.HomeViewSectionNavigationPills,
  description: "A selection of navigational pills in the home view",
  ...
})

The instance:

// sections/QuickLinks.ts

export const QuickLinks: HomeViewSection = {
  id: "home-view-section-quick-links",
  type: HomeViewSectionTypeNames.HomeViewSectionNavigationPills,}

src/schema/v2/homeView/sectionTypes/NavigationPills.ts Outdated Show resolved Hide resolved
@@ -2,25 +2,25 @@ import { ContextModule, OwnerType } from "@artsy/cohesion"
import { HomeViewSection } from "."
import { HomeViewSectionTypeNames } from "../sectionTypes/names"

export const QuickLinks: HomeViewSection = {
export const NavigationPills: HomeViewSection = {
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think NavigationPills is a good name for the section type — but for this section instance I like the idea of calling it something else like QuickLinks. That way we decouple the section type from the specific, concrete section that uses it, as we have for the previous sections mentioned in Devon's linked comment.

This is of greater value for section types that can be re-used and I'm not sure if this one will be, but I think this is a good default for us to follow.

export const NavigationPills: HomeViewSection = {
id: "home-view-section-navigation-pills",
contextModule: ContextModule.quickLinks,
ownerType: OwnerType.quickLinks,
Copy link
Member

Choose a reason for hiding this comment

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

question: This ownerType optional attribute is intended for a section's view-all screen — I think that's not actually relevant or required here, right?

},
}

export interface NavigationPill {
Copy link
Member

Choose a reason for hiding this comment

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

question: I wonder if it makes more sense for this interface to live over in the NavigationPill section type and be imported here? This interface is very coupled to that section type's response shape.

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.

5 participants