A custom date format chrono can't render stops every recording from starting

未关闭
#3,912 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@patrickballard 已经在做这个了。

开始于 2026年11月6日。

  • #3913 来自 @patrickballard —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
rust
领域
backend, desktop

调研方向

Start by reading format_recording_project_name and cap_utils::moment_format_to_chrono, then inspect the existing recording_project_names_preserve_random_placeholder_in_window_title test for related behavior. Reproduce with {moment:YYYY 100%} and check how an unrenderable placeholder and placeholders in window titles are handled. Done means recording starts and the expected placeholder text is preserved; linked pull request #3913 is already open.

由索引模型根据 Issue 内容生成。

描述

Description

The default project name template accepts custom formats such as {date:DD/MM/YYYY} and {moment:YYYYMMDD}, and Cap's support assistant lists {moment:...} among the placeholders. format_recording_project_name turns the format into a chrono one with cap_utils::moment_format_to_chrono and renders it with datetime.format(&format).to_string(). That passes a % straight through, so a format chrono can't render, such as one ending in % or containing %Q, makes to_string() panic. The panic lands in the recording start task, so no recording can start until the template is changed.

Window titles reach the same code. {target_name} is substituted before the date placeholders are expanded, so a window titled "Notes {date}" makes a project named "Notes 2026-11-06 …", and a title containing {time:100%} fails the start the same way. {random} in a window title is already kept as it reads (recording_project_names_preserve_random_placeholder_in_window_title).

Reproduction
  1. Set Settings → General → Default project name to {moment:YYYY 100%}.
  2. Start a Studio recording.
  3. The recording doesn't start. The log shows recording start task died: task … panicked with message "a Display implementation returned an error unexpectedly: Error".

Seen with a debug build of main (da2c85eed) on macOS.

Expected

The recording starts, and the placeholder that can't be rendered is left as typed, as an unknown placeholder is. Placeholders inside a window title stay as they read.

主要语言
Rust
星标
24.2k
派生
2.2k
平均合并
1 天 10 小时
30 天内合并 PR
684

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CapSoftware/Cap 的其他 Issue

查看 CapSoftware/Cap 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。