Skip to content

Commit 9d9d430

Browse files
committed
Parallelism UI improvements -- see #427
1. Displays sub-applications inline 2. Adds additional tooling on hierarchy of traces 3. A few other miscellaneous fixes around highlighting/table spacing Note that we change from having the sequence ID in the URL to having the point in the highlighted state in the URL. This allows us to have multiple applications at once. The code can be a little messy, and there are a few more places we should probably have this distinction made, but for now this really improves the experience with parallelism
1 parent e448beb commit 9d9d430

File tree

7 files changed

+791
-257
lines changed

7 files changed

+791
-257
lines changed

telemetry/ui/src/components/routes/AppList.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ export const AppListTable = (props: { apps: ApplicationSummary[]; projectId: str
205205
}, new Map<string, ApplicationSummary[]>());
206206

207207
// Display the parents no matter what
208-
const rootAppsToDisplay = appsToDisplay.filter((app) => app.spawning_parent_pointer === null);
208+
// const rootAppsToDisplay = appsToDisplay.filter((app) => app.spawning_parent_pointer === null);
209+
const rootAppsToDisplay = appsToDisplay;
209210
const anyHavePartitionKey = rootAppsToDisplay.some(
210211
(app) => !isNullPartitionKey(app.partition_key)
211212
);
@@ -261,7 +262,7 @@ export const AppListTable = (props: { apps: ApplicationSummary[]; projectId: str
261262
</TableRow>
262263
</TableHead>
263264
<TableBody>
264-
{rootAppsToDisplay.map((app) => {
265+
{appsToDisplay.map((app) => {
265266
return (
266267
<AppSubList
267268
key={app.app_id}

telemetry/ui/src/components/routes/app/AnnotationsView.tsx

+29-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import CreatableSelect from 'react-select/creatable';
1515
import { FaClipboardList, FaExternalLinkAlt, FaThumbsDown, FaThumbsUp } from 'react-icons/fa';
1616
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../common/table';
1717
import { Chip } from '../../common/chip';
18-
import { Link, useParams } from 'react-router-dom';
18+
import { Link } from 'react-router-dom';
1919
import { useMutation, useQuery } from 'react-query';
2020
import { Loading } from '../../common/loading';
2121
import {
@@ -28,6 +28,7 @@ import {
2828
import { classNames } from '../../../utils/tailwind';
2929
import { DateTimeDisplay } from '../../common/dates';
3030
import { Drawer } from '../../common/drawer';
31+
import { useLocationParams } from '../../../utils';
3132

3233
export const InlineAppView = (props: {
3334
projectId: string;
@@ -47,7 +48,11 @@ export const InlineAppView = (props: {
4748
allowAnnotations={false}
4849
restrictTabs={['data', 'code', 'reproduce', 'insights', 'graph']}
4950
disableNavigateSteps={false}
50-
forceCurrentActionIndex={props.sequenceID}
51+
forceCurrentActionIndex={{
52+
sequenceId: props.sequenceID,
53+
appId: props.appId,
54+
partitionKey: props.partitionKey
55+
}}
5156
partitionKey={props.partitionKey}
5257
forceFullScreen={true}
5358
/>
@@ -95,7 +100,6 @@ export const AnnotationsView = (props: {
95100
setCurrentEditingAnnotationContext,
96101
setCurrentHoverIndex,
97102
setCurrentSelectedIndex,
98-
currentSelectedIndex,
99103
createAnnotation,
100104
updateAnnotation,
101105
refreshAnnotationData
@@ -170,14 +174,24 @@ export const AnnotationsView = (props: {
170174
annotations={props.allAnnotations}
171175
onClick={(annotation) => {
172176
// TODO -- ensure that the indices are aligned/set correctly
173-
setCurrentSelectedIndex(annotation.step_sequence_id);
177+
setCurrentSelectedIndex({
178+
sequenceId: annotation.step_sequence_id,
179+
appId: props.appId,
180+
partitionKey: props.partitionKey
181+
});
174182
}}
175183
onHover={(annotation) => {
176-
setCurrentHoverIndex(annotation.step_sequence_id);
184+
setCurrentHoverIndex({
185+
sequenceId: annotation.step_sequence_id,
186+
appId: props.appId,
187+
partitionKey: props.partitionKey
188+
});
177189
}}
178190
displayProjectLevelAnnotationsLink={true} // we want to link back to the project level view
179191
projectId={props.projectId}
180-
highlightedSequence={currentSelectedIndex}
192+
highlightedSequence={
193+
currentEditingAnnotationContext ? currentEditingAnnotationContext.sequenceId : undefined
194+
}
181195
/>
182196
</div>
183197
);
@@ -717,6 +731,8 @@ export const AnnotationsTable = (props: {
717731
{props.allowInlineEdit && (
718732
<TableCell className="align-top">
719733
<AnnotateButton
734+
appID={annotation.app_id}
735+
partitionKey={annotation.partition_key}
720736
sequenceID={annotation.step_sequence_id}
721737
spanID={annotation.span_id || undefined}
722738
existingAnnotation={annotation}
@@ -964,12 +980,16 @@ const ObservationForm = (props: {
964980
type AnnnotationDataPointerWithValue = AnnotationDataPointer & { value: string };
965981

966982
export const AnnotateButton = (props: {
983+
appID: string;
984+
partitionKey: string | null;
967985
sequenceID: number;
968986
spanID?: string;
969987
attribute?: string; // TODO -- consider whether we want to remove, we generally annotate at the step level
970988
// But we might want to prepopulate the attribute if we are annotating a specific attribute (in the observations field)
971989
existingAnnotation: AnnotationOut | undefined;
972990
setCurrentEditingAnnotationContext: (context: {
991+
appId: string;
992+
partitionKey: string | null;
973993
sequenceId: number;
974994
attributeName: string | undefined;
975995
spanId: string | null;
@@ -983,6 +1003,8 @@ export const AnnotateButton = (props: {
9831003
className="hover:scale-125 h-4 w-4"
9841004
onClick={(e) => {
9851005
props.setCurrentEditingAnnotationContext({
1006+
appId: props.appID,
1007+
partitionKey: props.partitionKey,
9861008
sequenceId: props.sequenceID,
9871009
attributeName: props.attribute,
9881010
spanId: props.spanID || null,
@@ -1187,7 +1209,7 @@ const AnnotationEditCreateForm = (props: {
11871209
* @returns
11881210
*/
11891211
export const AnnotationsViewContainer = () => {
1190-
const { projectId } = useParams();
1212+
const { projectId } = useLocationParams();
11911213
const { data: backendSpec } = useQuery(['backendSpec'], () =>
11921214
DefaultService.getAppSpecApiV0MetadataAppSpecGet().then((response) => {
11931215
return response;

0 commit comments

Comments
 (0)