Skip to content

RI-8222: Inline value edit for array elements#6115

Open
pawelangelow wants to merge 14 commits into
mainfrom
fe/RI-8222/implement-modify-ui
Open

RI-8222: Inline value edit for array elements#6115
pawelangelow wants to merge 14 commits into
mainfrom
fe/RI-8222/implement-modify-ui

Conversation

@pawelangelow

@pawelangelow pawelangelow commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Makes a populated value editable in place in the Array View table. Clicking a value opens the shared inline editor
(EditableTextArea, same as List); saving issues ARSET via a new
updateArrayElementAction thunk with an optimistic value swap. Empty slots stay
read-only and the index is never editable (delete + re-set instead).

Screen.Recording.2026-06-25.at.13.46.39.mov

Note

Medium Risk
Introduces live Redis writes and optimistic UI patching with several race/tab edge cases; mitigations are tested but wrong-key or stale-response bugs would corrupt displayed data.

Overview
Adds in-place editing for populated array slots in View and Search tables (same EditableTextArea pattern as List). Saving calls array/set-element via new updateArrayElementAction, with an optimistic value update in both data.elements and search.data.

Empty slots stay read-only. Edits are gated on format/compression/unprintable bytes, and blocked while range/search reads or an ARSET is in flight so late fetches cannot stomp the patch. Only the active tab drives header refresh lock; hidden mounted tables abandon editors and release refresh correctly.

On success the thunk clears/aborts aggregate (AROP), refetches key info (size), and uses request tokens + key matching so overlapping or stale writes do not unlock the UI or patch the wrong key.

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

@pawelangelow pawelangelow self-assigned this Jun 25, 2026
@pawelangelow pawelangelow requested a review from a team as a code owner June 25, 2026 10:47
Comment thread redisinsight/ui/src/slices/browser/array.ts
@jit-ci

jit-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87fe6ff924

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/slices/browser/array.ts Outdated
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.07% 18006/22771
🟡 Branches 61.88% 8373/13529
🟡 Functions 66.85% 2447/3660
🟡 Lines 78.68% 16944/21535

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.42% 26188/31393
🟡 Branches 68.98% 11099/16091
🟡 Functions 78.69% 7024/8926
🟢 Lines 83.89% 25540/30445

Test suite run success

7434 tests passing in 836 suites.

Report generated by 🧪jest coverage report action from 87fe6ff

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c91de78759

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/slices/browser/array.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 297b7b6a4c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/slices/browser/array.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63900b56c6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/slices/browser/array.ts Outdated
Comment thread redisinsight/ui/src/slices/browser/array.ts Outdated
Comment thread redisinsight/ui/src/slices/browser/array.ts Outdated
Comment thread redisinsight/ui/src/slices/browser/array.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2afd349. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2afd3490c8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/slices/browser/array.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3b64fab65

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08f015b52d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/slices/browser/array.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d8c4c0d5a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/slices/browser/array.ts
Base automatically changed from be/RI-8222/add-backend-for-modifying-index-values to main June 26, 2026 11:40
pawelangelow and others added 11 commits June 26, 2026 14:55
Use the selected key's name for ARSET instead of the array slice's
`data.keyName`, which is only set after a View range/scan — so edits from the
Search tab (or before View loads) no longer POST an empty key. Patch
`search.data` alongside `data.elements` in the optimistic update so Search-tab
edits reflect immediately. Re-enable the key-header refresh on unmount and key
change so an open editor can't leave it stuck disabled.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Track an in-flight `updating` flag so the value editor is disabled and the
key-header refresh stays paused until the ARSET settles — a concurrent edit or
refresh can no longer race the optimistic patch. Drive the shared refresh flag
from the visible tab only: an inactive table reflects just the global write and
abandons its open editor when hidden or unmounted, so an editor left open in a
background tab (or when switching to a tab without a table) can't leave refresh
stuck disabled.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Skip the optimistic ARSET patch when the user switched to another key before
the POST resolved, so a late success can't overwrite a same-index row in the
newly selected key. Split the refresh-disabled effect so only the active tab's
table reacts to its editor; an inactive table reflects just the global write
and never re-enables refresh while the visible table has an editor open.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SearchTab now requires `isActive`; the spec's render helper was missing it
(TS2741).

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Locks in that opening an inline edit in the active array table keeps the
key-header refresh paused even when the other tab's table is mounted (hidden) —
the inactive table's effect reacts only to isActive/updating, not the active
table's editor.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Tie the `updating` lock release to the latest edit via a request token, so a
stale ARSET completing after a key switch (which resets the slice and lets a
newer edit start) can't release the lock for the newer in-flight write. Also
clear any stored AROP result on a successful edit, so returning to the
still-mounted Aggregate tab doesn't show a number computed before the change.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The stale-key guard on a successful ARSET used `===`, but key names are
RedisResponseBuffers and Redux can swap the instance for the same key (e.g. a
key-info refetch) while the POST is in flight. Reference equality would then
wrongly skip the optimistic patch, leaving the old value on screen despite a
successful write. Compare by bytes (isEqualBuffers), matching how key identity
is checked elsewhere; strict equality is kept for plain-string names.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Editing a value to a different byte length changes the key's Size even though
ARLEN/ARCOUNT don't. The success path only stamped lastRefreshTime, so the
header kept the old size while looking freshly refreshed. Dispatch
refreshKeyInfoAction (which refetches info and stamps the time) instead,
matching the List/Hash/String value-edit thunks.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The View/Search Run/Reset controls were gated only by their own readiness, so a
user could reload the table while a value editor was open or an ARSET was in
flight — losing unsaved input or racing the optimistic patch. Gate both forms
on the selected key's `isRefreshDisabled` (which the active table already sets
to `editingIndex !== null || updating`), the same signal that pauses the header
refresh.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Block opening an inline edit while a range/scan request is in flight (feed the
table loading state into the edit lock), so a late refresh response can't
overwrite the optimistic patch with pre-edit rows. On a successful edit, also
abort any in-flight AROP before clearing the stored aggregate — otherwise its
late success would repopulate the result that was just cleared.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pawelangelow and others added 2 commits June 26, 2026 14:57
Generalise the edit lock so it pauses while a range/scan OR search request is
in flight, read from the slice rather than the per-tab `loading` prop. This
covers the cross-tab case the prop missed (a search loading on the hidden
Search tab while editing in View, or vice-versa), so no read that writes
data.elements/search.data can be in flight across an edit and overwrite the
optimistic patch. Combined with the existing edit-time lock on the query forms
and header refresh, this closes the edit-vs-read race class.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pawelangelow pawelangelow force-pushed the fe/RI-8222/implement-modify-ui branch from 0d8c4c0 to 887e383 Compare June 26, 2026 12:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 887e3832e5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Feeding `loading` only into `isEditDisabled` gated opening an edit, but
EditableTextArea ignores that once editing — so a range/scan/search read that
started just before the refresh-disabled flag took effect could be Saved into,
and its success would overwrite the optimistic patch. Also gate the editor's
Save (`isLoading`) on the read, closing the already-open-editor window.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant