Skip to content

Commit

Permalink
Merge pull request #4416 from bruntib/too_long_filenames
Browse files Browse the repository at this point in the history
[gui] Display full filename
  • Loading branch information
bruntib authored Jan 23, 2025
2 parents d6d4424 + 6b20ba1 commit 3386978
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,8 @@ function formatReportEvents(report, events) {
const isResult = index === events.length - 1;

let fileName = null;
let shortFileName = null;
if (showFileName) {
fileName = step.filePath.replace(/^.*(\\|\/|:)/, "");

shortFileName = fileName;
if (shortFileName.length > 12) {
const extensionParts = shortFileName.split(".");
const fnWithoutExt =
extensionParts.slice(0, extensionParts.length).join(".");
const extension = (extensionParts.length > 1
? "." + extensionParts[extensionParts.length - 1]
: "");
shortFileName = fnWithoutExt.substr(0, 8) + "..." + extension;
}
}

const highlightData = getHighlightData(highlightStack, step);
Expand All @@ -229,8 +217,7 @@ function formatReportEvents(report, events) {
reportStepIcon: reportStepIcon,
bgColor: highlightData.bgColor,
level: indentation,
fileName: fileName,
shortFileName: shortFileName
fileName: fileName
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
[{{ item.report.bugPathLength }}]
</span>

<span v-else-if="item.kind === ReportTreeKind.REPORT_STEPS">
{{ fileName }}{{ item.step.startLine }} &ndash; {{ item.step.msg }}
<span
v-else-if="item.kind === ReportTreeKind.REPORT_STEPS"
:title="reportStepContent"
>
{{ reportStepContent }}
</span>

<span v-else-if="item.kind === ReportTreeKind.BUG">
Expand All @@ -21,7 +24,7 @@
L{{ item.data.startLine }} &ndash; {{ item.name }}
</span>
<span v-else-if="item.kind === ReportTreeKind.SEVERITY_LEVEL">
{{ item.name }}
{{ item.name }}
<span v-if="newReportCount" style="color: #ec7672;">
{{ newReportCountLabel }}
</span>
Expand Down Expand Up @@ -51,8 +54,13 @@ export default {
};
},
computed: {
reportStepContent() {
return `${this.fileName}${this.item.step.startLine} ` +
`- ${this.item.step.msg}`;
},
fileName() {
return this.item.shortFileName ? `${this.item.shortFileName}:` : "L";
return this.item.fileName ? `${this.item.fileName}:` : "L";
},
isExtendedReportData() {
Expand Down

0 comments on commit 3386978

Please sign in to comment.