Skip to content

RI-8222 Add "Add element" to the array View tab#6129

Open
pawelangelow wants to merge 3 commits into
be/RI-8222/add-array-append-endpointfrom
fe/RI-8222/add-array-element
Open

RI-8222 Add "Add element" to the array View tab#6129
pawelangelow wants to merge 3 commits into
be/RI-8222/add-array-append-endpointfrom
fe/RI-8222/add-array-element

Conversation

@pawelangelow

@pawelangelow pawelangelow commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What

Adds the Add element UI to the array key View tab, completing the Modify
vertical on the frontend. A right-aligned "Add Elements" action opens a slide-out
panel (reusing the shared AddItemsAction + AddKeysContainer chrome, so it
matches Lists / Vector Sets).

The panel takes a value and an optional index:

  • index left empty → append to the end (POST /array/append)
  • index provided → set at that index (POST /array/set-element)

An info icon next to the index field explains that leaving it empty appends to
the end. The index is validated against the canonical decimal form (matching the
backend @IsArrayIndex), and writes go through the production-write confirmation.

Notes

  • New slice thunks appendArrayElement / addArrayElement, both refreshing the
    key on success.
  • The index is carried as a string throughout (unsigned 64-bit contract).
Screenshot 2026-06-29 at 16 47 49 Screenshot 2026-06-29 at 16 47 37

Note

Medium Risk
Writes mutate production Redis array keys via new API paths; mitigations include production confirmation, index validation, and stale-key guards on success side effects.

Overview
Adds Add Elements to the array key View tab: a slide-out panel (shared with List/Vector Set chrome) where users enter a value and an optional index.

Empty index triggers POST /array/append; a provided index uses POST /array/set-element (overwrite at that slot, not insert). Index input is validated to canonical decimal strings (backend @IsArrayIndex); writes use production-write confirmation via new browser:add-array-elements.

New Redux thunks appendArrayElement and addArrayElement refresh the view and key header on success, but only when the target key is still selected (applyArrayWriteResult + byte-exact buffer compare). The form and View tab also guard against stale async callbacks and auto-close the panel on key change.

ArrayDetails / ViewTab wire optional telemetry hooks (onOpenAddItemPanel / onCloseAddItemPanel) like other key types.

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

@pawelangelow pawelangelow self-assigned this Jun 29, 2026
@pawelangelow pawelangelow requested a review from a team as a code owner June 29, 2026 13:49
@jit-ci

jit-ci Bot commented Jun 29, 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: fe86d4eb36

ℹ️ 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
@pawelangelow pawelangelow force-pushed the be/RI-8222/add-array-append-endpoint branch from b644fec to a347afe Compare June 29, 2026 13:55
@pawelangelow pawelangelow force-pushed the fe/RI-8222/add-array-element branch from fe86d4e to af510ae Compare June 29, 2026 13:55

@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: af510ae25e

ℹ️ 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 29, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.09% 18041/22808
🟡 Branches 61.91% 8397/13563
🟡 Functions 66.9% 2450/3662
🟡 Lines 78.7% 16978/21571

@pawelangelow pawelangelow force-pushed the fe/RI-8222/add-array-element branch from af510ae to 4dbfb8e Compare June 29, 2026 14:08
@pawelangelow pawelangelow force-pushed the be/RI-8222/add-array-append-endpoint branch from a347afe to 05cd432 Compare June 29, 2026 14:09
@pawelangelow pawelangelow force-pushed the fe/RI-8222/add-array-element branch from 4dbfb8e to 94043f0 Compare June 29, 2026 15:28

@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: 94043f0ee3

ℹ️ 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
@pawelangelow pawelangelow force-pushed the fe/RI-8222/add-array-element branch from 94043f0 to 8e5b8c9 Compare June 29, 2026 17:18

@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 8e5b8c9. Configure here.

setValue('')
setIndex('')
closePanel()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing add success telemetry

Low Severity

After a successful append or set-element, handleSuccess clears the form and closes the panel but never emits the browser “key value added” telemetry that List, Hash, Set, and Stream add panels send on success, so array adds are invisible to the same analytics pipeline wired for open/cancel on this feature.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8e5b8c9. 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: 8e5b8c986c

ℹ️ 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
…ndex)

Add an inline "Add element" form in the View tab: a value input and an
optional index. Empty index appends to the end (POST /array/append, the atomic
ARSET-at-length); an explicit index sets there (POST /array/set-element). The
add is wrapped in the production-write confirmation, the index is validated as
a canonical decimal, and the View (range + length/count) is refreshed on
success so the new element appears.

ARINSERT is intentionally not used — see docs/array-modify-vertical-plan.md.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pawelangelow pawelangelow force-pushed the fe/RI-8222/add-array-element branch from 8e5b8c9 to 4ea0c84 Compare June 29, 2026 18:56

@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: 4ea0c84c0c

ℹ️ 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".

applyArrayWriteResult now gates the write's success side effects
(onSuccess/closePanel) on the live browser-context selected key matching
keyProp. The ArrayAddForm spec rendered with the default store, where
app.context.browser.keyList.selectedKey is null, so closePanel was never
invoked and the append test's assertion no longer held.

Render the form with a store whose selected key is the form's keyProp so the
success path runs, exercising the panel-close behaviour as it does in the app.

References: #RI-8222

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@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: fd02e63609

ℹ️ 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
The selected-key guard in applyArrayWriteResult is not enough: a user can
submit a write for key A, switch away, then return to A and open a fresh add
panel before the first request resolves. The live key is A again, so the guard
passes and runs the original form's handleSuccess, whose closePanel closes the
*current* (different) panel.

Guard handleSuccess with an isMounted ref so a form instance's success callback
no-ops once that form has unmounted; the refresh still runs (A is selected, the
write landed there). Adds a regression test that unmounts mid-flight and
asserts closePanel is not called.

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