[Bug]: PDF attachment chips look like errors because the file-type colour is applied to the whole chip in red

未关闭 适合新手
#33,044 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
67/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

从 apps/web 开始,追踪共享的附件芯片样式以及 issue 中提到的 PDF 颜色令牌。检查芯片如何将强调色应用于图标、文件名和大小,并与无效状态进行比较。完成标准是:正常的 PDF 芯片保留 PDF 颜色提示,同时其文本与周围文本颜色一致;失败的芯片仍明显显示为错误。

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

描述

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/web

Steps to reproduce
  1. Use the default theme.
  2. Attach any valid PDF in the composer, or send a message with one.
  3. Look at the attachment chip.
Expected behavior

A healthy PDF attachment looks healthy. The chip can carry a PDF cue, but it shouldn't read as an error.

Actual behavior

The icon, filename and size all render in red, so a successful attachment looks like a failed upload.

Details from reading the built app:

  • --context-chip-doc-pdf is a fixed oklch(0.62 0.16 24), and only its lightness is adjusted for contrast per theme.
  • --context-chip-ink is bound to the accent and drives the label and the icon stroke, so the file-type colour takes over the whole chip.
  • The shared chip's invalid state uses --context-chip-invalid, which comes from errorForeground. That is usually a red close to hue 24, so a healthy PDF and a failed chip can be almost the same colour. On my custom theme, the healthy chip (about #f0706c) is more saturated than the error colour (#e07878).

Suggested fix: keep the accent on the icon only and let the filename and size inherit the surrounding text colour. The PDF cue stays, and red text can be reserved for real failures. A theme token for document chip colours would also help custom themes, as these colours can't currently be set from a theme file as far as I can tell.

Impact

Cosmetic issue

Version or commit

T3 Code (Beta) 0.1.7

Environment

macOS (Darwin 27.0.0), desktop app

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
8 小时 26 分钟
30 天内合并 PR
133

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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