Skip to content

Conversation

@shangxueink
Copy link

@shangxueink shangxueink commented Jan 19, 2026

新增 WebQQ 全屏模式(#webqq-fullscreen

为 WebUI 新增一个 独立的 WebQQ 全屏页面,使其能够在无侧边栏的环境下单独运行,同时 保留原有 #webqq 布局不变

适合:

  • 在独立窗口中打开 WebQQ
  • 在其他系统 iframe 中嵌入 WebQQ
  • 隔离 WebUI 主界面导航时使用

实现内容

1. 新增全屏 WebQQ 路由:#webqq-fullscreen

  • 新增组件:WebQQFullscreen.tsx
  • 该页面作为 独立 WebQQ 运行场景,无侧边栏、无顶部导航、无额外 UI 修饰。
  • 内部只渲染纯净版 <WebQQPage />

2. App.tsx 中新增路由判断

新增分支:

if (activeTab === 'webqq-fullscreen') {
   return <WebQQFullscreen />
}

确保全屏版本不加载 Sidebar / Header / 布局容器。


3. 无全屏模式下 UI 完全不变

所有原有 UI 行为继续保持:

  • #webqq → 保留侧边栏
  • 文本、聊天区高度、布局均未被修改
  • 不影响旧用户使用
  • 不影响移动端逻辑

📁 主要新增文件

📁 主要修改文件

Summary by Sourcery

添加一个专用的全屏 WebQQ 视图,可通过新的 hash 路由访问,同时保留现有基于侧边栏的 WebQQ 布局。

新功能:

  • 引入新的 webqq-fullscreen hash 路由,用于在不包含主布局外框(chrome)的情况下,以独立全屏视图打开 WebQQ。

增强:

  • 从 WebQQ 模块中导出新的 WebQQFullscreen 组件,以便复用并集成到路由中。
Original summary in English

Summary by Sourcery

Add a dedicated fullscreen WebQQ view accessible via a new hash route while preserving the existing sidebar-based WebQQ layout.

New Features:

  • Introduce a new webqq-fullscreen hash route to open WebQQ in an isolated fullscreen view without the main layout chrome.

Enhancements:

  • Export the new WebQQFullscreen component from the WebQQ module for reuse and routing integration.

Add a new fullscreen route and component for WebQQ interface accessible via #webqq-fullscreen hash. The fullscreen mode provides an immersive experience without the sidebar navigation.

Changes include:
- Create WebQQFullscreen component with full viewport height
- Add 'webqq-fullscreen' to valid tab routes
- Export WebQQFullscreen from WebQQ components index
- Implement dedicated route handler in App.tsx with background and dialogs
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 19, 2026

审阅者指南

添加新的 #webqq-fullscreen 路由和组件,以在无侧边栏/页头的独立全屏布局中渲染 WebQQ,同时保持现有的 #webqq 选项卡和布局不变。

导航到新的 WebQQ 全屏路由的时序图

sequenceDiagram
  actor User
  participant Browser
  participant App
  participant WebQQFullscreen
  participant WebQQPage

  User->>Browser: Set URL hash to webqq-fullscreen
  Browser-->>App: hashchange event
  App->>App: handleHashChange reads window.location.hash
  App->>App: validate hash against validTabs
  App->>App: setActiveTab webqq-fullscreen
  App->>App: re render with activeTab webqq-fullscreen
  App-->>WebQQFullscreen: render WebQQFullscreen
  WebQQFullscreen-->>WebQQPage: render WebQQPage inside fullscreen container
  App-->>User: Display WebQQ in fullscreen layout without sidebar or header
Loading

更新后的 App 与 WebQQ 全屏组件类图

classDiagram
  class App {
    - string activeTab
    - Config config
    - boolean loading
    - boolean isLoggedIn
    - boolean checkingLogin
    + App()
  }

  class WebQQFullscreen {
    + WebQQFullscreen()
  }

  class WebQQPage {
  }

  class Sidebar {
    + Sidebar(activeTab, onTabChange, accountInfo, isOpen, onClose)
  }

  class AnimatedBackground {
    + AnimatedBackground()
  }

  class TokenDialog {
    + TokenDialog(visible, onConfirm, error)
  }

  class ToastContainer {
    + ToastContainer()
  }

  App --> AnimatedBackground : renders
  App --> Sidebar : renders in main layout
  App --> TokenDialog : renders
  App --> ToastContainer : renders
  App --> WebQQFullscreen : renders when activeTab webqq-fullscreen

  WebQQFullscreen --> WebQQPage : renders
Loading

文件级变更

变更 详情 文件
引入专用的全屏 WebQQ 页面并从 WebQQ 模块中导出。
  • 创建新的 WebQQFullscreen React 组件,将 WebQQPage 包装在适用于全屏使用的全高度容器中。
  • 从 WebQQ 的 index 模块导出新的 WebQQFullscreen 组件,以用于主应用的路由。
src/webui/FE/components/WebQQ/WebQQFullscreen.tsx
src/webui/FE/components/WebQQ/index.ts
在主应用中为新的 webqq-fullscreen 选项卡添加路由和状态处理,同时不影响现有选项卡。
  • 扩展有效 URL hash 选项卡列表,在初始加载和 hash 变化时都包含 webqq-fullscreen
  • App 中添加一个提前返回分支,当 activeTabwebqq-fullscreen 时,渲染 WebQQ 全屏布局,复用现有的 AnimatedBackgroundTokenDialogToastContainer,但省略侧边栏和主布局容器。
  • 为所有其他选项卡保留现有的已登录布局和行为,包括原始带侧边栏和导航不变的 webqq 选项卡。
  • 在修改部分周围进行小的格式/空白调整以保持一致性。
src/webui/FE/App.tsx

提示与命令

与 Sourcery 交互

  • 触发新审阅: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 在某条审阅评论下回复,要求 Sourcery 从该评论创建 issue。你也可以在审阅评论下回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 pull request 标题: 在 pull request 标题中任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title 以(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文的任意位置写上 @sourcery-ai summary,即可在该位置生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 以在任意时间(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可在任意时间(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,以解决所有 Sourcery 评论。如果你已经处理了所有评论且不希望再看到它们,这会很有用。
  • 忽略所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss,以忽略所有现有的 Sourcery 审阅。若你希望以一次全新的审阅重新开始,这尤其有用——别忘了再评论 @sourcery-ai review 以触发新的审阅!

自定义使用体验

访问你的 控制台 以:

  • 启用或禁用审阅功能,例如 Sourcery 生成的 pull request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Adds a new #webqq-fullscreen route and component to render WebQQ in a standalone, fullscreen layout without sidebar/header, while keeping the existing #webqq tab and layout unchanged.

Sequence diagram for navigating to the new WebQQ fullscreen route

sequenceDiagram
  actor User
  participant Browser
  participant App
  participant WebQQFullscreen
  participant WebQQPage

  User->>Browser: Set URL hash to webqq-fullscreen
  Browser-->>App: hashchange event
  App->>App: handleHashChange reads window.location.hash
  App->>App: validate hash against validTabs
  App->>App: setActiveTab webqq-fullscreen
  App->>App: re render with activeTab webqq-fullscreen
  App-->>WebQQFullscreen: render WebQQFullscreen
  WebQQFullscreen-->>WebQQPage: render WebQQPage inside fullscreen container
  App-->>User: Display WebQQ in fullscreen layout without sidebar or header
Loading

Updated class diagram for App and WebQQ fullscreen components

classDiagram
  class App {
    - string activeTab
    - Config config
    - boolean loading
    - boolean isLoggedIn
    - boolean checkingLogin
    + App()
  }

  class WebQQFullscreen {
    + WebQQFullscreen()
  }

  class WebQQPage {
  }

  class Sidebar {
    + Sidebar(activeTab, onTabChange, accountInfo, isOpen, onClose)
  }

  class AnimatedBackground {
    + AnimatedBackground()
  }

  class TokenDialog {
    + TokenDialog(visible, onConfirm, error)
  }

  class ToastContainer {
    + ToastContainer()
  }

  App --> AnimatedBackground : renders
  App --> Sidebar : renders in main layout
  App --> TokenDialog : renders
  App --> ToastContainer : renders
  App --> WebQQFullscreen : renders when activeTab webqq-fullscreen

  WebQQFullscreen --> WebQQPage : renders
Loading

File-Level Changes

Change Details Files
Introduce a dedicated fullscreen WebQQ page and export it from the WebQQ module.
  • Create a new WebQQFullscreen React component that wraps WebQQPage in a full-height container suitable for fullscreen usage.
  • Export the new WebQQFullscreen component from the WebQQ index module for use in the main app routing.
src/webui/FE/components/WebQQ/WebQQFullscreen.tsx
src/webui/FE/components/WebQQ/index.ts
Add routing and state handling for the new webqq-fullscreen tab in the main app without affecting existing tabs.
  • Extend the list of valid URL hash tabs to include webqq-fullscreen both on initial load and on hash change.
  • Add an early return branch in App to render the fullscreen WebQQ layout when activeTab is webqq-fullscreen, reusing existing AnimatedBackground, TokenDialog, and ToastContainer but omitting sidebar and main layout container.
  • Preserve existing logged-in layout and behavior for all other tabs, including the original webqq tab with sidebar and navigation unchanged.
  • Apply minor formatting/whitespace adjustments around modified sections for consistency.
src/webui/FE/App.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我发现了一个问题,并给出了一些整体性的反馈:

  • WebQQFullscreen.tsx 中,从 ./index 导入 WebQQPage 会与 index.ts 中导出的 WebQQFullscreen 形成循环依赖;建议在这里直接从 ./WebQQPage 导入 WebQQPage,以避免潜在的模块解析问题。
  • App.tsx 中在初始状态计算和 hashchange 处理函数里都各自定义了一份 validTabs 数组;将它提取为一个共享常量可以降低这两个列表在未来出现不一致的风险。
提供给 AI Agents 的提示
Please address the comments from this code review:

## Overall Comments
- In `WebQQFullscreen.tsx`, importing `WebQQPage` from `./index` creates a circular dependency with `index.ts` exporting `WebQQFullscreen`; consider importing `WebQQPage` directly from `./WebQQPage` to avoid potential resolution issues.
- The `validTabs` array is duplicated in both the initial state calculation and the hashchange handler in `App.tsx`; extracting it to a shared constant will reduce the risk of the two lists diverging over time.

## Individual Comments

### Comment 1
<location> `src/webui/FE/components/WebQQ/WebQQFullscreen.tsx:2` </location>
<code_context>
+import React from 'react'
+import { WebQQPage } from './index'
+
+/**
</code_context>

<issue_to_address>
**issue (bug_risk):** Avoid circular dependency by importing WebQQPage directly instead of via the index barrel.

Because `index.ts` now re-exports `WebQQFullscreen`, importing `WebQQPage` from `./index` introduces a cycle: `index.ts -> WebQQFullscreen.tsx -> index.ts`, which can cause `undefined` exports or initialization issues in some runtimes. Import `WebQQPage` directly from `'./WebQQPage'` here to avoid the cycle while still using the barrel elsewhere.
</issue_to_address>

Sourcery 对开源项目免费 —— 如果你觉得我们的代码评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码评审。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • In WebQQFullscreen.tsx, importing WebQQPage from ./index creates a circular dependency with index.ts exporting WebQQFullscreen; consider importing WebQQPage directly from ./WebQQPage to avoid potential resolution issues.
  • The validTabs array is duplicated in both the initial state calculation and the hashchange handler in App.tsx; extracting it to a shared constant will reduce the risk of the two lists diverging over time.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `WebQQFullscreen.tsx`, importing `WebQQPage` from `./index` creates a circular dependency with `index.ts` exporting `WebQQFullscreen`; consider importing `WebQQPage` directly from `./WebQQPage` to avoid potential resolution issues.
- The `validTabs` array is duplicated in both the initial state calculation and the hashchange handler in `App.tsx`; extracting it to a shared constant will reduce the risk of the two lists diverging over time.

## Individual Comments

### Comment 1
<location> `src/webui/FE/components/WebQQ/WebQQFullscreen.tsx:2` </location>
<code_context>
+import React from 'react'
+import { WebQQPage } from './index'
+
+/**
</code_context>

<issue_to_address>
**issue (bug_risk):** Avoid circular dependency by importing WebQQPage directly instead of via the index barrel.

Because `index.ts` now re-exports `WebQQFullscreen`, importing `WebQQPage` from `./index` introduces a cycle: `index.ts -> WebQQFullscreen.tsx -> index.ts`, which can cause `undefined` exports or initialization issues in some runtimes. Import `WebQQPage` directly from `'./WebQQPage'` here to avoid the cycle while still using the barrel elsewhere.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant