Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kanban embed view #179

Closed
wants to merge 7 commits into from
Closed

Kanban embed view #179

wants to merge 7 commits into from

Conversation

mdroidian
Copy link
Collaborator

@mdroidian mdroidian commented Nov 23, 2023

src/components/Kanban.tsx Outdated Show resolved Hide resolved
Comment on lines +402 to +412
<div
className="absolute top-0 right-0 h-20 w-24 z-20"
// if this is set to the main div, mouse events on CellEmbed cause re-renders
onMouseEnter={() => {
if (!showInterface) setShowMenuIcons(true);
}}
onMouseLeave={() => {
if (!showInterface) setShowMenuIcons(false);
}}
>
{onRefresh && (
<Tooltip content={"Refresh Results"}>
<Button icon={"refresh"} minimal onClick={() => onRefresh()} />
</Tooltip>
)}
<Popover
placement="left-end"
isOpen={moreMenuOpen}
target={
<Button
minimal
icon={"more"}
className={isMenuIconDirty ? "roamjs-item-dirty" : ""}
/>
}
onInteraction={(next, e) => {
if (!e) return;
const target = e.target as HTMLElement;
if (
target.classList.contains("bp3-menu-item") ||
target.closest(".bp3-menu-item")
) {
return;
<div
Copy link
Collaborator Author

@mdroidian mdroidian Nov 23, 2023

Choose a reason for hiding this comment

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

This fixed a separate issue where any ResultsView mode would re-render multiple times when moving the mouse over the component. This was mostly fixed by changing onMouseOver/onMouseOut to onMouseEnter/onMouseLeave

Unfortunately, hovering over an embed (in table or kanban mode) would still trigger this. I tried adding all stopPropagation() to all mouse events on the div containing the embed, but that didn't fix it. Thus the additional div with className="absolute top-0 right-0 h-20 w-24 z-20"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

video showing the initial render issue and the trial of stopPropagation() as a fix

https://www.loom.com/share/89aef4d1bb9742249b97041fd5a73fdf

const uid = kanbanCard?.getAttribute("data-uid");
if (!uid) return;

const isOpen = target.classList.contains("rm-caret-open");
Copy link
Collaborator

Choose a reason for hiding this comment

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

see if there's a way to get this from roamAlphaAPI

src/components/Kanban.tsx Outdated Show resolved Hide resolved
@mdroidian mdroidian marked this pull request as draft December 7, 2023 03:32
@mdroidian mdroidian closed this Dec 21, 2023
@mdroidian mdroidian deleted the kanban-embed-view branch December 21, 2023 05:19
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.

2 participants