Skip to content

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Oct 6, 2025

If assets fail to load then there's just a white page.
Initially I just added this in dev mode, but why not make errors more visible in prod too?

This improvement has been in my stashes for a long time.

@github-actions github-actions bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Oct 6, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 6, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Implements conditional asset loading with try-catch in SvelteLayout.razor, adds a nullable string field for errors, renders the error in the UI, and differentiates import behavior for development vs. prebuilt assets. On failure, sets a contextual error message, triggers StateHasChanged, and rethrows.

Changes

Cohort / File(s) Summary of changes
Svelte layout error handling and asset loading
backend/FwLite/FwLiteShared/Layout/SvelteLayout.razor
Added error field and UI rendering of @error; refactored asset import into try-catch with conditional dev vs. prebuilt paths; on exception, set contextual error message, call StateHasChanged, and rethrow; removed previous unconditional import path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit peeked at scripts that load,
Hopped left for dev, right for prod mode.
If imports trip—don’t fear the night—
It sets a note, then brings it to light.
With whiskers twitching, errors shown,
The burrow’s UI feels neatly sewn. 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary functionality added in the pull request by highlighting the error display for failed JavaScript asset loading, making it clear and specific enough for teammates to understand the main change at a glance.
Description Check ✅ Passed The pull request description clearly explains the motivation for adding visible error messages when asset loading fails and directly relates to the changes implemented, avoiding any off-topic information.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@argos-ci
Copy link

argos-ci bot commented Oct 6, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 8, 2025, 1:11 PM

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

UI unit Tests

  1 files   45 suites   29s ⏱️
111 tests 111 ✅ 0 💤 0 ❌
160 runs  160 ✅ 0 💤 0 ❌

Results for commit 2e00b08.

♻️ This comment has been updated with latest results.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef484ee and f62831e.

📒 Files selected for processing (1)
  • backend/FwLite/FwLiteShared/Layout/SvelteLayout.razor (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: frontend
  • GitHub Check: Build FW Lite and run tests
🔇 Additional comments (2)
backend/FwLite/FwLiteShared/Layout/SvelteLayout.razor (2)

39-39: LGTM! Error field and rendering setup looks good.

The nullable error field and its rendering in the UI are appropriate for displaying asset loading failures.

Also applies to: 46-46


76-84: LGTM! Conditional asset loading logic is correct.

The branching between development and production asset imports is properly implemented with appropriate paths for each environment.

@myieye myieye force-pushed the show-asset-fail-error-message branch from f62831e to 2e00b08 Compare October 8, 2025 13:08
@myieye myieye merged commit edaed4d into develop Oct 8, 2025
12 checks passed
@myieye myieye deleted the show-asset-fail-error-message branch October 8, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants