-
Notifications
You must be signed in to change notification settings - Fork 146
Workflows Table Row Density #3285
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
Changes from 4 commits
873b891
7d3bcf2
2d185ae
eb80116
3e3df40
02595b2
105732d
ffb8faf
ccb427e
3638466
873e969
ad9b314
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 |
|---|---|---|
|
|
@@ -4,12 +4,14 @@ | |
| import Timestamp from '$lib/components/timestamp.svelte'; | ||
| import WorkflowStatus from '$lib/components/workflow-status.svelte'; | ||
| import Badge from '$lib/holocene/badge.svelte'; | ||
| import Tooltip from '$lib/holocene/tooltip.svelte'; | ||
| import type { ConfigurableTableHeader } from '$lib/stores/configurable-table-columns'; | ||
| import { | ||
| customSearchAttributes, | ||
| isCustomSearchAttribute, | ||
| workflowIncludesSearchAttribute, | ||
| } from '$lib/stores/search-attributes'; | ||
| import { tableDensity } from '$lib/stores/table-density'; | ||
| import { | ||
| SEARCH_ATTRIBUTE_TYPE, | ||
| type WorkflowExecution, | ||
|
|
@@ -22,6 +24,7 @@ | |
| routeForWorkerDeployment, | ||
| routeForWorkflow, | ||
| } from '$lib/utilities/route-for'; | ||
| import { truncateValue } from '$lib/utilities/truncate-value'; | ||
| import { isWorkflowTaskFailure } from '$lib/utilities/workflow-task-failures'; | ||
|
|
||
| import FilterableTableCell from './filterable-table-cell.svelte'; | ||
|
|
@@ -32,6 +35,7 @@ | |
| archival?: boolean; | ||
| }; | ||
| let { column, workflow, archival = false }: Props = $props(); | ||
| let truncate = $derived($tableDensity === 'compact'); | ||
|
Alex-Tideman marked this conversation as resolved.
Outdated
|
||
|
|
||
| const { label } = $derived(column); | ||
| const namespace = $derived(page.params.namespace); | ||
|
|
@@ -69,7 +73,8 @@ | |
|
|
||
| {#if filterableLabels.includes(label) || isCustomKeywordOrTextAttribute} | ||
| <td | ||
| class="workflows-summary-table-body-cell filterable" | ||
| class="workflows-summary-table-body-cell" | ||
| class:filterable={!truncate} | ||
|
Collaborator
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.
Collaborator
Author
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. Yeah was thinking about this, but if you don't have many columns, you aren't going to use Dense mode. I don't want to add a bunch of complexity here when its not really the point of the mode to use when you just have a couple of columns. |
||
| data-testid="workflows-summary-table-body-cell" | ||
| onmouseover={showFilterOrCopy} | ||
| onfocus={showFilterOrCopy} | ||
|
|
@@ -89,6 +94,7 @@ | |
| run: workflow.runId, | ||
| archival, | ||
| })} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Workflow ID'} | ||
| <FilterableTableCell | ||
|
|
@@ -101,6 +107,7 @@ | |
| run: workflow.runId, | ||
| archival, | ||
| })} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Run ID'} | ||
| <FilterableTableCell | ||
|
|
@@ -113,6 +120,7 @@ | |
| run: workflow.runId, | ||
| archival, | ||
| })} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Deployment'} | ||
| {@const deployment = | ||
|
|
@@ -127,6 +135,7 @@ | |
| deployment, | ||
| }) | ||
| : undefined} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Deployment Version'} | ||
| {@const version = | ||
|
|
@@ -136,6 +145,7 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalWorkerDeploymentVersion" | ||
| value={version && typeof version === 'string' ? version : ''} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Build ID'} | ||
| {@const buildId = | ||
|
|
@@ -148,6 +158,7 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalWorkerBuildId" | ||
| value={buildId && typeof buildId === 'string' ? buildId : ''} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Versioning Behavior'} | ||
| {@const behavior = | ||
|
|
@@ -157,6 +168,7 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalWorkflowVersioningBehavior" | ||
| value={behavior && typeof behavior === 'string' ? behavior : ''} | ||
| {truncate} | ||
| /> | ||
| {:else if isCustomKeywordOrTextAttribute} | ||
| {@const content = workflow.searchAttributes?.indexedFields?.[label]} | ||
|
|
@@ -165,6 +177,7 @@ | |
| attribute={label} | ||
|
Contributor
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.
|
||
| value={content} | ||
| type={$customSearchAttributes[label]} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Scheduled By ID'} | ||
| {@const scheduleId = | ||
|
|
@@ -173,13 +186,16 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalScheduledById" | ||
| value={scheduleId && typeof scheduleId === 'string' ? scheduleId : ''} | ||
| {truncate} | ||
| /> | ||
| {/if} | ||
| </td> | ||
| {:else} | ||
| <td | ||
| class="workflows-summary-table-body-cell" | ||
| data-testid="workflows-summary-table-body-cell" | ||
| class:comfy={!truncate} | ||
| class:dense={truncate} | ||
|
Alex-Tideman marked this conversation as resolved.
Outdated
|
||
| > | ||
| {#if label === 'Status'} | ||
| <WorkflowStatus | ||
|
|
@@ -188,9 +204,15 @@ | |
| taskFailure={isWorkflowTaskFailure(workflow)} | ||
| /> | ||
| {:else if label === 'End'} | ||
| <Timestamp dateTime={workflow.endTime} /> | ||
| <Timestamp | ||
| dateTime={workflow.endTime} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if label === 'Start'} | ||
| <Timestamp dateTime={workflow.startTime} /> | ||
| <Timestamp | ||
| dateTime={workflow.startTime} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if label === 'Task Queue'} | ||
| {workflow.taskQueue} | ||
| {:else if label === 'Parent Namespace'} | ||
|
|
@@ -202,7 +224,10 @@ | |
| ? workflow.stateTransitionCount | ||
| : ''} | ||
| {:else if label === 'Execution Time'} | ||
| <Timestamp dateTime={workflow.executionTime} /> | ||
| <Timestamp | ||
| dateTime={workflow.executionTime} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if label === 'Execution Duration'} | ||
| {formatDistance({ | ||
| start: workflow.startTime, | ||
|
|
@@ -217,18 +242,26 @@ | |
| {@const content = | ||
| workflow.searchAttributes?.indexedFields?.TemporalScheduledStartTime} | ||
| {#if content && typeof content === 'string'} | ||
| <Timestamp dateTime={content} /> | ||
| <Timestamp | ||
| dateTime={content} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {/if} | ||
| {:else if label === 'Change Version'} | ||
| {workflow.searchAttributes?.indexedFields?.TemporalChangeVersion} | ||
| {:else if isCustomSearchAttribute(label) && workflowIncludesSearchAttribute(workflow, label)} | ||
| {@const content = workflow.searchAttributes?.indexedFields?.[label]} | ||
| {#if $customSearchAttributes[label] === SEARCH_ATTRIBUTE_TYPE.DATETIME && typeof content === 'string'} | ||
| <Timestamp dateTime={content} /> | ||
| <Timestamp | ||
| dateTime={content} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if $customSearchAttributes[label] === SEARCH_ATTRIBUTE_TYPE.BOOL} | ||
| <Badge>{content}</Badge> | ||
| {:else} | ||
| {content} | ||
| <Tooltip text={content} top class="min-w-0" hide={!truncate}> | ||
| {truncate ? truncateValue(content) : content} | ||
| </Tooltip> | ||
| {/if} | ||
| {/if} | ||
| </td> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| type BatchOperationContext, | ||
| } from '$lib/pages/workflows-with-new-search.svelte'; | ||
| import { supportsBulkActions } from '$lib/stores/bulk-actions'; | ||
| import { tableDensity } from '$lib/stores/table-density'; | ||
| import type { WorkflowExecution } from '$lib/types/workflows'; | ||
| import { workflowCreateDisabled } from '$lib/utilities/workflow-create-disabled'; | ||
|
|
||
|
|
@@ -71,6 +72,7 @@ | |
| workflowId={workflow.id} | ||
|
Contributor
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.
|
||
| taskQueue={workflow.taskQueue} | ||
|
Contributor
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.
|
||
| workflowType={workflow.name} | ||
| class={$tableDensity === 'compact' ? 'mt-1 h-5 w-5' : ''} | ||
| /> | ||
| {/if} | ||
| <IsTemporalServerVersionGuard minimumVersion="1.23.0"> | ||
|
|
@@ -79,6 +81,7 @@ | |
| size="xs" | ||
| variant={childrenShown ? 'primary' : 'ghost'} | ||
| on:click={() => viewChildren(workflow)} | ||
| class={$tableDensity === 'compact' ? 'mt-1 h-5 w-5' : ''} | ||
| > | ||
| <Tooltip | ||
| text={childrenShown | ||
|
Contributor
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.
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <script lang="ts"> | ||
| import Svg from '../svg.svelte'; | ||
| let props = $props(); | ||
| </script> | ||
|
|
||
| <Svg {...props}> | ||
| <path | ||
| stroke="currentcolor" | ||
| stroke-width="2" | ||
| d="M3 22H21C21.5523 22 22 21.5523 22 21V3C22 2.44772 21.5523 2 21 2H3C2.44772 2 2 2.44772 2 3V21C2 21.5523 2.44772 22 3 22Z" | ||
| ></path> | ||
| <path stroke="currentcolor" stroke-width="2" d="M22 8.75L2 8.75"></path> | ||
| <path stroke="currentcolor" stroke-width="2" d="M22 15.25L2 15.25"></path> | ||
| </Svg> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <script lang="ts"> | ||
| import Svg from '../svg.svelte'; | ||
| let props = $props(); | ||
| </script> | ||
|
|
||
| <Svg {...props}> | ||
| <path | ||
| stroke="currentcolor" | ||
| stroke-width="2" | ||
| d="M3 22H21C21.5523 22 22 21.5523 22 21V3C22 2.44772 21.5523 2 21 2H3C2.44772 2 2 2.44772 2 3V21C2 21.5523 2.44772 22 3 22Z" | ||
| ></path> | ||
| <path stroke="currentcolor" stroke-width="2" d="M22 6L2 6"></path> | ||
| <path stroke="currentcolor" stroke-width="2" d="M22 10L2 10"></path> | ||
| <path stroke="currentcolor" stroke-width="2" d="M22 14L2 14"></path> | ||
| <path stroke="currentcolor" stroke-width="2" d="M22 18L2 18"></path> | ||
| </Svg> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { persistStore } from './persist-store'; | ||
|
|
||
| type TableDensity = 'compact' | 'comfortable'; | ||
| export const tableDensity = persistStore<TableDensity>( | ||
| 'tableDensity', | ||
| 'comfortable', | ||
| 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.