feat(tui): 优化 Markdown 渲染与折叠性能,并新增 /web 启动入口#600
feat(tui): 优化 Markdown 渲染与折叠性能,并新增 /web 启动入口#600phantom5099 merged 5 commits into1024XEngineer:mainfrom
Conversation
# Conflicts: # internal/tui/core/app/app.go
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| } | ||
|
|
||
| args := []string{"web", "--open-browser=true"} | ||
| if strings.TrimSpace(workdir) != "" { |
There was a problem hiding this comment.
/web respawns the current executable but never sets command.Dir or passes any static-asset/source location to the child. That breaks a common source-build workflow: if the TUI was started via go run ./cmd/neocode from some workspace, the child inherits that workspace cwd, while neocode web only probes ./web/... and executable-adjacent paths. With a go run temp binary, both lookups miss, so /web fails even though the command is advertised as available. Please anchor the child to the repo/binary asset root or pass --static-dir explicitly.
| $settingsPath = $settingsCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1 | ||
| if ([string]::IsNullOrWhiteSpace($settingsPath)) { | ||
| throw "Windows Terminal settings.json was not found." | ||
| } |
There was a problem hiding this comment.
This rewrites Windows Terminal's settings.json via ConvertFrom-Json/ConvertTo-Json, but that file is typically JSONC. In Windows PowerShell 5.1, commented/trailing-comma settings files will fail to parse; even when parsing succeeds, writing it back strips comments and formatting from the user's terminal config. As written, the helper can either fail on stock configs or unexpectedly rewrite them. It needs a JSONC-safe edit path, or at least an explicit PowerShell-version/format guard.
| {Usage: slashUsageModel, Description: "Open the interactive model picker"}, | ||
| {Usage: slashUsageSession, Description: "Switch to another session"}, | ||
| {Usage: slashUsageWeb, Description: "Start Web UI in browser"}, | ||
| {Usage: slashUsageExit, Description: "Exit NeoCode"}, |
There was a problem hiding this comment.
/web is now a user-facing slash command, but the slash-command docs were not updated alongside this addition. The current guides (www/guide/slash-commands.md, www/en/guide/slash-commands.md, and README command listings) still describe the old command set, so this change introduces immediate doc drift.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Summary
本 PR 聚焦 TUI 体验优化与 Web 入口补齐,主要包括:
/web指令启动 Web 端入口Changes
/web在 TUI 内触发 Web UI 启动链路Validation
go test ./internal/tui/core/appgo test ./internal/tui/infra/...---、中英混排显示对齐正常/web可触发 Web UI 启动Risk