Repository navigation
conversation-activity-filter - Fix sticky header and mobile alignment
#10228
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,9 +19,23 @@ | |
| /* outline: solid 5px #f00; */ | ||
| } | ||
| } | ||
| /* On mobile, keep the original primary button (e.g. "New issue") at the start without shifting */ | ||
| @media (max-width: 768px) { | ||
| .rgh-conversation-activity-filter > action-menu + * { | ||
|
|
||
| /* Align activity filter after title in the PR sticky header */ | ||
| [class*='StickyPullRequestHeader'] [data-component='TitleArea'] > action-menu, | ||
| [class*='prHeader'] [data-component='TitleArea'] > action-menu, | ||
| [class*='prTitleArea'] > action-menu { | ||
| order: 2; | ||
| margin-left: auto; | ||
| margin-right: var(--base-size-16, 16px); | ||
| } | ||
|
|
||
| /* On narrow layouts, keep primary buttons at the start */ | ||
| @media (max-width: 1012px) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my tests this value should be 1075px |
||
| [class*='menuActionsContainer'] > action-menu + * { | ||
| order: -1; | ||
| } | ||
|
|
||
| [data-component='PH_Actions'] > action-menu { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this? |
||
| order: 1; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,7 +112,7 @@ function addWidget(anchor: Element): void { | |
| anchor.classList.add('rgh-conversation-activity-filter'); | ||
| mount(ConversationActivityFilter, { | ||
| target: anchor, | ||
| anchor: anchor.firstElementChild!, | ||
| anchor: anchor.firstElementChild ?? undefined, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary change |
||
| }); | ||
| } | ||
|
|
||
|
|
@@ -143,8 +143,11 @@ async function init(signal: AbortSignal): Promise<void> { | |
| [ | ||
| // Issue view (desktop, mobile, sticky) | ||
| '[class*="menuActionsContainer"]', | ||
| // PR view | ||
| '[data-component="PageHeader"][data-has-nav] [data-component="PH_Actions"]', | ||
| // PR view (main header) | ||
| ':is([data-component="PageHeader"][data-has-nav], [class*="PageHeader"][data-has-nav]) [data-component="PH_Actions"]', | ||
| // PR view (sticky header) | ||
| '[class*="prTitleArea"]', | ||
| ':is([class*="StickyPullRequestHeader"], [class*="prHeader"]) [data-component="TitleArea"]', | ||
|
Comment on lines
+147
to
+150
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not use :is() in here. Each of these are already selectors. Also why are these so many different selectors? There are like 3 for sticky header and 2 for the main one. I don’t think we need more than 1 and 1 |
||
| ], | ||
| addWidget, | ||
| {signal}, | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these for? From what I can tell this is not needed