Skip to content

Update - #30

Merged
merfiDEV merged 4 commits into
masterfrom
update
Oct 14, 2026
Merged

merfiDEV merged 4 commits into
masterfrom
update

Conversation

@merfiDEV

Copy link
Copy Markdown
Owner

描述

请简要描述这个 PR 做了什么。

关联 Issue

关联的 Issue 编号:#(例如 #123)

变更类型

  • Bug 修复(修复了一个问题)
  • 新功能(添加了非破坏性的功能)
  • 破坏性变更(会导致现有功能无法正常工作)
  • 文档更新
  • 代码风格/重构
  • 测试

测试

请描述你做了哪些测试来验证你的改动:

  • 在 Windows 上测试通过
  • 代码已检查,没有 lint 错误

截图(如果适用)

补充信息

WebFetchTool:
- charset-aware decoding (content-type → meta → utf-8) via TextDecoder
- convert HTML to Markdown fully, then truncate once by maxChars
  (no more mid-tag cuts or double truncation)
- single AbortController for the whole request+body cycle
- new optional params: maxChars, raw, timeoutMs, userAgent
  (UA is only sent when explicitly provided)

Telegram bot:
- add _renderWebFetch card "AI is browsing a page" with clickable
  link, HTTP status and body preview in a collapsible quote
- handle both success and error with a dedicated card
- add fetch.* i18n strings (ru/en)

Tests: extend WebFetchTool tests (charset, raw, maxChars, no mid-tag cut)
Revamp /sessions and /switch: add richer i18n (RU/EN) keys; implement live session reading from main (session-store + stats-store), formatted dates, short IDs and project labels; render sessions with per-session inline buttons and pager (pageSize=6); add callback handler (st_sw_) and direct main-process navigation (_navigateToSession) instead of relying on injected window.electronAPI; improve error messages and switch feedback. Also remove a stale test temp session file.
Read sessions directly from the main process (sessionStore + stats-store) instead of injecting window.electronAPI into the main world, which could be unavailable and caused a stale session list and silent /switch. Always re-read the list (drop the _pagers cache). Show all sessions when no project is selected, filter by project otherwise; display the project folder name (basename) with a small short-id footnote, human-readable dates (e.g. 'today, 14:30') and sorting by lastSeen; each session is an inline button (st_sw_<idx>) with the active one marked. Fix /switch by navigating directly from the main process via win.webContents.loadURL with clearer errors and a /sessions hint. Add /init: an inline file browser (drives -> folders, Up navigation, pagination, 'Select this folder' / 'Cancel') that opens a new chat, binds the folder as pendingProjectDir, builds the project system prompt and sends it via initial-prompt after did-finish-load. Update /help and i18n (init.*, common.cancel, help.cmd.init in ru and en).
…ommand

DeepSeek toggles were matched by button text (deepthink/search), which fails on localized pages (e.g. ru: «Глубокое мышление»/«Умный поиск»). Now select by .ds-toggle-button order: [0]=DeepThink, [1]=Search. Also register the /init command for ru and en.
@merfiDEV
merfiDEV merged commit b3c4099 into master Oct 14, 2026
1 check failed
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