* feat: add offline-friendly error handling and network status awareness
Add ErrorBoundary to catch render errors (including chunk load failures from
React.lazy), replacing the previous white-screen crash with a friendly Result
page. Add a network status model (useModel('network')) and OfflineBanner that
shows when the user goes offline. Make request error messages offline-aware.
Clean up dead PWA/ServiceWorker code in global.tsx that never fired.
- ErrorBoundary: catches all render errors, distinguishes chunk load failures
(offline vs online messages), uses antd Result with retry/home buttons
- OfflineBanner: Alert banner in ProLayout content area when offline
- network model: navigator.onLine + online/offline event listeners
- requestErrorConfig: offline-aware error messages in errorHandler
- global.tsx: remove dead sw.offline/sw.updated event listeners
- defaultSettings.ts: remove unused pwa flag
- locales: replace dead PWA i18n keys with network/error keys (8 locales)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: resolve intermittent "Can't resolve 'tailwindcss'" on Windows (#11747)
Set globalThis.__tw_resolve in postcss.config.js to bypass
enhanced-resolve's CachedInputFileSystem, which caches stale
negative results on Windows (e.g. when Windows Defender scans
node_modules). Also fix @source path from "./src" to "."
since the directive is relative to the CSS file location.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: address PR review feedback for offline features
- Use getIntl() with i18n key in requestErrorConfig instead of hardcoded
English strings (matches CodeRabbit, Gemini, Copilot feedback)
- Add SSR guard for navigator.onLine in requestErrorConfig (Gemini)
- Replace <a> wrapping <Button> with <Button href> for valid HTML
- Extract getSubTitleId helper to eliminate nested ternary
- Move OfflineBanner to rootContainer layer to cover layout:false
routes (login, register) that lack ProLayout
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* revert: remove unrelated tailwindcss and config changes
These changes belong in a separate PR:
- postcss.config.js: Windows tailwindcss resolve workaround
- src/tailwind.css: @source path change
- config/md-raw-loader.cjs: trailing newline fix
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: offlineBanner uses getIntl() and inline network state
OfflineBanner is rendered inside rootContainer, which is the outermost
wrapper in Umi's provider chain. useModel('network') and useIntl()
require provider context (dataflowProvider, i18nProvider) that doesn't
exist at this level, causing runtime crashes. Switch to getIntl() (which
accesses the global intl singleton) and inline navigator.onLine state.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: make ErrorBoundary reactive to network state and move OfflineBanner outside
- ErrorBoundary now tracks isOnline via state + event listeners instead
of reading navigator.onLine once at render time, so the subtitle
updates when the user goes back online
- OfflineBanner moved outside ErrorBoundary in rootContainer so it
remains visible even when ErrorBoundary shows the error fallback
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: add defaultMessage fallback to requestErrorConfig formatMessage calls
Ensures a readable string is shown when the locale key is missing,
instead of the raw key id.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: match umi chunk error format and add defaultMessage fallbacks
1. isChunkLoadError regex now matches "Failed to load chunk" (Umi format)
in addition to "Loading chunk" (webpack format), fixing the error page
showing generic "Something went wrong" instead of friendly offline text
2. All formatMessage calls in ErrorBoundary and OfflineBanner include
defaultMessage fallbacks, fixing empty Alert banner when getIntl()
returns before locale initialization completes
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: show offline-friendly error page when network is unavailable
When offline and navigating to an unvisited route, the ErrorBoundary
displayed a generic "Something went wrong" page instead of the friendly
offline/crunk-load error message. This happened because:
1. isChunkLoadError could miss errors when React wraps them or the error
name doesn't exactly match — now also checks error.stack and adds a
case-insensitive "chunkloaderror" pattern
2. When offline, ANY render error is overwhelmingly likely a chunk load
failure — new isNetworkRelatedError() treats offline as network-related
3. The subtitle defaultMessage was wrong: it used isOffline instead of
combining both networkRelated and isOffline dimensions
4. handleRetry only reloaded for isChunkLoadError — now also reloads when
offline (resetting state can't re-fetch the chunk)
5. Auto-reloads the page when network comes back online during an error
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: replace deprecated Alert `message` prop with `title`
antd v6 deprecated the `message` prop on Alert in favor of `title`.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: replace ProLayout's default ErrorBoundary with our offline-aware version
ProLayout has a built-in ErrorBoundary (@ant-design/pro-utils) that
catches chunk load errors BEFORE our root-level ErrorBoundary, rendering
a generic "Something went wrong." Result page. This masked our custom
offline-friendly error handling entirely.
Pass our ErrorBoundary as ProLayout's ErrorBoundary prop so it catches
errors inside the content area with proper offline/chunk-error detection,
while the root-level ErrorBoundary still guards the outer app shell.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* refactor: simplify ErrorBoundary, remove over-engineering
Remove speculative additions that didn't address the root cause:
- isNetworkRelatedError: assuming all render errors are chunk errors
when offline masks genuine bugs
- CHUNK_ERROR_PATTERNS const and error.stack scanning: the original
isChunkLoadError already matches utoopack's ChunkLoadError format
- getTitleId/getSubTitleId helpers: single-call-site abstractions
- Card wrapper: unnecessary inside ProLayout content area
- Offline-aware handleRetry: chunk errors should be the only trigger
for reload, not any error while offline
Kept the real improvements:
- Correct 3-way defaultMessage for subtitle (offline chunk / online
chunk / render error)
- Auto-reload on network recovery when in error state
- ProLayout ErrorBoundary prop (the actual fix in previous commit)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* refactor: simplify offline handling and fix OfflineBanner not showing
1. OfflineBanner: use `useModel('network')` instead of duplicating
online/offline listener logic, fix `title` → `message` prop
(Alert in banner mode uses `message`, not `title`)
2. ErrorBoundary: extract shared renderErrorFallback(), split into
ErrorBoundaryClass (for ProLayout's ComponentClass prop) and
ErrorBoundary (FC wrapper using useModel('network')). When isOnline
prop is provided, class skips own event listeners; when unset,
falls back to navigator.onLine tracking.
3. requestErrorConfig: consolidate duplicate offline check — check
navigator.onLine once before the error.request branch instead of
duplicating the same intl message in two branches.
4. ProLayout now uses ErrorBoundaryClass directly (satisfies the
ComponentClass type requirement).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: useModel context null error — rootContainer is outside model provider
rootContainer is the outermost React wrapper, rendered BEFORE the
dataflow/model provider. Components inside it cannot use useModel().
- ErrorBoundary: revert to pure class component with own online/offline
listeners (no hooks). ProLayout ErrorBoundary prop requires
ComponentClass anyway.
- OfflineBanner: revert to own useState+useEffect listeners (same reason
— outside model provider in rootContainer).
- Delete unused src/models/network.ts (no consumers left).
- Remove ErrorBoundaryClass named export, keep default export only.
- Fix Alert `title` → `message` prop (banner mode uses message).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: move OfflineBanner into ProLayout childrenRender
rootContainer is outside ProLayout, causing layout issues (empty
ant-layout-header inserted). Move OfflineBanner into childrenRender
where it renders inside the ProLayout content area as intended.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: wrap error Result in Card, style OfflineBanner with margin and showIcon
- ErrorBoundary: wrap Result in <Card variant="borderless"> for proper
card styling
- OfflineBanner: remove `banner` prop (was causing header layout issues),
add `showIcon` for warning icon, add `marginBottom: 16` for spacing
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: error boundary wrap in Layout.Content for padding, move offline banner to page top
- errorBoundary: replace Card with Layout.Content (padding: 24) to match
the 403/exception page style, since ErrorBoundary renders outside
ProLayout's Layout.Content
- offlineBanner: move back to rootContainer (above ProLayout) to display
at page top as a full-width banner, restore `banner` prop
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: error boundary use Card style matching 403 page, offline banner fixed top center
- errorBoundary: use Card variant="borderless" wrapping Result, matching
the 403/404 exception page style for consistency
- offlineBanner: use fixed positioning at top center of header area with
pointer-events passthrough, max-width 480px, small margin
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: add padding around error boundary Card for consistent layout
ErrorBoundary replaces Layout.Content when catching errors, so the
Card has no outer padding. Wrap in a div with padding: 24 to match
the ProLayout content area spacing.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat: add soft retry for chunk errors and update all locales
Split the single retry button into two actions:
- "Retry" (soft): clears failed chunk scripts and resets ErrorBoundary
state for chunk load errors only
- "Reload Page" (hard): full page refresh, available for all errors
Update all 8 locale files with new app.error.reload key and change
app.error.retry from "refresh/reload" to "retry" semantics.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: remove non-functional soft retry and simplify ErrorBoundary
- Remove removeFailedChunkScripts() — nothing marks scripts with
data-failed and the bundler caches rejected promises, so soft retry
was a no-op that misleads users
- Remove Retry button; keep Reload Page + Back Home for all errors
- Remove unused app.error.retry locale key from all 8 locales
- Evaluate navigator.onLine directly in render instead of caching in
instance field, so error UI always reflects current network status
- Limit handleOnline auto-reload to chunk load errors only, preventing
data loss from indiscriminate reload on render errors
- Remove offline event listener (no longer needed without isOnline cache)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: make ErrorBoundary reactive to network state changes
- Move isOnline into component state so error fallback UI updates
when network status changes (online/offline events trigger re-render)
- Tighten isChunkLoadError regex: replace broad /imported module/i
with specific /Failed to fetch dynamically imported module/i to
avoid false positives on unrelated runtime errors
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat: add retry button for chunk errors, simplify DOM, rename pwa→network
- Add Retry button for chunk load errors that remounts children via
key increment, forcing React.lazy to re-execute import() without
a full page reload
- Remove wrapper divs: Card padding applied directly via style,
Alert positioned directly without outer container
- Rename pwa.ts → network.ts across all 8 locales (keys no longer
PWA-specific) and update imports in locale index files
- Add app.error.retry locale key to all 8 locales
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* style: remove unnecessary comment in components index and ErrorBoundary
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* fix: error-processing-request (#3402)
* Close: #3398
* error authority is undefined
* feat: add new config "menu.enableLocale" (#3310)
* feat: add new config "layoutLocal"
* Use enableLayoutLocale instead of layoutLocale
* Use enableMenuLocale instead of enableMenuLocale
* use menu.disableLocal
* Fix an issue in list item Add (#3423)
* try fix test error (#3424)
* try fix test error
* try fix ci error in windows
* feat: Routing is in the root directory can also matchs. (#3364)
* fix viewport content
Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.
* Set up CI with Azure Pipelines (#3268)
* Set up CI with Azure Pipelines
* change some js filemod to 644 (#3447)
* fix#2851 (#3440)
* add responsive-table (#3472)
* remove PureComponent (#3470)
* remove PureComponent
* fix typo
* chore: upgrade jest-puppeteer and remove some puppeteer config
* html prettier (#3473)
* prettier html
* update dependencies
* centering icon
* set icon size
* edit text
* Removed redundant colon - zh-CN (#3480)
* Removed redundant colon - zh-CN
* Removed redundant colon - zh-TW
* Removed redundant colon - en-US
* fix: horizontal scroll bar appears on SiderMenu with light navTheme (#3381)
* fix: horizontal scroll bar appears on SiderMenu with light navTheme
* a better solution
* fix Badge error (#3488)
* fix tag error
* Move flags to badges in README
* Make "home" optional in breadcrumb (#3416)
* fixed submenu collapsed when refresh page (#3494)
* perf: add checkout config in azure (#3498)
* 🆙 upgrade deps (#3503)
* fix: unresponsive collapse btn on mobile (#3504)
* style: prettier SiderMenu.js (#3501)
* style: prettier SiderMenu.js
* new config file
* fix ci error
* feat: support pwa config (#3508)
* feat: support pwa config
* style: change code style
* reset ci (#3507)
* add actionsText prop to TagSelect, add locales to List page #3367 (#3442)
* add actionsText prop to TagSelect, add locales to List page
* add actionsText prop to TagSelect, add locales to List page
* 修正繁体中文文案 (#3511)
* Route authority attribute behavior (#3514)
* fix customize menu icon bug (#3509)
* fix customize menu icon bug
当采用自定义菜单图标(即通过url引用方式)且菜单折叠时,文字不隐藏
* fix customize menu icon bug
修改样式
* feat: add a demo that jump to details (#3502)
* feat: add a demo that jump to details
* feat: hide progress in coi
* remove trigger config
* remove fetchDepth: 1
* refactor: userinfo and application from api
* style: fix code style
* Enhance stylelint rules, fix propTypes error of TagSelect (#3518)
* add stylelint shareable config for css modules
* fix CSS pseudo element with double colon
* support stylelint declaration-block-no-ignored-properties rule
* support sorted CSS properties order for readability and consistency
* autofix order of all styles by lint:fix script
* fix propTypes error of TagSelect component
* Revert "autofix order of all styles by lint:fix script"
This reverts commit 51cb9d055f.
* Revert "support sorted CSS properties order for readability and consistency"
This reverts commit ff6c24d263.
* make lint:fix work for stylelint
* Revert "Revert "autofix order of all styles by lint:fix script""
This reverts commit 946ed0a351.
* Revert "Revert "support sorted CSS properties order for readability and consistency""
This reverts commit 31b557e382.
* Update README.zh-CN.md
* doc: add umi-badge (#3538)
* doc: add umi-badge
* Update README.ru-RU.md (#3539)
add umi badge
* feat: Officially traded will use cdn to optimize bizchart (#3535)
* route authority attribute behavior no use while (#3522)
* route authority attribute behavior no use while
* i18n pt-BR: analysis & component (#3540)
* Translation of form and monitor (pt-BR)
* Change flag of Portugal (pt-PT) to Brazil (pt-BR)
* i18n pt-BR: analysis & component
* Fix missing export default (#3525)
* fix types missing export default
* Update package.json
* Update index.d.ts
* Update index.d.ts
* Update index.d.ts
* 增加IconFont组件、菜单图标可以使用自己的IconFont项目图标 (#3517)
* feature:
1.add iconfont component;
2.menu can add iconfont icon.
* fix: 调整菜单引入iconfont的方式为String.
1. 新增IconFont组件,需在组件内配置自己的IconFont图标项目地址;
2. 然后,菜单图标可以引入自己的IconFont图标,图标字符串以icon-开头.
* ajust: put the IconFont Script Url into defaultSetting.js
* 调整iconfontUrl名称
* fix:注释更新
* 留空iconfontUrl
* Site title use defaultSettings (#3546)
* Site title od top use defaultSettings (#3551)
* pref: optimize performance (#3542)
* pref: optimize performance
* pref: use less img
* pref: use less img
* fix: Eslint warning of Mock dependence (#3554)
* perf: use requestAnimationFrame
* Fix: onPressEnter trigger twice login request in IE11
* Fix: onPressEnter trigger twice login request in IE11
* Login title (#3564)
* Added document title to UserLayout by identifying the current route object and using its name kaey to set the title
* Adjusment to document title
* feat: use same getPageTile function
* when select 3 item ,text branch
* style: use standard frontmatter
* doc: remove subtitle in en-Us
* better demo md
* fix PageHeader no title bug (#3583)
* fix PageHeader no title bug
* default value
* fix: React does not recognize the `staticContext` prop on a DOM element. (#3582)
* doc: better demo
* remove drawer onHandleClick, ant-design/ant-design#15051 (#3602)
* Use Umi Permission Routing (#3587)
Use Umi Permission Routing
* fix the problem that breadcrumbNameMap does not contain hidden menus. (#3606)
* Update enzyme to version 3.9.0
* Update package.json
* Update jest-puppeteer to version 4.0.0
* Update prettier to version 1.16.4
* Update package.json
* 🐛 fix TagCloud style override bug (#3632)
* Update stylelint-config-prettier to version 5.0.0
* Update index.md (#3644)
* dead code (#3639)
* dead code
Close: #3637
* delete dead props
* [NoticeIcon] Replace `LoadMore` with `ViewMore` button (#3439)
* enhance LoadMore: Debounce
* enhance LoadMore: debounce
* use Tag instead of div
* rewrite margin-right of Tag
* hide LoadMore in NoticeList without onLoadMore
* another style
* fix a mistake
* remove local config
* fix a bug
* user-select: none
* remover local config
* replace global/fetchMoreNotices with global/fetchNotices
* replace LoadMore with ViewMore
* remove prop `name` in NoticeIcon
* fix: tab title does not show correct text
* Fix margin top style error of Description List following Description List (#3653)
* fix login model statu
* feat: add new config "layoutLocal"
* Use enableLayoutLocale instead of layoutLocale
* Use enableMenuLocale instead of enableMenuLocale
* use menu.disableLocal