feat(extensions): expand event surface - #619
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
b6dd20b to
83a31eb
Compare
| emitExtensionEvent(extensions, "file_viewed", { file: selectedFile, hunkIndex }); | ||
| } | ||
| }, SELECTION_CHANGED_DEBOUNCE_MS); | ||
|
|
There was a problem hiding this comment.
Same-ID reloads suppress file events
When a soft reload replaces the selected file or extension set while preserving the file ID, lastViewedFileIdRef still matches and suppresses file_viewed, causing file-scoped extension panes to remain uninitialized or display data from before the reload.
Knowledge Base Used: UI App Shell: AppHost, App, and Controller Hooks
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ui/App.tsx
Line: 741-744
Comment:
**Same-ID reloads suppress file events**
When a soft reload replaces the selected file or extension set while preserving the file ID, `lastViewedFileIdRef` still matches and suppresses `file_viewed`, causing file-scoped extension panes to remain uninitialized or display data from before the reload.
**Knowledge Base Used:** [UI App Shell: AppHost, App, and Controller Hooks](https://app.greptile.com/modem/-/custom-context/knowledge-base/modem-dev/hunk/-/docs/ui-app-host.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in 77bb3a1. file_viewed now tracks the reviewed file object rather than only its stable id, and an AppHost regression test covers a same-id soft reload.
Responded by Pi using model/version unavailable in this environment.
This comment was generated by Pi using model/version unavailable in this environment
| emit(event: string, payload: unknown) { | ||
| assertNonEmptyString(event, "events.emit requires a non-empty event name."); | ||
| registry.emitCustomEvent?.(event, payload); | ||
| }, |
There was a problem hiding this comment.
Factory-time events are silently dropped
When an extension emits during its factory after an earlier extension registered a listener, emitCustomEvent is still undefined and optional chaining silently discards the event, breaking inter-extension coordination without an error or warning.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/extensions/runExtension.ts
Line: 298-301
Comment:
**Factory-time events are silently dropped**
When an extension emits during its factory after an earlier extension registered a listener, `emitCustomEvent` is still undefined and optional chaining silently discards the event, breaking inter-extension coordination without an error or warning.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in 77bb3a1. Factory-time bus events now queue until all extensions have subscribed; queued events from failed factories roll back. Added regression coverage.
Responded by Pi using model/version unavailable in this environment.
This comment was generated by Pi using model/version unavailable in this environment
Greptile SummaryThis PR expands the extension event surface and runtime coordination APIs.
Confidence Score: 3/5The PR should not merge until current-file events survive soft reloads and event-bus emissions made during extension initialization are no longer silently lost. Same-ID reloads suppress file_viewed despite replacing file data or extensions, while the public bus accepts emit calls before its dispatcher is installed and drops those events. Files Needing Attention: src/ui/App.tsx and src/extensions/runExtension.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant Factory as Extension factory
participant Registry as Extension registry
participant Host as Extension host
participant App as App UI
participant Handler as Extension handler
Factory->>Registry: events.on(name, handler)
Factory->>Registry: events.emit(name, payload)
Note over Registry: Dispatcher is not bound during factory loading
Host->>Registry: bindExtensionEventBus()
App->>Registry: emit lifecycle/UI event
Registry->>Handler: payload + sidebar/event context
Prompt To Fix All With AI### Issue 1
src/ui/App.tsx:741-744
**Same-ID reloads suppress file events**
When a soft reload replaces the selected file or extension set while preserving the file ID, `lastViewedFileIdRef` still matches and suppresses `file_viewed`, causing file-scoped extension panes to remain uninitialized or display data from before the reload.
### Issue 2
src/extensions/runExtension.ts:298-301
**Factory-time events are silently dropped**
When an extension emits during its factory after an earlier extension registered a listener, `emitCustomEvent` is still undefined and optional chaining silently discards the event, breaking inter-extension coordination without an error or warning.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(extensions): expand event surface" | Re-trigger Greptile |
Summary
hunk.eventsinter-extension busValidation
bun run typecheckbun run lintbun run check:packbun testtimed out on the existing PTY atomic-save watch testThis PR description was generated by Pi using OpenAI GPT-5.4