Skip to content

fix(FR-3874): feed the staged value back into renderInput controls - #9502

Draft
nowgnuesLee wants to merge 1 commit into
mainfrom
fix/FR-3874-render-input-staged-value
Draft

fix(FR-3874): feed the staged value back into renderInput controls#9502
nowgnuesLee wants to merge 1 commit into
mainfrom
fix/FR-3874-render-input-staged-value

Conversation

@nowgnuesLee

Copy link
Copy Markdown
Contributor

Resolves #9501 (FR-3874)

Symptom

A filter property that renders its own picker through renderInput (project select on the admin session list, user select on RBAC and the user folder permission panel, storage host select on the model store and the admin model card) loses its selection visually:

  • Pick an option in the edit popover: Apply enables, but the select snaps back to its placeholder, so the pick is invisible until Apply.
  • Click an existing token to edit it: the select opens empty instead of pre-populated.

Cause

Since the Astryx PowerSearch rebuild the picked value is staged in PowerSearch state and committed by the popover's Apply button. useRenderInputEditors (BAIPowerSearchAdapters.tsx) receives that staged value and isDisabled from PowerSearch but forwarded only onChange, and every call site pinned value={null} — the antd-era convention, where a pick committed immediately and the control had to clear itself.

Change

  • FilterRenderInput now receives value: string | null and isDisabled?: boolean; the cached editor passes them through. Serialization is untouched.
  • The five renderInput call sites feed value / isDisabled back into their select.
  • The stage/Apply contract prose lives once on FilterRenderInput; both filters' renderInput docs point at it.
  • Stories updated to the current contract (toLabeledValue helper maps the staged string to BAIComplexSelect's labeled value).
  • New BAIPowerSearchAdapters.test.tsx covers the pass-through and the label recording.

This is the value forwarding part of FR-3691 (#9089), split out so the visible defect can ship on its own. The entitySource redesign in #9089 is on hold (it drops the selects' scroll pagination).

Verification

=== ALL PASS ===   (bash scripts/verify.sh)

 Test Files  3 passed (3)
      Tests  107 passed (107)   (BAIPowerSearchAdapters, BAIPropertyFilter, BAIGraphQLPropertyFilter)

Live check against a local webserver (RBAC → 할당된 사용자): the picked email stays in the select with Apply enabled, the token reads the email while the URL carries the UUID, and re-opening the token shows the select pre-populated.

🤖 Generated with Claude Code

Since the Astryx PowerSearch rebuild a picked value is staged in
PowerSearch state and committed by the popover's Apply button. The
renderInput adapter received that staged value and the disabled state
from PowerSearch but forwarded only onChange, and every call site pinned
value={null} (the antd-era "clear after commit" convention). The select
therefore snapped back to its placeholder right after a pick, and editing
an existing token opened the select empty.

Forward value and isDisabled through FilterRenderInput, feed them back at
the five call sites, make FilterRenderInput the single home of the
stage/Apply contract prose, refresh the stories, and add an adapter test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

GitHub Pages may take up to a minute to hydrate after the deploy.

🧩 Changed Components

Component Changed Stories Open
BAIGraphQLPropertyFilter source + stories 19 Storybook ↗
BAIPropertyFilter source + stories 7 Storybook ↗
1 changed component(s) with no story to open
  • BAIPowerSearchAdapterspackages/backend.ai-ui/src/components/BAIPowerSearchAdapters.tsx
1 other changed file(s) in packages/backend.ai-ui/
  • packages/backend.ai-ui/src/components/BAIPowerSearchAdapters.test.tsx

📦 Bundle Size

File Size Gzip Δ Gzip vs base
backend.ai-ui.js 2068.8 kB 505.0 kB −0.0 kB

Total gzip: 505.0 kB (−0.0 kB vs origin/main)


Generated by the PR Preview workflow · Storybook · CI run

github-actions Bot added a commit that referenced this pull request Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)

Status Category Percentage Covered / Total
🔵 Lines 45.2% 4422 / 9783
🔵 Statements 39.75% 5207 / 13099
🔵 Functions 41.31% 837 / 2026
🔵 Branches 30.42% 3795 / 12474
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/backend.ai-ui/src/components/BAIGraphQLPropertyFilter.tsx 86.51% 69.81% 86.11% 93.06% 341, 348, 388, 535, 549, 552, 606, 616-618, 712, 718, 722-726, 730, 742, 758, 758, 759, 765-768, 775-783, 790, 791, 792, 800, 803
packages/backend.ai-ui/src/components/BAIPowerSearchAdapters.tsx 71.79% 61.11% 53.33% 76.47% 74, 91-99, 152, 165-166, 187
packages/backend.ai-ui/src/components/BAIPropertyFilter.tsx 86.84% 65.9% 90% 97.26% 304, 307, 342, 348, 349, 397, 404, 453, 454, 472, 527, 536, 540-544, 569, 576-581, 588, 589, 590, 598, 601-602, 603
Generated in workflow #332 for commit 49e4fff by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 15.63% 5692 / 36394
🔵 Statements 13.11% 6934 / 52866
🔵 Functions 13.69% 888 / 6482
🔵 Branches 9.48% 4795 / 50563
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/AdminModelCard.tsx 0% 0% 0% 0% 68-659
react/src/components/UserFolderPermissionPanelV2.tsx 0% 0% 0% 0% 38-192
react/src/pages/AdminComputeSessionListPage.tsx 0% 0% 0% 0% 56-531
react/src/pages/ModelStoreListPageV2.tsx 0% 0% 0% 0% 45-303
react/src/pages/RBACManagementPage.tsx 0% 0% 0% 0% 51-217
Generated in workflow #703 for commit 49e4fff by the Vitest Coverage Report Action

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property filter renderInput select does not show the staged value after the PowerSearch migration

1 participant