前端修正切換到chat切換後回 welcome 的配置保存最終切換頁面#5792
前端修正切換到chat切換後回 welcome 的配置保存最終切換頁面#5792itamiokanjiro wants to merge 2 commits intoAstrBotDevs:masterfrom
Conversation
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
- 建议在访问
localStorage时增加防护(例如先检查typeof window !== 'undefined'或类似方式),以避免这个 header 组件在 SSR / 非浏览器环境中渲染时发生错误。 watch(route, ...)会对 route 对象上的任何变动做出响应;你可能会希望把它收窄为watch(() => route.fullPath, ...),这样它只会在真实路径发生变化时才运行。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- Consider guarding `localStorage` access (e.g., checking `typeof window !== 'undefined'` or similar) so this header component doesn't break if rendered in an SSR/non-browser context.
- The `watch(route, ...)` will react to any mutation on the route object; you may want to narrow it to `watch(() => route.fullPath, ...)` so it only runs when the actual path changes.请帮助我变得更有用!你可以在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- Consider guarding
localStorageaccess (e.g., checkingtypeof window !== 'undefined'or similar) so this header component doesn't break if rendered in an SSR/non-browser context. - The
watch(route, ...)will react to any mutation on the route object; you may want to narrow it towatch(() => route.fullPath, ...)so it only runs when the actual path changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider guarding `localStorage` access (e.g., checking `typeof window !== 'undefined'` or similar) so this header component doesn't break if rendered in an SSR/non-browser context.
- The `watch(route, ...)` will react to any mutation on the route object; you may want to narrow it to `watch(() => route.fullPath, ...)` so it only runs when the actual path changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取請求旨在優化用戶在應用程式不同視圖模式間切換時的導航體驗。它解決了從聊天模式返回機器人模式時,用戶不再被強制重定向到起始頁面,而是返回到他們上次訪問的機器人頁面,從而提升了操作的流暢性和便捷性,確保用戶的導航狀態能夠被正確保存和恢復。 Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
解決了每次切換到chat頁面 回bot配置頁面都跑回 歡迎主頁面的問題
Modifications / 改动点
修改 watch(() => customizer.viewMode (newMode, oldMode) 函數 切換回 / 改成lastBotRoute
新增 watch(route, (newRoute) , 保存 bot 模式的最後路由
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Summary by Sourcery
错误修复:
Original summary in English
Summary by Sourcery
Bug Fixes: