Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion site/frontend/src/pages/detailed-query/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,12 @@ async function loadData() {
// To maintain backwards compatibility of URLs, parse the profile from the
// benchmark URL parameter
// We turn <benchmark>-<profile> into two separate parameters for the backend
const parts = benchmark.split("-");
let parts: string[];
if (benchmark.endsWith("-doc-json")) {

@JonathanBrouwer JonathanBrouwer Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not happy with this code, but not experienced enough in TS to know if there's a better way

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems weird to use - on a string, but it's JavaScript, so I had to check what that does 😆 Probably a typo? The code doesn't seem to work though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe something like this? To keep it fully general:

[...a.slice(0, -"-doc-json".length).split("-"), "doc-json"]

parts = [benchmark.slice(0, -"-doc-json"), "doc-json"];
} else {
parts = benchmark.split("-");
}
const profile = parts[parts.length - 1];
const benchmarkSeparate = parts.slice(0, parts.length - 1).join("-");

Expand Down
Loading