Skip to content

fix: resolving console warnings and errors - #225

Merged
zzcr merged 6 commits into
devfrom
wyp/start-0720
Jul 22, 2026
Merged

fix: resolving console warnings and errors#225
zzcr merged 6 commits into
devfrom
wyp/start-0720

Conversation

@wuyiping0628

@wuyiping0628 wuyiping0628 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

PR

解决控制台各种警告和报错

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Added Chinese and English localization entries for reset and confirmation labels.
    • Added safer cancellation for in-progress menu, permission, role, locale, and user actions when leaving a page.
  • Bug Fixes

    • Improved chart axis spacing, bar styling, and line rendering.
    • Fixed localized content and user-provided values displaying incorrectly.
    • Improved table rendering for virtualized rows and prevented unnecessary actions on skipped rows.
    • Improved password and theme modal behavior.

@github-actions github-actions Bot added the bug Something isn't working label Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The changes add locale strings, update TinyVue modal and layout usage, revise dashboard chart options, add abortable model-tool lifecycles, guard virtualized grid slots, and render entity data directly instead of translating stored values.

Changes

TinyVue template behavior

Layer / File(s) Summary
Locale entries and modal component usage
template/*/locales.json, template/tinyvue/src/components/navbar/index.vue, template/tinyvue/src/layout/default-layout.vue, template/tinyvue/src/views/userManager/info/components/info-tab.vue
Adds reset and delete-confirmation translations, imports TinyLayout, and binds modal mask closability.
Dashboard chart configuration
template/tinyvue/src/views/board/home/components/*
Updates chart axis gaps, axis types, bar corner styling, line styles, and item-style nesting.
Model tool cancellation and locale fallback
template/tinyvue/src/views/locale/components/add-locale.vue, template/tinyvue/src/views/menu/info/components/info-tab.vue, template/tinyvue/src/views/permission/info/components/info-tab.vue, template/tinyvue/src/views/role/info/components/info-tab.vue, template/tinyvue/src/views/userManager/info/components/info-tab.vue
Passes abort signals to registered tools, aborts them during unmount, and falls back to raw menu keys when translations are unavailable.
Virtualized grid slot rendering
template/tinyvue/src/views/menu/info/components/menu-tree.vue, template/tinyvue/src/views/role/info/components/role-table.vue, template/tinyvue/src/views/userManager/info/components/info-tab.vue
Uses { row, skip } slot props and suppresses content and operations for skipped rows.
Direct entity data display
template/tinyvue/src/views/permission/info/components/info-tab.vue, template/tinyvue/src/views/role/info/components/add-role.vue, template/tinyvue/src/views/userManager/user-detail/index.vue
Renders stored permission and user fields directly, with permission description/name fallback handling.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • opentiny/tiny-pro#203: Earlier model-tool registration changes connect directly to the new abortable tool lifecycle.

Poem

I’m a bunny hopping through the views,
With fresh translations and chart hues.
Tools now stop when views depart,
Grid skips rows with careful art.
Raw user fields shine clear and bright—
A tidy burrow, working right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main goal of fixing console warnings and errors across multiple components.
✨ 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 wyp/start-0720

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.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (3)
template/tinyvue/src/views/role/info/components/role-table.vue (1)

78-86: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Simplify the getPermission formatting logic.

The current implementation is slightly verbose and introduces an unintended leading space in the resulting string (e.g., " admin" instead of "admin").

You can streamline this by using .map() and .join(' ') for cleaner and more robust formatting.

♻️ Proposed refactor
 function getPermission(row: any) {
-  let permissionDate = ''
-  if (row?.permission?.length) {
-    row.permission.forEach((item, index) => {
-      permissionDate = `${permissionDate} ${row.permission[index].name}`
-    })
-  }
-  return permissionDate
+  return row?.permission?.map((item: any) => item.name).join(' ') || ''
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@template/tinyvue/src/views/role/info/components/role-table.vue` around lines
78 - 86, Update getPermission to derive permission names with map and combine
them using join(' '), eliminating the leading space while preserving the empty
result when row.permission is absent or empty.
template/tinyvue/src/views/userManager/user-detail/index.vue (1)

58-60: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use the pre-calculated roleName property.

Since state.userData.roleName is explicitly populated in the fetchData function with data.role[0].name, you can use it directly here to simplify the template binding and avoid the deep array check.

♻️ Proposed refactor
     <li>
       <span class="title">{{ $t('userInfo.table.job') }}:</span>
-      <span v-if="state.userData.role && state.userData.role[0]" class="desc">{{ state.userData.role[0].name }}</span>
+      <span v-if="state.userData.roleName" class="desc">{{ state.userData.roleName }}</span>
     </li>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@template/tinyvue/src/views/userManager/user-detail/index.vue` around lines 58
- 60, Update the job detail binding in the user detail template to use the
pre-calculated state.userData.roleName property instead of checking
state.userData.role and indexing role[0]. Preserve the existing conditional
display behavior while removing the redundant deep array access.
template/tinyvue/src/views/board/home/components/curve.vue (1)

87-102: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove redundant axis configurations from chartExtend.

Both files define an axis property in chartExtend (yAxis in curve.vue, xAxis in falls.vue) that duplicates the identical type and boundaryGap configurations already set in the primary options object. Overriding properties with identical values is redundant and can be safely removed.

  • template/tinyvue/src/views/board/home/components/curve.vue#L87-L102: Remove the yAxis array block from chartExtend (lines 93-102).
  • template/tinyvue/src/views/board/home/components/falls.vue#L105-L108: Remove this xAxis object block from chartExtend.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@template/tinyvue/src/views/board/home/components/curve.vue` around lines 87 -
102, Remove the redundant yAxis array from chartExtend in
template/tinyvue/src/views/board/home/components/curve.vue (lines 87-102),
preserving the primary options configuration. Also remove the redundant xAxis
object from chartExtend in
template/tinyvue/src/views/board/home/components/falls.vue (lines 105-108); no
other chart settings require changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@template/tinyvue/src/views/board/home/components/curve.vue`:
- Around line 87-102: Remove the redundant yAxis array from chartExtend in
template/tinyvue/src/views/board/home/components/curve.vue (lines 87-102),
preserving the primary options configuration. Also remove the redundant xAxis
object from chartExtend in
template/tinyvue/src/views/board/home/components/falls.vue (lines 105-108); no
other chart settings require changes.

In `@template/tinyvue/src/views/role/info/components/role-table.vue`:
- Around line 78-86: Update getPermission to derive permission names with map
and combine them using join(' '), eliminating the leading space while preserving
the empty result when row.permission is absent or empty.

In `@template/tinyvue/src/views/userManager/user-detail/index.vue`:
- Around line 58-60: Update the job detail binding in the user detail template
to use the pre-calculated state.userData.roleName property instead of checking
state.userData.role and indexing role[0]. Preserve the existing conditional
display behavior while removing the redundant deep array access.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ec72d020-7848-47c6-8b99-65ede8471ef0

📥 Commits

Reviewing files that changed from the base of the PR and between 802e307 and cb83542.

📒 Files selected for processing (17)
  • template/nestJs/locales.json
  • template/springboot/src/main/resources/locales.json
  • template/tinyvue/src/components/navbar/index.vue
  • template/tinyvue/src/layout/default-layout.vue
  • template/tinyvue/src/locales.json
  • template/tinyvue/src/views/board/home/components/curve.vue
  • template/tinyvue/src/views/board/home/components/falls.vue
  • template/tinyvue/src/views/board/home/components/region.vue
  • template/tinyvue/src/views/locale/components/add-locale.vue
  • template/tinyvue/src/views/menu/info/components/info-tab.vue
  • template/tinyvue/src/views/menu/info/components/menu-tree.vue
  • template/tinyvue/src/views/permission/info/components/info-tab.vue
  • template/tinyvue/src/views/role/info/components/add-role.vue
  • template/tinyvue/src/views/role/info/components/info-tab.vue
  • template/tinyvue/src/views/role/info/components/role-table.vue
  • template/tinyvue/src/views/userManager/info/components/info-tab.vue
  • template/tinyvue/src/views/userManager/user-detail/index.vue

const toolAbortController = new AbortController()

onMounted(async () => {
navigator.modelContext.registerTool({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

这里要用document.modelContext.

全局搜索一下, navigator.modelContext , 全部替换掉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

升级下一下next-sdk到最新版本

@zzcr
zzcr merged commit dbc6da8 into dev Jul 22, 2026
8 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 22, 2026
13 tasks
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.

3 participants