Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

feat(web) - add a management connection via the ManagementPanel#6518

Merged
wendybujalski merged 1 commit intomainfrom
wendy/eng-3083-the-management-section-pt-3
Jun 26, 2025
Merged

feat(web) - add a management connection via the ManagementPanel#6518
wendybujalski merged 1 commit intomainfrom
wendy/eng-3083-the-management-section-pt-3

Conversation

@wendybujalski
Copy link
Copy Markdown
Contributor

@wendybujalski wendybujalski commented Jun 26, 2025

How does this PR change the system?

This wraps up ENG-3083 so that the Management panel within ComponentDetails can be used to add a management connection in addition to displaying the existing management connections and functions.

The input field for selecting a component to manage is similar to but not the same as AttributeInput. Eventually those two components might have some of their parts merged into a general fuzzy search input component.

There are also a few small bug fixes and improvements wrapped into this PR as well, will point em out in the comments!

Screenshots:

Screenshot 2025-06-26 at 5 30 00 PM

Out of Scope:

The data loaded into the frontend about management connections is still not always accurate.

@github-actions github-actions bot added the A-web label Jun 26, 2025
@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

Importing your workspace!
<template #moreContent>
<p class="italic font-sm">
<p class="italic text-sm">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"font-sm" doesn't do anything! The correct Tailwind class is "text-sm"

Comment on lines +94 to +97
keyEmitter.on("Enter", onKeyDown);
});
onBeforeUnmount(() => {
window.removeEventListener("keydown", onKeyDown);
keyEmitter.off("Enter", onKeyDown);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We want to use the centralized emitters instead of creating additional addEventListeners

Comment on lines +79 to +110
export interface MouseDetails {
[key: string | symbol]: Pick<
MouseEvent,
| "button"
| "clientX"
| "clientY"
| "altKey"
| "ctrlKey"
| "metaKey"
| "shiftKey"
| "preventDefault"
| "target"
>;
}

const onClick = (event: MouseEvent) => {
mouseEmitter.emit("click", event);
};
const onMouseDown = (event: MouseEvent) => {
mouseEmitter.emit("mousedown", event);
};

export const mouseEmitter: Emitter<MouseDetails> = mitt<MouseDetails>();

let mouseEmitterStarted = false;

export const startMouseEmitters = (window: Window) => {
if (mouseEmitterStarted) return;
mouseEmitterStarted = true;
window.addEventListener("click", onClick);
window.addEventListener("mousedown", onMouseDown);
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

New mouseEmitter for centrally handling click and mousedown events on the whole window.

:class="
clsx(
'block h-lg w-full ml-auto font-sm font-mono',
'block h-lg w-full ml-auto text-sm font-mono',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Once again, "font-sm" doesn't actually do anything 😅

};
const closeSecretForm = () => {
secretFormOpen.value = false;
removeListeners();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed a bug where the listeners were not always being removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The guts of this component are definitely very similar to AttributeInput, but there are enough little differences to make merging them not worth it (for now).

Copy link
Copy Markdown
Contributor

@jobelenus jobelenus left a comment

Choose a reason for hiding this comment

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

Excellent data re-use!!!

// general click handler for the whole page
// any click which doesn't do this behavior should have .stop on it!
const onClick = (e: MouseEvent) => {
const onClick = (e: MouseDetails["click"]) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oooo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, no reason to not apply our same "use one central event listener that emits events instead of a bunch of individual ones" structure for mouse events. Right now it's only "mousedown" and "click" but adding additional events to the same mouseEmitter when we need em should be easy :)

@wendybujalski wendybujalski added this pull request to the merge queue Jun 26, 2025
Merged via the queue into main with commit 124beda Jun 26, 2025
10 checks passed
@wendybujalski wendybujalski deleted the wendy/eng-3083-the-management-section-pt-3 branch June 26, 2025 22:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants