Browser: Element Commenting - #328316
Draft
kycutler wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds element commenting to the integrated browser, connecting page annotations to chat attachments.
Changes:
- Adds comment-mode selection, numbered pins, previews, and editing.
- Synchronizes annotations with chat input and browser lifecycle.
- Supports selectable split-button primary actions.
Show a summary per file
| File | Description |
|---|---|
browserEditorChatFeatures.ts |
Connects comments to chat. |
browserViewWorkbenchService.ts |
Supplies theme and localized strings. |
workbench/.../common/browserView.ts |
Extends the renderer model. |
browserViewMainService.ts |
Exposes commenting operations and menus. |
browserViewInspector.ts |
Coordinates selection and comments. |
browserViewFrameInspector.ts |
Bridges frame-level comment IPC. |
electron-main/browserView.ts |
Serializes selection state. |
preload-browserView.ts |
Implements annotation UI and interaction. |
platform/.../common/browserView.ts |
Defines shared commenting contracts. |
actions/common/actions.ts |
Adds primary-action allowlists. |
menuEntryActionViewItem.ts |
Updates split-button primary behavior. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 6
- Review effort level: Balanced
| } | ||
| } | ||
|
|
||
| class AddElementCommentToChatAction extends Action2 { |
Comment on lines
+1344
to
+1346
| private _animateCommentHighlight(pinBounds: DOMRect, target: Element, supportingElements: readonly HTMLElement[], collapsing = false): Animation | undefined { | ||
| if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) { | ||
| return undefined; |
| commentInput.setAttribute('aria-label', this._localizedStrings.commentOnSelectedElement); | ||
| commentInput.addEventListener('input', () => this._layoutCommentInput()); | ||
| commentInput.addEventListener('keydown', event => { | ||
| if (event.key === 'Enter') { |
|
|
||
| private _onFocusIn = (): void => { | ||
| if (!this._selectionActive) { | ||
| if (!this._selectionActive || this._commentTarget || this._externalHighlightTarget) { |
Comment on lines
+427
to
+431
| const widget = await this._revealChatWidgetForAttachment(elementData.comment !== undefined); | ||
| if (!widget?.attachmentModel || this._disposedCommentModels.has(model)) { | ||
| return false; | ||
| } | ||
| widget.attachmentModel.addContext(...toAttach); |
Comment on lines
+352
to
+354
| setElementComments(update: IBrowserElementCommentsUpdate): void { | ||
| for (const inspector of this._registry.inspectors) { | ||
| inspector.setElementComments(update); |
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.
Closes #291482