Files
Piik/docs/reference/naming.md
T
AAA 9150e9d312 feat(app): improve startup, diagnostics and direct connections (#397)
## Problem and outcome / 问题与结果

Machines with several local addresses could fail before opening Piik, and startup or connection failures were difficult to diagnose. This phase adds Local invitation-address selection and accessible diagnostics, preserves useful startup errors, and repairs media preparation and recovery without changing room authority or routing policy. It also aligns language handling, playback, public downloads and contributor documentation with the resulting behavior.

## Release notes

### 中文

- **多网卡也能正常选择启动方式。** 本地房间在需要时显示网卡名称与局域网地址,供你选择朋友所在的网络;公网邀请和连接已有站点不再因多个局域网地址而无法启动。
- **更容易排查启动和连接问题。** 启动页新增“诊断启动”,同时记录 App 与网页诊断;网页版也有独立诊断入口。启动失败会显示具体原因和重试方法,Windows 双击启动后的错误会停留等待确认。诊断模式下异常退出会保存报告,ZIP 由用户自行保留或清理。
- **减少连接准备中的无谓等待。** 普通候选发现不再等待可选端口映射;修正连接重启时旧候选与完成通知的处理,以及部分准备失败后的反馈。Native 媒体连接可在网络支持时使用 IPv6 直连,同时保留 IPv4 路径。
- **修正分享恢复中的状态问题。** 切换画面后重新计算首播保护所需的新帧;SFU 恢复时应用最新画质设置;一次应答发送失败不再使整个会话失去 Native 接收能力。密码错误提示也进行了去重。
- **改善播放与全屏交互。** 同步 Safari 原生全屏中的播放、音量与退出状态;可操作的视频画面显示手形光标。
- **统一语言匹配并完善翻译贡献。** 简体、繁体中文系统均默认显示简体中文,其余系统默认英文;保留中英文与纯视觉模式快捷切换,提供中英文社区翻译教程和额外语言接入方式。
- **整理下载与官网说明。** Release 附件集中展示三个平台的 App ZIP 和 Server 程序包,源码版本与校验值收进更新说明的折叠区。官网保留内嵌短片,并提供独立观看链接;教程、下载文案和运维指南同步更新。

**升级:** App 请完整解压对应平台的 ZIP 并保留目录结构。服务端按部署指南升级,保留现有配置与 SQLite 数据。此次更新不改变现有通信协议和存储格式。

**测试范围:** 主要验证 Windows App 与桌面浏览器。macOS、Linux 实机采集和移动端、跨公网 IPv6 的更广泛验证仍待完成,欢迎试用反馈。

### English

- **Choose how to start on machines with multiple network addresses.** Local rooms show interface names and invitation addresses when a choice is needed. Public invitations and connections to an existing Site no longer fail because several LAN addresses are available.
- **Diagnose startup and connection problems more easily.** The launcher now offers Debug launch for both App and browser diagnostics, alongside a separate browser diagnostics control. Startup failures include their cause and retry guidance; Windows errors remain visible for confirmation after a double-click launch. Failed exits in diagnostic mode save a report. Exported ZIPs remain available until you move or delete them.
- **Remove unnecessary connection setup waits.** Ordinary candidate discovery no longer waits for optional gateway mapping. Fixes cover stale candidates and completion signals during ICE restarts, and feedback from failed connection preparation. Native media can use direct IPv6 connections where available while retaining IPv4 paths.
- **Keep sharing recovery aligned with the current source and settings.** Source changes count new frames for startup protection, SFU recovery uses the latest quality preferences, and one failed answer submission no longer disables Native receiving for the entire session. Duplicate password-error feedback has also been removed.
- **Improve playback and fullscreen interaction.** Safari native fullscreen now synchronizes playback, volume and exit state. Interactive video surfaces show a pointer cursor.
- **Align language selection and community translation guidance.** Simplified and Traditional Chinese system locales select Simplified Chinese; other systems default to English. Chinese, English and visual-mode shortcuts remain, with bilingual translation guides and a registration path for additional languages.
- **Simplify release downloads and refresh the website.** Release attachments contain the three App ZIPs and the Server runtime archive; source identity and checksums appear in a collapsed section of the release notes. The website keeps its embedded introduction and adds a standalone viewing link, with updated setup, download and operations guidance.

**Upgrading:** Extract the complete App ZIP for your platform and keep its directory structure. Follow the deployment guide for Server upgrades, preserving existing configuration and SQLite data. Existing wire contracts and storage formats are unchanged.

**Test coverage:** Windows App and desktop browsers are the primary validated paths. Physical macOS/Linux capture, broader mobile coverage and IPv6 across separate public networks remain open; testing and feedback are welcome.

## Verification / 验证

- `npm run check`: PASS, including TypeScript, 807 tests in 60 files and the production Web build.
- `npm run check:client`: PASS on Windows, including Go formatting/tests/vet, Windows/Linux core builds and native Windows capture compile/probe. Darwin requires the native macOS CI runner.
- `npm run gate:client-media`: PASS with Chrome 152 and a real captured test window on Windows. Two receivers obtained video and audio; live and paused profile changes, recovery frames and cleanup passed. This is a single-machine test, not a public-NAT success-rate measurement.
- `npm run gate:client-link`: PASS using the newly packaged Windows App. A separate remote machine fetched its temporary public page and completed the WebSocket upgrade; App exit closed the link and cleanup passed.
- Server runtime and Windows App candidate packaging: PASS, including archive identity/checksums and execution from the extracted App ZIP. Native Linux/macOS package checks still run in the publishing pipeline before publication.
- `node scripts/check-docs.mjs`, `scripts/check-project-state.ps1`, `git diff --check` and `npm run build:website`: PASS. Seven documentation-size gardening advisories and the existing Vite chunk-size advisory remain non-blocking.
- Browser review: English/Chinese website setup and direct-download links, narrow layout and diagnostics/language controls checked. Native popover accessibility correctly exposes expanded/collapsed state without a duplicate attribute owner.
- Independent audit found no P0/P1/P2 issues; focused race checks for portmapping and mediaedge passed. Diagnostic archive accumulation is retained by the owner's explicit choice. The currently unreachable language menu placement issue is a first-community-language prerequisite in TODO.

Physical macOS/Linux capture, broader mobile behavior, restricted-network/endurance coverage and cross-network Native IPv6 remain explicitly outside this candidate's evidence.

## Impact / 影响

Compatible feature release, planned as v1.2.0 from v1.1.2. Browser/server v23, Native control v9, capture v7 and SQLite schema 2 remain unchanged. No new telemetry service, retry policy or configuration requirement is introduced. Public Demo remains open-entry and P2P-only. NAT-PMP dependency corrections are explicitly deferred to the next release and are not claimed here.

The existing product, configuration, translation, research and operations owners were updated. Raw audits, handoffs, diagnostic logs and experimental sources are excluded from the PR.
2026-09-13 18:32:24 +08:00

11 KiB

Naming And Copy

This is the naming convention for new and changed Piik code, UI and packaging. Use the brand for people and predictable lowercase identifiers for tools.

Voice And Terminology

Use the same role and action vocabulary in the App, Browser, website and guides. Role labels describe permission; a person's chosen nickname stays unchanged.

Meaning English Chinese
Person sharing and controlling the room Host 房主
Person watching Viewer 观众
Product capability Screen sharing 屏幕共享
Start sending a chosen screen/window Start sharing 开始分享
Enter another person's room Join a room 加入房间
Site-wide access secret Site passphrase 站点口令
Room-specific access secret Room password 房间密码

Write each language for its own audience. Chinese headings and welcomes may sound like friends inviting each other: “叫朋友来一起看。” or “沙发给你留着呢。” Do not translate English sentence structure or possessive screen metaphors literally (“和朋友一起看你的屏幕”). Use familiar Chinese verbs and a light touch; forced memes, baby talk and repeated slogans quickly become tiring.

The brand line is “Share the good stuff.” in English and “来,看点好康的。” in Chinese. Display the Chinese headline on two lines: “来,看点” / “好康的。” Keep metadata and ordinary prose as the continuous sentence.

Keep the public brand line consistent in the homepage, film ending and README opening, beside a plain screen-sharing description. Scene titles should name the action or benefit; do not turn every section into another slogan. Games, drawings, photos and movie nights show the range of screen sharing without implying voice chat, shared input or synchronized playback controls. Each locale must read naturally as a complete sequence, without depending on a pun from the other language.

Set the register by the reader's task:

Surface Register
Website Light, everyday language in introductions and illustration captions; keep the current restraint
README A friendly introduction, followed by direct explanations of features, limits and first steps
Documentation index Clear topic names and short descriptions that help readers choose a guide
Deployment, configuration and maintenance guides Formal, precise instructions: prerequisites, actions, expected results and recovery steps

Formal means clear and factual, not bureaucratic. Keep detailed procedures free of jokes and promotional slogans; do not carry the website's playful headings into technical instructions.

State the requirement, action or result directly. Omit negative comparisons that answer an abandoned design or an internal discussion: “解压后运行” is enough; listing the runtimes a packaged App does not require adds no useful next step. Include an exclusion only when it resolves a real reader choice or limitation.

Write tutorials from an explicit starting point: what the reader needs, which visible action to take, and what appears next. Distinguish watching an invitation, creating an App room, using an existing site, and deploying a server. Say where the site or download comes from; “follow the prompts” cannot stand in for a missing prerequisite. Mark passwords and audio options as conditional when they are optional. Keep App and Server package names distinguishable at download links. Public platform notes say what has been tested and invite useful feedback; internal phrases such as “this phase's acceptance target” belong in status.

Use progressive disclosure on the website and in the film:

Information layer Reader's question Content
First view: navigation, headings, feature cards, film titles What does it do, how do I start, what does it cost? Familiar actions and concrete benefits: “开箱即用”, “免费使用”, “朋友点开就能看”
Expanded details, supporting text and FAQ answers Will this work for me, and why? Platform/network conditions, explained technical terms and links to the relevant guide
README, wiki and operational guides How do I configure, verify or troubleshoot it? Exact action names, prerequisites, commands, configuration and evidence limits

The layer follows the reader's task, not font size alone. Keep material costs, availability and limitations beside the claim or action they qualify; do not hide them behind a collapse. Never promote an implementation mechanism such as encoding reuse or STUN as an unexplained headline. Explain technical terms on first use even in detailed documentation. Plain wording must preserve the original bounds: “开箱即用” does not promise offline use or guaranteed connection, and reduced repeated work does not establish a universal CPU saving. Lead performance copy with the user benefit (low latency, efficient sharing), then explain the supporting mechanism and its conditions. “Lowest latency”, “zero delay” and comparative resource savings require matching measurements; an architectural preference alone does not establish a benchmark result.

Write Chinese and English headings independently. Break lines at complete phrases, never inside a short action such as “画上两笔”. A decorative number must have an adjacent meaning/unit (“使用费用 0 元”), and its label must remain visible in both languages and at the smallest supported width. Check the actual rendered headline after rotation and animation settle: all meaningful words need room inside the frame. Oversized background lettering may crop; primary copy may not.

Download/availability labels, platform requirements, instructions, permission prompts, status and errors stay plain and specific. Use the exact visible action names in tutorials; a playful caption never replaces “Download”, “Join a room” or a platform/connection limitation. Explain what happened, what the user can do next, and any real limitation. Jokes belong in the welcome or illustration caption. Do not soften a failure into a joke, invent connection progress or promise guaranteed connectivity or absolute privacy. Screen sharing includes games, creative work and showing a useful discovery.

Operational pages omit introductory sentences that repeat their controls. Helper text should explain a meaningful choice or prevent an error.

Use short, contextual references in opening lines and illustration reactions. A familiar expression may work when its ordinary meaning still makes sense to someone who does not recognize it. Keep each language independent and avoid long dialogue, borrowed brand slogans or a stream of unrelated memes. Match a celebration to a visible successful action; it must not precede the result. Keep the small bilingual set local, without a quotation service. The visual language owns where these lines appear.

Product And Tool Names

Surface Convention Example
Product and repository Piik TNTcraftHIM/Piik
Standalone application Piik App Window title, documentation, shortcuts
Hosted service in prose Piik Server Deployment instructions
Executables and command directories Lowercase, hyphen-separated piik-app[.exe], piik-server[.exe], cmd/piik-app
Native capture executable Lowercase component name piik-capture[.exe]
App download archives Lowercase, fixed target name within each release piik-app-windows-amd64.zip
Package/build directory names Lowercase and target suffix piik-app-windows-amd64
macOS application bundle Display name, standard extension Piik App.app
Linux desktop entry Lowercase file/Exec, display Name piik-app.desktop, Exec=piik-app, Name=Piik App
Package and service identifiers Lowercase npm piik, systemd piik.service, tv.piik.app
Environment variables Uppercase snake case PIIK_DEBUG, PIIK_LOG_DIR
Go module path Exact repository spelling github.com/TNTcraftHIM/Piik

Use the same lowercase binary names across platforms for predictable commands. Piik App.app is the user-facing macOS bundle. The packager owns archive contents and directory layout. Keep platform/standard spellings such as Info.plist, LICENSE, README.md and REVISION. Do not change third-party names or notices to fit this table. Immutable measurement records keep the paths and hashes of their measured revision; they are evidence rather than current command examples.

Code ownership and vocabulary

The engineering module map owns directory responsibilities. HTTP/WebSocket clients, signaling clientId, protocol clients and similar connection roles remain client; they do not name the standalone App.

  • Follow each language's semantics: lowercase Go packages, exported PascalCase and unexported camelCase; existing TypeScript component/type conventions. Brand casing must not change visibility or create unnecessary name prefixes.

Renaming the standalone product is not a protocol or persistence change. Keep discovery, wire and stored identifiers at their current contracts. Their change rules belong to versioning; do not add aliases or dual readers merely for a display rename.

Basis

Content layering reviewed 2026-09-12: NN/g's progressive disclosure defers secondary detail while preserving the primary task; GOV.UK's clear-language guidance keeps specialist content understandable. The layer assignments and Chinese examples above are Piik's application of those principles. NN/g's microcopy guidance puts clarity before concision and character; this also guides the balance between Piik's playful introductions and factual instructions.

Reviewed 2026-09-10. Desktop standards explicitly separate display names from executable identifiers; lowercase executable names are our portability convention.