Skip to content
Merged
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
11 changes: 9 additions & 2 deletions docs/source/_static/css/environment-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,13 @@
const previewImageBaseUrl = "https://download.isaacsim.omniverse.nvidia.com/isaaclab/images/";
const failedPreviewVideos = new Set();

const previewImageUrl = (task) => {
const imagePath = previewImageFor(task);
return imagePath.startsWith("tasks/")
? new URL(imagePath, previewImageBaseUrl).href
: new URL(`../../_static/${imagePath}`, window.location.href).href;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Local preview drops version

On the deployed multi-version site, this page is served from <version>/setup/environments.html. Resolving ../../_static/${imagePath} removes the version segment and requests the image from the site-root _static directory, while static assets are published inside each version directory. Non-task previews such as Lift-Soft-Franka will therefore return 404; resolve the path relative to the current version root instead.

Suggested change
: new URL(`../../_static/${imagePath}`, window.location.href).href;
: new URL(`../_static/${imagePath}`, window.location.href).href;

};

const updateTaskControls = () => {
const task = selectedTask();
populateSelect(fields.rl, task.rl, [fields.rl.value, "rsl_rl", "rl_games", "skrl", "sb3"]);
Expand Down Expand Up @@ -466,7 +473,7 @@
const videoUrl = videoName
? new URL(`../../_static/tasks/previews/${videoName}`, window.location.href).href
: undefined;
previewImage.src = new URL(previewImageFor(selectedTask()), previewImageBaseUrl).href;
previewImage.src = previewImageUrl(selectedTask());
previewImage.alt = `${state.task} preview`;
if (videoUrl && !failedPreviewVideos.has(videoUrl)) {
previewVideo.onerror = () => {
Expand Down Expand Up @@ -573,7 +580,7 @@
const refreshCard = () => {
const activeTask = variants.find((task) => task.task === state.task) || variants[0];
const isSelected = variants.includes(activeTask) && activeTask.task === state.task;
image.src = new URL(`../../_static/${previewImageFor(activeTask)}`, window.location.href).href;
image.src = previewImageUrl(activeTask);
image.alt = "";
selectButton.dataset.taskName = activeTask.task;
selectButton.setAttribute("aria-pressed", String(isSelected));
Expand Down
Loading