Skip to content

Split FieldsSchemaEditor into smaller components#6217

Open
saidake wants to merge 9 commits into
redis:mainfrom
saidake:fe/feature/value-decoder-refactor
Open

Split FieldsSchemaEditor into smaller components#6217
saidake wants to merge 9 commits into
redis:mainfrom
saidake:fe/feature/value-decoder-refactor

Conversation

@saidake

@saidake saidake commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What

Refactors the value decoder FieldsSchemaEditor into smaller components.

  • Extracted field editing UI into FieldRow (including size-source handling)
  • Extracted repeat-block chrome into RepeatBlockEditor
  • Kept FieldsSchemaEditor as the orchestration layer for add/remove/reorder and nested editing

Increase the timeout of a test in redisinsight/ui/src/pages/browser/BrowserPage.test.tsx, as I encountered a UI CI timeout error:

FAIL redisinsight/ui/src/pages/browser/BrowserPage.test.tsx (72.576 s)
  ● KeyDetailsHeader › Verify that user cannot rename key name with unprintable characters and check tooltip

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      184 |   })
      185 |
    > 186 |   it('Verify that user cannot rename key name with unprintable characters and check tooltip', async () => {
          |   ^
      187 |     const { queryByTestId } = render(<BrowserPage />)
      188 |
      189 |     const afterRenderActions = [...store.getActions()]

      at it (redisinsight/ui/src/pages/browser/BrowserPage.test.tsx:186:3)
      at Object.describe (redisinsight/ui/src/pages/browser/BrowserPage.test.tsx:162:1)

Testing

The Value Decoder field schema continues to work as before:
image

image

Note

Low Risk
UI-only refactor of the value decoder schema editor with extracted pure mutation helpers and new unit tests; no API or security surface changes.

Overview
Refactors the value decoder FieldsSchemaEditor by pulling UI and state logic out of one large file while keeping behavior the same.

Field editing moves to FieldRow and FieldSizeEditor (name, type, fixed vs custom size, size-from-field refs). Repeat blocks use RepeatBlockEditor, which renders nested schema editing via children instead of calling FieldsSchemaEditor from inside the repeat component. Add/remove/reorder and field/repeat updates go through useSchemaEditor and exported pure apply* helpers (covered by useSchemaEditor.spec.ts).

toNumericOptions (numeric ref select labels, including duplicate-name disambiguation) is centralized in schemaUtils with unit tests. BrowserPage.test.tsx gets a 10s timeout on one tooltip test.

Reviewed by Cursor Bugbot for commit 3c91ce3. Bugbot is set up for automated code reviews on this repo. Configure here.

@saidake
saidake requested a review from a team as a code owner July 16, 2026 20:16

@pawelangelow pawelangelow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good - nice clean split, and simple is better IMO. The one thing I'd like before we merge is tests for the new components and the extracted logic; that's really the win from isolating them like this.

Comment thread redisinsight/ui/src/pages/browser/components/value-decoder/FieldsSchemaEditor.tsx Outdated
Comment thread redisinsight/ui/src/pages/browser/components/value-decoder/RepeatBlockEditor.tsx Outdated
Comment thread redisinsight/ui/src/pages/browser/components/value-decoder/FieldRow.tsx Outdated
Comment thread redisinsight/ui/src/pages/browser/components/value-decoder/FieldRow.tsx Outdated
@saidake

saidake commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

hi @pawelangelow
The PR has been updated, please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants