Configuration admin page: four deferred review nits from #1988

未关闭
#2,033 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

Start with src/features/admin/configuration/index.tsx, getConfiguration.ts, useUpdateConfiguration.ts, and api.patch.d.ts, then check the repo-wide import and query conventions and the generated API types from central-manager’s openapi.json. The issue lists four deferred review nits, but three depend on repo-wide decisions or growth; agree on which changes Studio wants before editing. Done means the selected conventions are applied consistently and the Configuration page still works.

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

描述

Cross-model review of #1988 (the Admin → Configuration page) raised four nits that were deferred rather than fixed in that PR. Three match how the rest of Studio is written today, so each one says what the repo-wide change would be rather than proposing a one-off fix for this page.

1. Local imports omit file extensions

src/features/admin/configuration/index.tsx imports its siblings without .ts/.tsx extensions. This is Studio's convention: about 1 in 1,500 relative imports under src/ carries an extension. It is only worth acting on if Studio decides to adopt extensioned imports everywhere; otherwise close this item.

Review-Deferral: e3cf9431bf9907fc severity=nit category=maintainability

2. The filter redoes work for every row on each keystroke

Typing in the filter box:

  • lower-cases every key's name and description;
  • re-stringifies every row's value through formatValue.

The closed edit dialog also parses its placeholder value on every render. With the current few dozen keys this costs nothing measurable. If the table grows, memoize the formatted and lower-cased strings per entry alongside the query data.

Review-Deferral: c061a4cfe6c1e8e6 severity=nit category=performance

3. Double casts instead of generated types

getConfiguration.ts and useUpdateConfiguration.ts cast data as unknown as AdminConfigurationEntry[], and api.patch.d.ts carries a hand-written AdminConfigurationEntry, because Studio's generated API types predate the superUserOnly flag. Every other admin query does the same (regions, organization regions, locations). Central-manager's openapi.json on main now includes superUserOnly. Regenerating Studio's types from it would let this page drop both the patch type and the casts.

Review-Deferral: 64d604298c694ca2 severity=nit category=maintainability

4. Exports with no consumer outside their own file

These exports are used only inside their own file:

  • getConfiguration and ParsedValue;
  • updateConfiguration and UpdateConfigurationInput.

(parseConfigValue and jsonType are used by the page's tests.) Other query and mutation modules export their fetch functions the same way. Drop the exports if Studio adopts an unused-exports lint rule; otherwise close this item.

Review-Deferral: 7244681086f2b812 severity=nit category=maintainability

🤖 Generated by Claude Code (Claude Opus 5.5); posted via @Devin-Holland.

主要语言
TypeScript
星标
5
派生
4
平均合并
1 天 12 小时
30 天内合并 PR
65

环境准备

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

从这里开始

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

HarperFast/studio 的其他 Issue

查看 HarperFast/studio 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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