Skip to content

[SCAL-332718]: add menuIndex to CustomAction, validate it as MENU-only - #724

Open
tushardeepakts wants to merge 2 commits into
mainfrom
SCAL-332718
Open

tushardeepakts wants to merge 2 commits into
mainfrom
SCAL-332718

Conversation

@tushardeepakts

@tushardeepakts tushardeepakts commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds optional menuIndex to code-based custom actions, allowing developers to control where MENU actions appear in the "More" menu.

Changes

  • Added optional, 1-based CustomAction.menuIndex.
  • Validated menuIndex for Liveboard, Viz, Answer, and Spotter targets. Only MENU actions support it; other positions return INVALID_MENU_INDEX_POSITION.
  • Actions are sorted by menuIndex (stable for ties), followed by actions sorted alphabetically.

Host Dependency

The SDK validates and orders actions; blink-v2 handles inserting them into the specified menu slots.

image image

@tushardeepakts
tushardeepakts requested a review from a team as a code owner October 23, 2026 05:54
@tushardeepakts tushardeepakts changed the title Scal 332718 [SCAL-332718]: add menuIndex to CustomAction, validate it as MENU-only Oct 23, 2026
@tushardeepakts tushardeepakts self-assigned this Oct 23, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds support for a menuIndex property on custom actions to specify their position in the menu, and enforces a limit of two primary actions per target. The reviewer identified that the implementation incorrectly preserves the original input order of actions with a menuIndex rather than sorting them by their index value. They provided actionable code suggestions to sort these actions ascendingly by menuIndex and to update the corresponding unit tests to verify this behavior.

Comment thread src/utils/custom-actions.ts Outdated
Comment thread src/utils/custom-actions.spec.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@thoughtspot/visual-embed-sdk@724

commit: b740a1b

This branch has not been deployed

No deployments
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