From 801c64a6b865251e6ddfad9da11f9dd264e167e9 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 22 Jun 2021 12:22:47 -0700 Subject: [PATCH] Comments/notes. --- components/RunCard.renderPathCell.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/RunCard.renderPathCell.tsx b/components/RunCard.renderPathCell.tsx index 963742d..5457310 100644 --- a/components/RunCard.renderPathCell.tsx +++ b/components/RunCard.renderPathCell.tsx @@ -62,6 +62,9 @@ function getRepoUri(uri: string | undefined, uriBaseId: string | undefined, repo return `${repoUriBase}?path=${encodeURIComponent(uri)}` } +// TODO: +// Unify runArt vs resultArt. +// Distinguish uri and text. export function renderPathCell(result: Result) { const ploc = result.locations?.[0]?.physicalLocation const resArtLoc @@ -70,7 +73,7 @@ export function renderPathCell(result: Result) { const runArt = result.run.artifacts?.[resArtLoc?.index ?? -1] const runArtLoc = runArt?.location const uri - = resArtLoc?.description?.text + = resArtLoc?.description?.text ?? runArtLoc?.description?.text // vs runArt?.description?.text? ?? resArtLoc?.uri ?? runArtLoc?.uri // Commonly a relative URI. @@ -82,7 +85,7 @@ export function renderPathCell(result: Result) { ? [uri.slice(0, index), uri.slice(index + 1)] : [uri] })() - const uriWithEllipsis = fileName + const uriWithEllipsis = fileName // This is what ultimately gets displayed ? {path} /{fileName} @@ -111,7 +114,7 @@ export function renderPathCell(result: Result) { if (!runArtContentsText) return event.preventDefault() event.stopPropagation() - openInNewTab(fileName, runArtContentsText, region) + openInNewTab(fileName, runArtContentsText, region) // BUG: if uri is "aaa", then fileName will be empty } const rowClasses = 'bolt-table-two-line-cell-item flex-row scroll-hidden'