Repository navigation
UI Consistency: 1 issue found
apps/web/src/browser/HostedBrowserWebview.tsx β the new allowpopups="true" attribute on <webview> violates the element's typing contract: @types/react (19.2) declares WebViewHTMLAttributes.allowpopups?: boolean, so a string literal fails apps/web's tsgo --noEmit typecheck. The obvious "fix" of allowpopups={true} would typecheck but silently undo the behavior change, because react-dom removes boolean values for unrecognized attributes on non-custom tags. Suggested smallest fix (posted inline): keep the string value and spread it past the boolean type, mirroring the existing preload spread on the same element.
Details
Note
Your check run agent prompt is: .macroscope/check-run-agents/ui-consistency.md
More information about how Check Run Agents work can be found in our Help Center.
Methodology and evidence:
- In-scope changed file:
apps/web/src/browser/HostedBrowserWebview.tsx(theapps/desktopchanges were read for context only). - Ownership review: moving
allowpopupsfrom the imperativerefcallback onto the JSX element is the correct owner for an Electron attribute read at guest attach time; the explanatory comment about the Electron constraint is preserved and appropriate. No shared-primitive, Tailwind-ownership, theme-variant, scroll/mask, or environment-routing concerns are introduced by the diff. - Typing gate:
apps/web/tsconfig.jsonincludessrcandapps/web/package.jsonrunstsgo --noEmit;@types/reactis pinned at~19.2.14. Confirmed in DefinitelyTypedtypes/react/index.d.tsthatJSX.IntrinsicElements.webviewmaps toReact.WebViewHTMLAttributes<HTMLWebViewElement>and thatallowpopups?: boolean | undefined, soallowpopups="true"is astring-to-booleanassignment error. No repo-localJSX.IntrinsicElements/declare module "react"augmentation exists (only aHTMLElementTagNameMapdeclaration, which does not affect JSX typing). - Runtime gate: react-dom's unknown-attribute path removes
true/falsevalues and warns to pass a string instead (seeReactDOMAttribute-test.js, "changes values true, false to null, and also warns once"), so the string value is runtime-correct and must be retained; only the type needs to be satisfied. - Only
<webview>call site in the repo, so no cross-call-site inconsistency to reconcile.
π Agent activity β 20 tool calls
π I'm checking the change in HostedBrowserWebview.tsx where a ref-callback setting the allowpopups attribute was replaced with a direct JSX attribute, and considering whether React properly passes that attribute through since webview isn't a standard recognized element.
1. browse_code β apps/web/src/browser/HostedBrowserWebview.tsx
π I'm considering whether moving
allowpopupsto a JSX attribute could cause typing issues, since React doesn't natively know thewebviewtag and I need to check if there's a JSX.IntrinsicElements declaration for it somewhere.
2. git_tools β webview
3. git_tools β IntrinsicElements
π I recall now that React's built-in type definitions actually do include "webview" in JSX.IntrinsicElements, with WebViewHTMLAttributes covering its specific properties like allowFullScreen. Since
allowpopupsis typed asboolean | undefined, passing a string like"true"would trigger a real type error, which is worth flagging. React actually behaves oddly here: for unknown DOM attributes likeallowpopups, passing a booleantruevalue causes React to warn and skip rendering it, suggesting a string instead β so the string version is technically correct at runtime despite the type mismatch, which is a genuine conflict between React's types and its actual runtime behavior for webview's custom attributes. I want to check if there's custom JSX typing overriding this for webview elements, so I'm searching the repo for "allowpopups" and "WebViewHTMLAttributes", along with other places where<webviewis used.
4. git_tools β allowpopups
5. git_tools β <webview
6. git_tools β webview
7. git_tools β apps/web/src/browser/HostedBrowserWebview.tsx
π I'm checking why the ref-based approach for allowpopups was originally used, wondering if it was to work around React's typing conflicts for that attribute, and looking into whether the WebViewHTMLAttributes type actually supports it as a boolean. Confirming this in React's types, it seems allowpopups is typed as boolean, meaning
allowpopups="true"as a string would trigger a TS2322 type error since JSX.IntrinsicElements maps webview through React.WebViewHTMLAttributes. I'm verifying that the custom HTMLElementTagNameMap declaration for webview doesn't interfere with JSX resolution, and that the ref type is compatible since HTMLWebViewElement extends HTMLElement. Now I want to check the actual @types/react version pinned in the repo to confirm this behavior holds, and whether skipLibCheck or another tsconfig setting might suppress the error.
8. git_tools β "@types/react"|"react":
9. browse_code β apps/web/{tsconfig.json,package.json}
π I'm confirming that in the React type definitions, allowpopups is typed as an optional boolean, so passing it as the string "true" would actually be a type error. But I want to check whether this really matters at runtime β many codebases pass this pattern anyway. It's still worth flagging as a typecheck-level finding since it breaks strict typing in a scoped file. I'm also considering how React 19 actually handles boolean-valued props on custom elements or webview tags, since its attribute-setting behavior changed compared to earlier versions β whether it sets a DOM property, a string attribute, or drops it with a warning depends on those newer custom element rules. I'm reconsidering whether there's actually a real UI-consistency issue here at all, since the diff is just a one-line attribute move with a comment, unrelated to primitives, Tailwind, themes, or scroll. Then I look more closely at the removed line setting
allowpopupsviasetAttributeinside the ref callback, now replaced by a JSX attribute β that seems like the intended fix, and using the string "true" should render correctly for this unknown host element in React. I reconsider whether React 19 would warn about the string value, but conclude it wouldn't. Popup behavior from the guest webview is an Electron-side concern that's out of scope. The real reason for the fix seems to be timing: the ref callback ran after the element was already attached to the DOM, which was too late for Electron to register theallowpopupsattribute, whereas setting it directly via JSX solves that. So the only remaining question is whether the type should bestringorbooleanforallowpopups, which I want to verify against the actual@types/react19.2 definitions in the repo.
10. git_tools β allowpopups
π I've confirmed allowpopups is typed as a boolean in the current @types/react, so setting it as a string literal would be a type error. Now I need to check whether webview even appears in JSX.IntrinsicElements for this version.
11. git_tools β webview: React.DetailedHTMLProps
π I'm checking whether passing a string literal to the
allowpopupsboolean prop triggers a TypeScript error, and wondering if this type mismatch actually made it into the PR despite failing typecheckβpossibly due to how React 19's JSX intrinsic elements are typed. I'm also digging into React DOM's runtime behavior for unknown boolean attributes on custom elements like webview, tracing through the attribute-setting logic to see whether React 19 actually rendersallowpopups={true}correctly or drops it with a warning, unlike React 18's stricter handling. Checking whether an empty-string attribute value works around this β but Electron treatsallowpopupsas a boolean attribute where mere presence means true, and TypeScript still flags a string against the boolean-typed prop either way. So the real issue is clear: the JSX attribute is typed as a string while React'sWebViewHTMLAttributesexpects boolean, causing the typecheck failure, and switching to a boolean literal instead would just get silently dropped at runtime since React strips boolean values from attributes it doesn't recognize. I want to confirm there's no existing module augmentation for React or webview types elsewhere in the repo that already handles this case, so I'm searching for prior patterns of type casting ordeclare module "react"overrides before proposing a fix.
12. git_tools β <webview
13. git_tools β declare module "react"
π My grep for webview with escaped angle brackets came back empty, likely because the tool escaped my input. Let me try searching for "partition={" across the tsx files instead to find the relevant reference.
14. git_tools β partition={
15. git_tools β typecheck
π Since apps/web runs tsgo with strict checks, passing a string "true" for allowpopups would trigger a type error since that attribute expects a boolean and React 19's types should reflect that. I should verify the tsconfig settings to confirm strict mode is actually enabled for this file.
16. browse_code β apps/web/tsconfig.json
π I'm confirming the typecheck actually breaks here, and ruling out unrelated declarations as the causeβReact's JSX types are properly available via the devDependency. The simplest fix seems to be casting the spread props to bypass the type mismatch while preserving the runtime behavior. I'm weighing declaration merging on IntrinsicElements, which would conflict for the
webviewkey, versus a looser typed constant that gets spread onto the element to sidestep the strict boolean typing.
17. git_tools β Received %s for a non-boolean attribute|prefix !== 'data-' && prefix !== 'aria-'
18. git_tools β non-boolean attribute
19. browse_code β packages/react-dom/src/tests/ReactDOMAttribute-test.js
π I've confirmed booleans get dropped on unknown attributes while a string is needed at runtime, so this is a real conflict with the @types/react typing causing the typecheck failure in apps/web. I'm locating line 264 in the diffβ
allowpopups="true"βto attach an inline comment there, and now drafting the suggested fix. Working through the fix, a direct string-to-boolean type assertion isn't allowed by TypeScript, so I need to route it throughunknownfirst: casting the object tounknownthen to the expected boolean-typed shape before spreading it onto the element. That should satisfy the typechecker while still landing the string value at runtime. I'll format this as an inline suggestion replacing lines 261-264, note the alternative of a locally typed wrapper, and treat this as a concrete failure worth flagging in the review.
20. modify_pr β One finding in the web scope: the new allowpopups JSX attribute is the right ownership fix, but its string value conflicts with React's element typing, so apps/web typecheck (tsgo --noEmit) breaks. Details inline.
Agent Credits: 87 credits