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 "Parents" Columns #4691

Merged
merged 13 commits into from
Sep 27, 2023
Merged

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Sep 19, 2023

main <= #4685 <= this

Demo

Screen.Recording.2023-09-26.at.12.12.39.PM.mov

Part of #4620

@julieg18 julieg18 added the product PR that affects product label Sep 19, 2023
@julieg18 julieg18 added this to In progress in VS Code Sep 12 via automation Sep 19, 2023
@julieg18 julieg18 self-assigned this Sep 19, 2023
@julieg18 julieg18 mentioned this pull request Sep 19, 2023
1 task
@julieg18 julieg18 added this to In progress in VS Code Sep 19 via automation Sep 20, 2023
@julieg18 julieg18 changed the title Add "Parents" Column Add "Parents" Columns Sep 21, 2023
export const COMMIT_COLUMN_ID = 'commit'
export const BRANCH_COLUMN_ID = 'branch'

export const DEFAULT_COLUMN_IDS = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added two more default columns (ids are commt and branch). These always stay in the order on the backend and appear on the frontend if the table is sorted. Similar to the id column, they are not draggable and can't be unselected.

@@ -108,7 +112,9 @@ export const ExperimentsTable: React.FC = () => {
toggleAllRowsExpanded()
}, [toggleAllRowsExpanded])

const hasOnlyDefaultColumns = columns.length <= 1
const hasOnlyDefaultColumns = columns.every(
({ id }) => id && isDefaultColumn(id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this to check for the column ids since there are now 1 or 3 default columns depending on if the table is sorted.

Copy link
Member

Choose a reason for hiding this comment

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

[Q] Does every return true if the array is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it does :)

@@ -25,7 +26,7 @@ import { vsCodeApi } from '../../shared/api'
import {
commonColumnFields,
expectHeaders,
tableData as sortingTableDataFixture
tableData as simplifiedSortedTableDataFixture
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed this to differentiate from the sortedTableDataFixture which has data based on the expShow data. I did consider replacing simplifiedSortedTableData with the backend one, but that would complicate multiple tests so I decided to keep it.

webview/src/experiments/components/App.test.tsx Outdated Show resolved Hide resolved
@@ -80,3 +84,8 @@ export const leafColumnIds = (

export const isExperimentColumn = (id: string): boolean =>
id === EXPERIMENT_COLUMN_ID

export const isDefaultColumn = (id: string) =>
Copy link
Member

Choose a reason for hiding this comment

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

[Q] Couldn't we just use DEFAULT_COLUMN_IDS instead of importing all of the individual IDs?

[Q] Won't the addition of these two columns break <WithExpColumnNeedsShadowUpdates>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

[Q] Couldn't we just use DEFAULT_COLUMN_IDS instead of importing all of the individual IDs?

Yes, thanks for catching that!

[Q] Won't the addition of these two columns break ?

Forgot to mention this in a review comment, For now, the columns aren't sticky:

Screen.Recording.2023-09-27.at.6.53.38.AM.mov

I wanted to save it for a follow-up since I was having some difficulty making three columns sticky and have the experiment column conditionally have a shadow.

webview/src/experiments/components/table/header/util.ts Outdated Show resolved Hide resolved
webview/src/experiments/components/App.test.tsx Outdated Show resolved Hide resolved
@@ -108,7 +112,9 @@ export const ExperimentsTable: React.FC = () => {
toggleAllRowsExpanded()
}, [toggleAllRowsExpanded])

const hasOnlyDefaultColumns = columns.length <= 1
const hasOnlyDefaultColumns = columns.every(
({ id }) => id && isDefaultColumn(id)
Copy link
Member

Choose a reason for hiding this comment

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

[Q] Does every return true if the array is empty?

* rename variables
* reuse header
@julieg18 julieg18 merged commit d2ded95 into flatten-table-on-sort Sep 27, 2023
4 of 5 checks passed
VS Code Sep 19 automation moved this from In progress to Done Sep 27, 2023
@julieg18 julieg18 deleted the add-flattened-table-column branch September 27, 2023 16:23
@julieg18 julieg18 mentioned this pull request Oct 2, 2023
2 tasks
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
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants