Skip to content

Fix issue loading tasks as starting page#2352

Merged
myieye merged 4 commits into
developfrom
fix-crash-loading-tasks-view-at-startup
Jun 12, 2026
Merged

Fix issue loading tasks as starting page#2352
myieye merged 4 commits into
developfrom
fix-crash-loading-tasks-view-at-startup

Conversation

@hahn-kev

Copy link
Copy Markdown
Collaborator

On my phone the tasks page is cached as the starting page and there's a JS error because the project is not ready. This caused me to be stuck on the page. I fixed the root cause and provided a failsafe.

#2316 provided one failsafe. This PR provides another using a svelte:boundary to catch render errors and provide a way to try again or close the project or open the sidebar.

Forcing an error to happen when rendering the tasks view looks like this:
image

it's a little weird to have the sidebar toggle twice, but it doesn't hurt. The new error handler is also used on the Browse View, but I didn't force an error to test that version.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Jun 12, 2026
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 09548682-e647-480c-b640-4d544c11eb1a

📥 Commits

Reviewing files that changed from the base of the PR and between 78e3f97 and 3bb0d26.

📒 Files selected for processing (13)
  • frontend/viewer/src/lib/errors/global-errors.ts
  • frontend/viewer/src/lib/layout/ViewErrorBoundary.svelte
  • frontend/viewer/src/locales/en.po
  • frontend/viewer/src/locales/es.po
  • frontend/viewer/src/locales/fr.po
  • frontend/viewer/src/locales/id.po
  • frontend/viewer/src/locales/ko.po
  • frontend/viewer/src/locales/ms.po
  • frontend/viewer/src/locales/sw.po
  • frontend/viewer/src/locales/vi.po
  • frontend/viewer/src/project/browse/BrowseView.svelte
  • frontend/viewer/src/project/tasks/TaskView.svelte
  • frontend/viewer/src/project/tasks/TasksView.svelte

📝 Walkthrough

Walkthrough

This PR introduces a structured error boundary system across the viewer frontend. The error handler now accepts plain Error objects alongside browser events, a new ViewErrorBoundary component provides error fallback UI with localized messages and recovery actions, and the component is integrated into browse and task views. A conditional rendering fix in TaskView prevents UI interaction when the API is unavailable.

Changes

Error Boundary System

Layer / File(s) Summary
Error handler contract and unification
frontend/viewer/src/lib/errors/global-errors.ts
unifyErrorEvent handles plain Error objects, and onErrorEvent is exported with a widened type signature to accept ErrorEvent, PromiseRejectionEvent, or Error.
ViewErrorBoundary component
frontend/viewer/src/lib/layout/ViewErrorBoundary.svelte
New Svelte component with typed props (children, optional title, optional class), error normalization via onError, and a <svelte:boundary> wrapper that renders localized destructive alert fallback with retry and home-navigation buttons.
Localization for error UI
frontend/viewer/src/locales/{en,es,fr,id,ko,ms,sw,vi}.po
Error message strings ("Browse view failed", "Task view failed", "Something went wrong", "Try again") added to all eight locale files; English translations provided, non-English entries await translation.
View integration
frontend/viewer/src/project/browse/BrowseView.svelte, frontend/viewer/src/project/tasks/TasksView.svelte
BrowseView and TasksView wrap main content in ViewErrorBoundary with localized error titles, catching errors during browse and task interactions.
TaskView conditional popup rendering
frontend/viewer/src/project/tasks/TaskView.svelte
SubjectPopup is conditionally rendered only when projectContext.maybeApi is available, preventing interactions when API is unavailable.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • myieye
  • rmunn

Poem

🐰 Boundaries catch what slips away,
Errors now have something to say,
ViewErrorBoundary saves the day—
With reset buttons and "try again," hooray!
Your views won't crash without a fray. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix issue loading tasks as starting page' directly relates to the PR's main objective of fixing a crash when the tasks page loads as the starting page, which is clearly addressed throughout the changeset.
Description check ✅ Passed The description clearly explains the problem (tasks page cached as starting page causing JS error) and the solution implemented (root cause fix plus failsafe using svelte:boundary), which aligns with the actual changes in the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-crash-loading-tasks-view-at-startup

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.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

UI unit Tests

 1 files  ±  0   3 suites   - 59   0s ⏱️ -32s
10 tests  - 176  10 ✅  - 176  0 💤 ±0  0 ❌ ±0 
10 runs   - 248  10 ✅  - 248  0 💤 ±0  0 ❌ ±0 

Results for commit 3bb0d26. ± Comparison against base commit 78e3f97.

This pull request removes 186 and adds 10 tests. Note that renamed tests count towards both.
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > accepts parent values when not dirty
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > does NOT guard against stomping deep changes, because StompGuard can't detect them
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > ignores parent values when dirty
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > initializes with the parent value
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > keeps subscribers up to date when it becomes dirty
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > pushs changes to parent
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > reverts new parent values when ignored
src/lib/components/stomp/stomp-guard.svelte.test.ts ‑ StompGuard > starts accepting parent changes again after a flush
src/lib/components/ui/format/format-duration.test.ts ‑ formatDuration > formats durations
src/lib/components/ui/format/format-duration.test.ts ‑ formatDuration > formats durations with smallest unit
…
src/index.test.ts ‑ password hashing > can hash a pw using sha1
src/lib/i18n/i18n.test.ts ‑ buildRegionalLocaleRegex > should find all regional locales for available locales
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return en by default
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return en if no user locale is provided and acceptLanguageHeader does not have any supported locales
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return regional locale from acceptLanguageHeader if it has a higher quality rating than the regionless locale
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return supported locale from acceptLanguageHeader with highest quality rating if no user locale is provided
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return user locale if acceptLanguageHeader does not provide a regional/more specific locale
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return user locale if acceptLanguageHeader does not provide a regional/more specific locale with a higher quality rating
src/lib/i18n/i18n.test.ts ‑ pickBestLocale > should return user locale if acceptLanguageHeader is not provided
src/lib/user.test.ts ‑ jwtToUser > should convert a jwt token to a LexAuthUser

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

C# Unit Tests

165 tests  ±0   165 ✅ ±0   21s ⏱️ -1s
 23 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit dbace67. ± Comparison against base commit 78e3f97.

♻️ This comment has been updated with latest results.

@argos-ci

argos-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jun 12, 2026, 11:51 AM

so stack trace is shown and copy/pastable
@myieye

myieye commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

I just made it even uglier 😉, by showing an error toast so stack traces are still there and can be copy/pasted:

image

@myieye myieye merged commit 5e415f1 into develop Jun 12, 2026
14 of 15 checks passed
@myieye myieye deleted the fix-crash-loading-tasks-view-at-startup branch June 12, 2026 11:50
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