Skip to content

GUI Overhaul with Streamlit / 使用Streamlit重构图形界面 #2

Description

@Comet-zzz

[Feature] GUI Interface

Current Problem

目前 CheckPause 是一个纯命令行(CLI)工具。用户粘贴棋谱、输入问题、查看分析结果都在终端中进行,交互方式不够直观。看不到棋盘,无法直接点击走法进行提问,对局面的感知完全依赖文字描述。

Currently CheckPause is a pure command-line tool. Users paste PGNs, type questions, and view analysis results in a terminal. There is no visual board, no clickable moves, and understanding the position relies entirely on text descriptions.

Proposed Approach

引入基于 Streamlit 的图形界面(GUI),将 CP 的使用体验提升到与主流棋谱分析工具相当的水平。

Introduce a Streamlit-based graphical interface that brings CP's user experience to the level of mainstream chess analysis tools.

Implementation Plan

Layout

页面分为四个区域:

  • 左上:棋盘 – 显示当前局面,支持跳转到棋谱中的任意一步。
  • 左下:棋谱走法列表 – 显示 PGN 中的所有走法,点击任意一步可跳转到对应局面。
  • 右上:用户状态 – 显示当前用户名、最新准确度、分析总局数、进步趋势。
  • 右下:对话窗口 – 与 CP 进行自然语言交流,输入问题,获取 AI 讲解。

The page is divided into four sections:

  • Top-Left: Chessboard – Displays the current position, with navigation to any move in the game.
  • Bottom-Left: Move List – Displays all moves from the PGN; clicking a move jumps to that position.
  • Top-Right: User Stats – Shows username, latest accuracy, total games, and improvement trend.
  • Bottom-Right: Chat Window – Natural language interaction with CP; ask questions, get AI coaching.

Technology Choice

采用 Streamlit + streamlit-chessboard 实现图形界面。原因:

  • Python 原生,与现有代码(engine / ai / profile)无缝对接。
  • 无需学习 HTML/CSS/JavaScript。
  • 开发速度快,可快速迭代原型。

Use Streamlit with streamlit-chessboard for the GUI. Reasons:

  • Native Python, integrates seamlessly with existing (engine / ai / profile) code.
  • No need to learn HTML/CSS/JavaScript.
  • Fast development, rapid prototyping.

Code Impact

  • main.py 将被替换为 app.py(Streamlit 入口)。

  • engine.py、ai.py、config.py、profile.py 保持不变。

  • 新增依赖:streamlit、streamlit-chessboard(或 python-chess SVG 渲染)。

  • main.py will be replaced by app.py (Streamlit entry point).

  • engine.py, ai.py, config.py, profile.py will remain unchanged.

  • New dependencies: streamlit, streamlit-chessboard (or python-chess SVG render).

Open Questions

  • 棋盘交互方式:点击走法列表跳转,还是直接在棋盘上点击棋子走棋?

  • 棋盘渲染:使用 streamlit-chessboard 还是 python-chess 直接生成 SVG?

  • 分析流程:是否保留“粘贴 PGN → 自动分析”的流程,还是改为“粘贴 PGN → 手动点击分析按钮”?

  • 对话历史:是否需要保留当前 Streamlit 会话中的完整对话上下文?

  • Board interaction: jump by clicking a move in the list, or play moves directly on the board?

  • Board rendering: use streamlit-chessboard or generate SVG directly with python-chess?

  • Analysis flow: keep the "paste PGN → auto-analyze" flow, or change to "paste PGN → click analyze button"?

  • Chat history: preserve full conversation context within the current Streamlit session?


Activity

  1. self-assigned this
    on Jul 31, 2026
  2. Repository owner locked and limited conversation to collaborators on Aug 9, 2026
  3. Repository owner unlocked this conversation on Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions