DataView: support custom key labels (keyLabel callback)

Aperta
#568 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

The issue identifies ReqoreDataView, its renderTree key chip, and IReqoreDataViewProps as the relevant implementation and API. Read those definitions first and check how onItemClick constructs root-relative paths; then add and test the optional label resolver with its raw-key fallback. Done when custom labels work for nested keys and existing behavior is unchanged when the callback is absent or returns undefined.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Context

ReqoreDataView renders each record key as a chip with the raw key string — in renderTree, the key tag is rendered with label: key and there is no hook to override it (checked 0.69.2: nothing in IReqoreDataViewProps or the implementation).

Consumers that render schema-described data often have friendly labels for those keys. Concretely: in qorus-ide / reqraft, a form field's arg_schema declares a display_name per key, so a hash rendered with ReqoreDataView shows schemaOption2 where the rest of the form shows "Schema option with arg_schema".

Suggestion

A per-key label resolver, analogous to how parseDate/parseEmbedded already externalise consumer-specific knowledge:

/** Resolve a display label for a record key. Return undefined to keep the raw key. */
keyLabel?: (key: string, path: string[]) => string | undefined;
  • path is the same root-relative path already passed to onItemClick, so nested keys can resolve against nested schemas.
  • Falls back to the raw key when the callback returns undefined — fully backwards compatible.
  • Possibly worth showing the raw key in the chip tooltip when a label overrides it, so the underlying data key stays discoverable.

🤖 Generated with Claude Code

Lingua principale
TypeScript
Stelle
4
Fork
0
Merge medio
16h 28m
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di qoretechnologies/reqore

Tutte le issue di qoretechnologies/reqore

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.