fix(web): keep readonly comment creation available - #6278
Conversation
PerishCode
left a comment
There was a problem hiding this comment.
The readonly annotation fix is focused and preserves the intended distinction between a new draft and a persisted authorless legacy comment. One independent behavior change is bundled into this hotfix and needs to be split before merge.
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.| defaultDesignSystemId={config.designSystemId} | ||
| agents={agents} | ||
| agentsLoading={agentsLoading} | ||
| amrLoggedIn={amrLoginStatus?.loggedIn ?? null} |
There was a problem hiding this comment.
Split the Cloud sign-in outage change out of this readonly-comment hotfix. This line starts an independent account-state behavior change that also modifies EntryShell.tsx, EntryView.tsx, adds entry-rail-account-state.ts, and adds two unrelated test groups (180 changed lines in the separate preserve Cloud sign-in during outages commit). The PR body scopes and validates only the annotation Comment CTA regression, so reviewers cannot evaluate the account-state change against a stated user problem or its own complete validation, and merging this focused bugfix would also silently change outage/sign-in behavior. Please remove that first commit from this branch and submit it as a separate PR with its own rationale and validation; keep this PR limited to FileViewer.tsx and its regression test.















Why
While dogfooding team workspaces, members and admins could select an element in a readonly shared project, but the annotation popover hid the Comment button. A newly-created draft was being treated as a persisted legacy comment with no author, incorrectly restricting it to the workspace owner.
This regression blocked normal review collaboration in readonly projects even though commenting is an explicitly allowed capability.
What users will see
Members and admins can select an element in a readonly team project, type an annotation, and click Comment in the element popover. Readonly restrictions still prevent edit/export and the send-to-Chat action remains unavailable.
Surface area
apps/weborapps/desktop(including Electron menu bar)odsubcommand or flag, newtools-dev/tools-packflag, or newOD_*env var/api/*endpoint, new SSE event, or changed shape inpackages/contractsskills/,design-systems/,design-templates/, orcraft/, or change to the skills protocolTRANSLATIONS.mdfor the locale workflow)package.json(dependenciesordevDependencies); workspace-packagepackage.jsonfiles are out of scope. Include a paragraph on what we get vs. what bytes we ship (seeCONTRIBUTING.md→ Code style)Screenshots
Not attached for this focused hotfix. The interaction path and the presence of the popover Comment CTA are covered by the regression test below.
Bug fix verification
apps/web/tests/components/FileViewer.test.tsx—keeps the Comment CTA for a new element annotation in a viewer-only team projectreadonly=""; the identical test passes after the fix.Validation
pnpm --filter @open-design/web test -- tests/components/FileViewer.test.tsx tests/components/BoardComposerPopover.actions-visible.test.tsx— 225 passed.git diff --check— passed.pnpm --filter @open-design/web typecheck— blocked by a pre-existing unrelated error inEntryNavRail.tsx:761:workspaceNameis missing fromWorkspaceCollabContext.