feat(components): open the local file handoff to a non-Electron bridge - #11
Draft
pythonlearner1025 wants to merge 1 commit into
Draft
Conversation
`canUseElectronLocalFileSend` is the gate on the attachment fast path that hands bytes to the machine running the session instead of uploading them. It asks two questions: is this Electron, and is there an IPC bridge. Only the second one is about the transport. Accept `window.__LODY_LOCAL_BRIDGE__` beside `isElectronRenderer()`, keeping the `Boolean(getIpcServices())` term that decides whether the channel exists at all. The `typeof window` guard is not decoration: `isElectronRenderer()` carries one, and without it the module would throw where it used to answer false. Model: claude-opus-5[1m]
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.
canUseElectronLocalFileSendis the gate on the attachment fast path that handsbytes to the machine running the session instead of uploading them. It asks two
questions: is this Electron, and is there an IPC bridge. Only the second one is
about the transport.
Accept
window.__LODY_LOCAL_BRIDGE__besideisElectronRenderer(), keeping theBoolean(getIpcServices())term that decides whether the channel exists at all.The
typeof windowguard is not decoration:isElectronRenderer()carries one,and without it the module would throw where it used to answer false.
Compatibility
Every change is additive at its default. With the new prop, parameter or flag
absent, the touched components render and behave exactly as they do today, and
no existing call site in this repository passes one.
Testing
packages/componentstypecheck and the full vitest suite pass.Notes for the reviewer
Stacked on
blitz/seam-1-non-electron-local-bridge, which declares the global this reads. Same caveat: a capability probe overwindow.ipcwould answer this equally well, and the bridge does serve the channel.Review metadata
BlitzOS fork only. Delete this section before sending the PR to
LodyAI/Lody.blitz/seam-3-local-attachment-bridge-gateblitz/seam-1-non-electron-local-bridge