-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adds threshold filter to the new home view #3718
base: main
Are you sure you want to change the base?
Conversation
7beb06e
to
a52d3fb
Compare
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.
Please be sure to separate the owner changes to another branch as we will not be shipping that this release.
@gl-change=${(e: CustomEvent<{ threshold: OverviewRecentThreshold }>) => { | ||
if (!this._overviewState.filter.stale || !this._overviewState.filter.recent) { | ||
return; | ||
} | ||
this._ipc.sendCommand(SetOverviewFilter, { | ||
stale: this._overviewState.filter.stale, | ||
recent: { ...this._overviewState.filter.recent, threshold: e.detail.threshold }, | ||
}); | ||
}} |
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.
Nit: move the event handler to a private method for readability
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.
done
@property({ type: Array }) options: (OverviewRecentThreshold | OverviewStaleThreshold)[] | undefined; | ||
private selectDateFilter(threshold: OverviewRecentThreshold | OverviewStaleThreshold) { | ||
const event = new CustomEvent('gl-change', { | ||
detail: { threshold: threshold }, | ||
}); | ||
this.dispatchEvent(event); | ||
} | ||
|
||
private renderOption(option: OverviewRecentThreshold | OverviewStaleThreshold) { | ||
switch (option) { | ||
case 'OneDay': | ||
return '1 day'; | ||
case 'OneWeek': | ||
return '1 week'; | ||
case 'OneMonth': | ||
return '1 month'; | ||
case 'OneYear': | ||
return '1 year'; | ||
} | ||
} |
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.
Option labels should be passed in as part of the options
:
{ label: string; value: OverviewRecentThreshold | OverviewStaleThreshold}[]
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.
done
src/webviews/home/homeWebview.ts
Outdated
}, | ||
stale: { | ||
threshold: 'OneYear', | ||
show: true, |
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.
Stale should be false by default
. We don't want to ship stale until post-release of v16.
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.
changed
display: flex; | ||
justify-content: space-between; | ||
gap: 8px; |
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.
This style is shared with heading that don't have nested <spans>
, please make a modifier class to apply the flexbox.
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.
splitted
@@ -40,8 +43,7 @@ export class GlBranchSection extends LitElement { | |||
override render() { | |||
return html` | |||
<div class="section"> | |||
<h3 class="section-heading">${this.label}</h3> | |||
<slot></slot> | |||
<h3 class="section-heading"><span>${this.label}</span><slot></slot></h3> |
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.
<h3 class="section-heading"><span>${this.label}</span><slot></slot></h3> | |
<h3 class="section-heading"><span>${this.label}</span><slot name="heading-actions"></slot></h3> | |
<slot></slot> |
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.
done
const { repository } = overview; | ||
return html` | ||
<div class="repository"> | ||
<gl-branch-section | ||
label="Recent (${repository.branches.recent.length})" | ||
.branches=${repository.branches.recent} | ||
></gl-branch-section> | ||
> | ||
<gl-branch-threshold-filter |
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.
See named-slot comment in branch-section.ts.
<gl-branch-threshold-filter | |
<gl-branch-threshold-filter slot="heading-actions" |
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.
done
@customElement('gl-branch-owner-filter') | ||
export class GlBranchOwnerFilter extends GlElement { |
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.
Please split out all owner functionality as we will work on this post-release.
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.
done
5b082d1
to
b7c74ae
Compare
b7c74ae
to
4f5e3cb
Compare
Description
Screen.Recording.2024-11-07.at.13.40.33.mov
Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses