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

Add option to filter experiments to starred #2164

Merged
merged 6 commits into from
Aug 10, 2022
Merged

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Aug 9, 2022

1/4 main <- this <- #2169 <- #2170 <-#2171

This PR gives users the ability to filter experiments by their starred status.

Demo

Screen.Recording.2022-08-09.at.4.38.08.pm.mov

@mattseddon mattseddon added the product PR that affects product label Aug 9, 2022
@mattseddon mattseddon self-assigned this Aug 9, 2022
@@ -0,0 +1,22 @@
import { Column } from '../webview/contract'

export type ColumnLike = { label: string; path: string; types?: string[] }
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] This definition is used in the quick pick. It means that we don't have to create a full mocked Column for "starred".

@@ -128,7 +128,7 @@ export class ExperimentsModel extends ModelWithPersistence {

public toggleStatus(id: string) {
if (
this.flattenExperiments().find(({ id: queuedId }) => queuedId === id)
this.getFlattenedExperiments().find(({ id: queuedId }) => queuedId === id)
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] The main change in this file was to encapsulate access to experiments and checkpoints so that details (selected and starred) are always added.

@mattseddon mattseddon marked this pull request as ready for review August 10, 2022 02:36
@codeclimate
Copy link

codeclimate bot commented Aug 10, 2022

Code Climate has analyzed commit 88351a6 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 97.3% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.8% (0.0% change).

View more on Code Climate.

@mattseddon
Copy link
Member Author

Related to #1720

export const addStarredToColumns = (
columns: Column[] | undefined
): ColumnLike[] | undefined => {
if (!columns?.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't we have a lint rule where it said we have to compare length to 0?

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 think the optional chain will be messing with it. You would need to write
columns?.length === undefined || columns.length === 0

@mattseddon mattseddon enabled auto-merge (squash) August 10, 2022 22:41
@mattseddon mattseddon merged commit 49cf300 into main Aug 10, 2022
@mattseddon mattseddon deleted the filter-by-starred branch August 10, 2022 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants