Repository navigation
fix(app-shell): reconsider a dismissed or revoked default permission set in the suggested-bindings panel - #30266
Merged
Conversation
A dismissed (or revoked) row in SuggestedBindingsPanel drew only its state line. It now offers Reconsider, which calls the existing POST /security/suggested-bindings/:id/reopen door through a new reopenSuggestedBinding(id) client call; the row redraws as pending with Accept and Dismiss. Refusals (404 / 409 / 501) surface the server's message and re-read the list, as the other actions do. Strings: marketplace.suggestedBindings.reopen/.reopening/.reopenedToast in all ten locale packs; engine.studio.access.suggestReopen/.suggestReopening/ .suggestReopenedToast in en and zh. The de quote-pairing ratchet moves to 103 for the new quoted toast. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzezVANVfXzi7zxbUT8
Contributor
Author
|
domain:ui#1 · os-support-ai · session_01WGufzfE4V9fzZgJLrLDmMC 维护者速读(席位终稿)
席位核对 · ACCEPT · head
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Yibo Wang · project thread
Fixes #30199
维护者速读
POST /security/suggested-bindings/:id/reopen,但界面从没调用它,管理员点了「暂不」之后只能找开发者调接口才能反悔。SuggestedBindingsPanel.tsx里state === 'dismissed'的新按钮和act()的reopen分支;②suggestedBindingsApi.ts的reopenSuggestedBinding;③de-quote-pairing-3876.test.ts的计数从 102 调到 103(新的德语提示引用了权限集名)。pnpm --dir ui exec vitest run packages/app-shell/src/components/SuggestedBindingsPanel.test.tsx,预期 23 个用例全部通过。Clause-②: no
Metadata-protocol: none
What changes
SuggestedBindingsPanel: adismissedrow (a declined suggestion or a revoked acceptance; the server records both asdismissed) drew onlystrings.dismissedState(s). It now offers one action, Reconsider (suggested-binding-reopen-SET), which calls the re-open door. The server answers the row aspending, the panel puts that row in place, and it redraws with Accept and Dismiss (a re-openedguestrow redraws asguest: Dismiss, still no Accept). A success toast says the suggestion is open again and that nothing is granted until it is accepted. A refusal goes through the samecatchas Accept and Dismiss: the server's message as an error toast, then a re-read of the list.manage_metadatais refused the list (403) and the panel renders nothing. The re-open door enforces the same authority (assertDeploymentAuthority).suggestedBindingsApi.reopenSuggestedBinding(id), besidedismissSuggestedBinding:POST …/security/suggested-bindings/:id/reopen, through the sameparseOrThrow, so a 404 (SUGGESTION_NOT_FOUND), 409 (SUGGESTION_STATE) or 501 (NOT_IMPLEMENTED, a security service without the optional member) is thrown with the server's code, status and message.SuggestedBindingsStringsgainsreopen,reopeningandreopenedToast. The panel has two string tables, and each gets the keys in the locales it already carries:marketplace.suggestedBindings.*in all ten locale packs (ar, de, en, es, fr, ja, ko, pt, ru, zh), andengine.studio.access.suggestReopen/suggestReopening/suggestReopenedToastin the studio namespace (en, zh, the only two it has). zh: 重新考虑 / 重新打开中… .de-quote-pairing-3876.test.ts: the German toast quotes the set („{{set}}“), one more matched pair, so the two counts move 102 → 103 with a comment line each, as earlier keys did.Why
Issue #30199. The door has existed since the re-open work on the server side (
reopenAudienceBindingSuggestion, mounted inpackages/rest/src/security-routes.tsand the runtime dispatcher), and its contract says a dismissed or revoked row returns topendingand grants nothing until accepted. The Console never called it.Tests
SuggestedBindingsPanel.test.tsx(real panel, real client, stubbedfetchanswering the server's envelopes):POST …/sug_crm_reader/reopen, no confirm; the row redraws aspendingwith Accept and Dismiss, the toast shows,onResolvedgets the re-opened row;accepted;guest;isDefault), 404 (row gone; the re-read drops it) and 501 (no door; the dismissal stands) each show the server's message;scripts/ablation-replace.mjs,{state === 'dismissed' && (→{false && (): 7 failed / 16 passed, the 7 being every Reconsider pin; the controls stay green. Restored: blob equals HEAD,git diff HEADempty.Acceptance notes
reopenAudienceBindingSuggestionrefuses only a row whosestatusis notdismissed, anddismissAudienceBindingSuggestionwritesstatus: 'dismissed'for both a decline and a revoke. Live: a revoke answereddismissed, and re-opening it answeredpending,deployment_decision: false.isDefaultset,examples/app-showcase'sshowcase_member_default, boots as a baseline row (confirmed,deployment_decision: false), which this panel does not draw and the server will not dismiss. So the live leg used the closest fixture: on the showcase dev boot, a writable packagecom.qa.reopenmade over the API, holding an objectreopen_note(public_read) and anisDefaultpermission setreopen_member_defaultthat grants read on it. Its suggestion lists aspending./securitydoors reading the environment kernel). That is outside this PR.Verification
Live: dismiss, reconsider, accept in Studio's Access pillar; an invited member then reads the object
Showcase dev boot (
pnpm dev -- --fresh), Console via Vite withDEV_PROXY_TARGET, Playwright as admin in zh-CN at/studio/com.qa.reopen/access. The served panel source was checked to contain the new test id before the run. Screenshots:/mnt/project-files/ui-orders/30199-shots/(project files).Invited member (
invite-member+sign-up/email):GET /data/reopen_note403 before the accept, 200 after it.GET /security/suggested-bindingsas the member: 403, so the member sees no panel.API legs on the same boot: revoke →
dismissed; reopen of the revoked row →pending, and the member still reads 403 (a re-open grants nothing); reopen of a pending row → 409SUGGESTION_STATE; unknown id → 404SUGGESTION_NOT_FOUND; the member calling reopen → 403PERMISSION_DENIED.Suites, type-check, lint, gates
All at head
ca174078, each underos-verify-lockwhere it builds or tests.pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/components/SuggestedBindingsPanel.test.tsx packages/i18n/src/__tests__/de-quote-pairing-3876.test.tsexit 0 (2 files, 32 passed).@object-ui/i18nwhole suite + the panel: exit 0 (96 files, 1,466 passed, 13 skipped).MarketplacePackagePage.*test files that render it andStudioDesignSurface.accessSegment-12452.test.tsx: exit 0 (6 files, 36 passed).pnpm --dir ui --filter @object-ui/app-shell --filter @object-ui/i18n run type-check(both scripts echoed,tsc --noEmitandtsconfig.test.json): exit 0.npx eslinton the five touched app-shell files: exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack→ 35 commands, each run and recorded; all 35 exit 0.--ranreconciliation: "35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED". The list is at/mnt/project-files/ui-orders/30199-gates-ran.list(project files).Human Minimum
packages/specholds no runtime logic. (No spec change.)pnpm lintpasses. (Touched files linted; the repo-wide run is CI's.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code