Configuration admin page: four deferred review nits from #1988

Abierto
#2,033 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
5
Forks
4
Merge medio
1 d 19 h
PR fusionados (30 d)
144

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de HarperFast/studio

Todos los issues de HarperFast/studio

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.