DataView: support custom key labels (keyLabel callback)

オープン
#568 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
typescript
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
4
フォーク
0
平均マージ
16時間 28分
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

qoretechnologies/reqore のほかの issue

qoretechnologies/reqore の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。