Skip to content

fix(web): Recover frontend startup failures - #824

Merged
tbphp merged 2 commits into
mainfrom
tbphp/fix-startup-home-recovery
Oct 5, 2026
Merged

tbphp merged 2 commits into
mainfrom
tbphp/fix-startup-home-recovery

Conversation

@tbphp

@tbphp tbphp commented Oct 5, 2026

Copy link
Copy Markdown
Owner

关联 Issue / Related Issue

None.

变更内容 / Change Content

  • Bug 修复 / Bug fix
  • 新功能 / New feature
  • 其他改动 / Other changes

An initial page-component load failure previously stopped startup at an unstyled error message and required a manual refresh. Recover the modern router to Home before mounting, and load Home and Login with the modern bootstrap so that recovery can use them directly.

The shared entry attempts one full-page recovery at Home when either interface fails to start. If startup still fails, it shows a localized recovery card with a manual reload action instead of leaving a blank page. The card's styles load with the entry and are scoped to its container. Session-storage failures use the current path to prevent reload loops; manual retry resets the recovery attempt.

Validation:

  • make check passed, including lint, formatting, type checks, production build, Go build and Go tests.
  • The requester manually confirmed that blocking GroupsView and refreshing /groups recovers to Home.
  • Repeated-entry-failure handling was reviewed in code; no automated frontend or browser tests were run, following repository policy.

Compatibility: this changes startup recovery only. Home and Login code loads earlier within the modern interface. Classic page routing, authentication contracts and database schemas remain unchanged.

自查清单 / Checklist

  • 我已运行 make check,或在说明中写明无法运行的原因和未验证范围。 / I ran make check, or documented why it could not run and what remains unverified.
  • 本 PR 范围聚焦,未包含无关改动。 / This PR is focused and contains no unrelated changes.
  • 我已更新必要的公开文档或发布说明。 / I updated any required public documentation or release notes.
  • 我已确认提交、日志和测试数据不包含敏感信息。 / I confirmed that commits, logs, and fixtures contain no sensitive data.
  • 如适用,我已说明兼容性或数据迁移影响。 / Where applicable, I documented compatibility or data-migration impact.

No public documentation changes are required for this fix.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 01:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tbphp tbphp self-assigned this Oct 5, 2026
@tbphp tbphp added the bug Something isn't working label Oct 5, 2026
@tbphp tbphp added this to the v2.0.0 milestone Oct 5, 2026
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 00af639d-f483-44ad-8496-720905835c7b
📥 Commits

Reviewing files that changed from the base of the PR and between 49d1bf6 and 1252577.

📒 Files selected for processing (4)
  • web/src/frontends/modern/bootstrap.ts
  • web/src/frontends/modern/router.ts
  • web/src/main.ts
  • web/src/startup-recovery.css

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

路由初始化失败时,应用会记录错误、导航到 modern-home,然后继续挂载。登录页和首页改为静态导入。启动成功后会清除会话恢复标记;启动失败时会检查该标记,并跳转主页或显示本地化恢复界面。新增恢复界面的样式和焦点状态。

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 12525

The reviewed startup recovery paths have no identified merge-blocking issue. Merge after normal checks.

Architecture Summary

Architecture risk: 🟡 Medium · up to 12525

The change affects 1 system.

Changed systems: web

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — web (service) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in web/src/frontends/modern/bootstrap.ts: bootstrap 不再让初始路由就绪失败直接向外传播;失败时记录错误并导航到 modern-home,之后继续挂载应用。
  • observed — Modified behavior in web/src/frontends/modern/router.ts: 新增 LoginView 和 HomeView 的静态导入。
  • observed — Modified behavior in web/src/frontends/modern/router.ts: 首页路由由动态导入 HomeView.vue 改为使用已静态导入的 HomeView;其他路由映射未变。
  • observed — Modified behavior in web/src/frontends/modern/router.ts: 登录路由组件由动态导入 LoginView.vue 改为使用已静态导入的 LoginView。

Reliability and maintainability

  • inferred — Risk-relevant change factors for web: blast_radius_1; blast_radius_3; direct_dependents_1; direct_dependents_2
🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题简洁且准确地概括了前端启动失败恢复这一主要变更。
Description check ✅ Passed 描述包含变更内容、验证结果、兼容性影响和自查清单,整体完整。关联 Issue 填写为“None.”,且文档更新项未勾选;作者已说明无需更新公开文档。
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 unsupported.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@tbphp
tbphp merged commit d3257cf into main Oct 5, 2026
12 checks passed
@tbphp
tbphp deleted the tbphp/fix-startup-home-recovery branch October 5, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants