Skip to content

Conversation

@SunsetTechuila
Copy link
Member

No description provided.


export const isOrganizationRepo = (): boolean => exists('.AppHeader-context-full [data-hovercard-type="organization"]');
// TODO: Remove the second check after June 2026
export const isOrganizationRepo = (): boolean => Boolean($('qbsearch-input')?.getAttribute('data-current-org')) || exists('.AppHeader-context-full [data-hovercard-type="organization"]');
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the first check can also be a single selector (qbsearch-input[data-current-org]) so this can be a single exists() call

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be :is(qbsearch-input[data-current-org]:not[[data-current-org]=""], .AppHeader-context-full [data-hovercard-type="organization"]). Do you prefer that?

Copy link
Member

@fregante fregante Feb 12, 2026

Choose a reason for hiding this comment

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

There's no need for :is() though, right? I think I prefer it because it's more specific about what's expecting anyway, rather than the catch-all/casting Boolean()

Copy link
Member Author

Choose a reason for hiding this comment

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

There's no need for :is() though, right?

Unless you want me to update exists and $ to support selector arrays, there is

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess you suggest to make only the first check a single exists() call

Copy link
Member Author

@SunsetTechuila SunsetTechuila Feb 12, 2026

Choose a reason for hiding this comment

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

Actually, we use can't use exists() for this check

image

Copy link
Member

Choose a reason for hiding this comment

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

exists('a, b')

I don't see what the issue is in that screenshot. Empty attributes can also be selected

Copy link
Member

@fregante fregante Feb 12, 2026

Choose a reason for hiding this comment

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

You can also just use exists(['a','b'].join()) to keep each line commentable. Or String([]). Or have it accept an array. I'm sure this isn't the first array of selectors in this package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants