Skip to content

Conversation

@nickgrato
Copy link
Collaborator

The idea behihind this PR is to create a mentions input for prototyping in EH as well as the firefox fork. The firefox fork was able to impliment thier own place holder mentions with a 3rd party library. So this will continue to be a prototype for EH but I also intent to at least present this as an option to move into MC for our actual implimentation when the time comes. It has been created as a lit component with little deps and styling so that it can be moved into MC with little effort.

The idea behihind this PR is to create a mentions input for prototyping in EH as well as the firefox fork. The firefox fork was able to impliment thier own place holder mentions with a 3rd party library. So this will continue to be a prototype for EH but I also intent to at least present this as an option to move into MC for our actual implimentation when the time comes. It has been created as a lit component with little deps and styling so that it can be moved into MC with little effort.
@nickgrato nickgrato requested review from Mardak and Copilot and removed request for Mardak October 6, 2025 18:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a prototype mentions input component for text-based interactions, allowing users to type @mentions for tabs and users. The component includes a contenteditable interface with keyboard navigation, mention filtering, and visual chip representation of selected mentions.

  • Adds a new MozMentionInput Lit component with full keyboard navigation and mention selection functionality
  • Integrates the mentions component into the AI Mode page with sample mention options for tabs and users
  • Registers the new component in the elements registry for use throughout the application

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/components/MozMentionInput.ts New mentions input component with contenteditable functionality, keyboard navigation, and mention chip rendering
src/features/aimode/MozAIModePage.ts Adds mention options data and integrates the mentions component into the AI mode interface
src/elements.ts Registers the new MozMentionInput component with custom elements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@nickgrato nickgrato requested a review from Copilot October 7, 2025 03:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +205 to +206
const emptyPattern = /^$/
if (!textBeforeCaret?.match(emptyPattern)) {
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The empty pattern check can be simplified to if (textBeforeCaret?.trim()) which is more readable and achieves the same result.

Suggested change
const emptyPattern = /^$/
if (!textBeforeCaret?.match(emptyPattern)) {
if (textBeforeCaret?.trim()) {

Copilot uses AI. Check for mistakes.
this._selectedIndex = -1
}

private handleKeyDown = (event: KeyboardEvent) => {
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This arrow function property conflicts with the method declaration pattern used elsewhere in the class. Consider using a consistent approach throughout the class.

Suggested change
private handleKeyDown = (event: KeyboardEvent) => {
private handleKeyDown(event: KeyboardEvent) {

Copilot uses AI. Check for mistakes.
@nickgrato nickgrato removed the request for review from Mardak October 7, 2025 15:33
@nickgrato nickgrato requested a review from Copilot October 7, 2025 18:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/features/aimode/MozAIModePage.ts:1

  • Corrected spelling of 'filerting' to 'filtering'.
import { LitElement, PropertyValues, html } from 'lit'

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


<div class="mentions-bar">
<p class="font-small">
This is an example of updateing the options on the fly. We
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'updateing' to 'updating'.

Suggested change
This is an example of updateing the options on the fly. We
This is an example of updating the options on the fly. We

Copilot uses AI. Check for mistakes.
Copy link
Member

@Mardak Mardak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can just wrap this up for now and leave it available from the ai mode page to test and reference

Comment on lines +78 to +80
// This is where you would handle the filter event and then we can update the options given to the
// mention input component and not have to worry about filerting in the component itself.
console.log('Received mention-input:filter event:', e.detail)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to implement now but what's the expected way to filter? modify mockOptions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes exactly - .mentionGroups=${this.mockOptions} since .mentionGroups is a reactive prop when that changes as you know that will live update the options. I think the mentions input should be agnostic to filtering and just receive options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants