Skip to content
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

Show hidden url search param in app.rerun.io #2455

Merged
merged 4 commits into from
Jun 16, 2023
Merged
Changes from 2 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
4 changes: 3 additions & 1 deletion web_viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@
const rrd_file = url_params.get('file') || 'colmap_fiat.rrd';

// Normalize the extra slashes from the url
return (data_path + rrd_file).replace(/\/{2,}/g, '/');
const normalized = (data_path + rrd_file).replace(/\/{2,}/g, '/');
window.location.search = new URLSearchParams({ url: normalized }).toString();
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to avoid URL-escaping here? This ends up looking like:

https://app.rerun.io/commit/4b3a728/index.html?url=%2Fdata%2Fcommit%2F4b3a728%2Fcolmap_fiat.rrd

which is a bit of an eye-sore.

Would be nice to end up with:

https://app.rerun.io/commit/4b3a728/index.html?url=/data/commit/4b3a728/colmap_fiat.rrd
https://app.rerun.io?url=/data/colmap_fiat.rrd

I think this might work?

url.search = decodeURIComponent(new URLSearchParams({ url: normalized }));

Copy link
Member Author

Choose a reason for hiding this comment

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

If we don't want it encoded, then we might as well just use string interpolation

Copy link
Member Author

Choose a reason for hiding this comment

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

image

return normalized;
}

function on_wasm_error(error) {
Expand Down