Skip to content

feat: 房间标题可自定义(默认「聚众加密聊天房间」) - #9

Merged
Freecode100Year merged 1 commit into
mainfrom
feat/room-title
Oct 30, 2026
Merged

Freecode100Year merged 1 commit into
mainfrom
feat/room-title

Conversation

@Freecode100Year

Copy link
Copy Markdown
Owner

概要

任何人都可以给房间起标题,默认标题为「聚众加密聊天房间」。

  • 创建房间时:新增「房间标题」输入框(可选,最多 60 字),标题写进 <title>(浏览器标签页)和页面顶部大标题。
  • 改名:持有房间文件的人可以在「生成新文件:换中继或改标题」里修改或清空标题,房间钥匙和口令都不变。
  • 命令行:room --title、retarget --title。
  • 安全:
    • 标题按 HTML 文本转义;测试里故意输入 </title><script>…,确认不会多出脚本,整个文件仍能通过核验。
    • 去掉首尾空白,合并连续空白,拒绝控制字符和双向文本控制符。
    • 标题不参与任何密钥派生。
  • 空白文件也可以带 title,作为创建器和离线版页面的名称。

测试

  • 新增 test/title.test.mjs:默认标题、转义与注入、长度和字符限制、转换时保留/修改/清空、CLI、网页路径与构建结果逐字节一致。
  • browser-tests/generations.mjs:断网状态下创建带标题的房间;持有者改名后,房间号和口令密文不变,文件可通过核验。
  • 单元测试 82 项、Worker 10 项、9 个浏览器测试和 Pages 测试全部通过。

Generated by Claude Code

An optional config title (1-60 characters, normalized, no control or bidi
characters) is written, HTML-escaped, into <title> and the page heading.
Set it when creating a room; any holder can change or clear it when
regenerating the file (same key and password). CLI room/retarget take
--title. The title is outside every key derivation and is part of the
verified file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PCUwNSXQdqfDSugmFo4qmM
@Freecode100Year
Freecode100Year merged commit f168882 into main Oct 30, 2026
16 checks passed
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.

2 participants