Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions apps/roam/src/components/results-view/ResultsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,7 @@ export const CellEmbed = ({
);
};

export const CellRender = ({
content,
uid,
}: {
content: string;
uid: string;
}) => {
const CellRender = ({ content, uid }: { content: string; uid: string }) => {
const isPage = !!getPageTitleByPageUid(uid);
const displayString = isPage ? `[[${content}]]` : content;

Expand Down
17 changes: 9 additions & 8 deletions apps/roam/src/components/results-view/ResultsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ const ResultsView: ResultsViewComponent = ({
settings.showSearchFilter,
);
const [showInterface, setShowInterface] = useState(settings.showInterface);
const [revealMenuIcons, setRevealMenuIcons] = useState(false);
const [showInputs, setShowInputs] = useState(settings.showInputs);
const hideMenuIcons = hideMenu || (!revealMenuIcons && !showInterface);
const [showAlias, setShowAlias] = useState(settings.showAlias);
const [isEditAlias, setIsEditAlias] = useState(false);
const [alias, setAlias] = useState(settings.alias);
Expand Down Expand Up @@ -452,13 +450,19 @@ const ResultsView: ResultsViewComponent = ({
() => views.filter((view) => view.mode !== "hidden").length,
[views],
);
const menuIconClassName = [
"roamjs-query-menu-icons",
hideMenu
? ""
: showInterface
? "roamjs-query-menu-icons-visible"
: "roamjs-query-menu-icons-hover",
].join(" ");

return (
<div
className={`roamjs-query-results-view relative w-full mode-${layout.mode}`}
ref={containerRef}
onMouseEnter={() => setRevealMenuIcons(true)}
onMouseLeave={() => setRevealMenuIcons(false)}
>
{showAlias && (
<div
Expand Down Expand Up @@ -580,10 +584,7 @@ const ResultsView: ResultsViewComponent = ({
/>
{header}
<div className="relative">
<div
style={hideMenuIcons ? { display: "none" } : {}}
className="absolute right-0 z-10 p-1"
>
<div className={menuIconClassName}>
{onRefresh && (
<Tooltip content={"Refresh Results"}>
<Button icon={"refresh"} minimal onClick={() => onRefresh()} />
Expand Down
14 changes: 14 additions & 0 deletions apps/roam/src/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@
padding: 8px;
}

.roamjs-query-menu-icons {
position: absolute;
right: 0;
z-index: 10;
display: none;
padding: 4px;
}

.roamjs-query-menu-icons.roamjs-query-menu-icons-visible,
.roamjs-query-results-view:hover
.roamjs-query-menu-icons.roamjs-query-menu-icons-hover {
display: block;
}

/* Solves dot-tags (.#sticky, .#meeting) flashing on when hovering anywhere on the
Query Table. Roam shows them via .rm-block__self:hover and the entire table lives
in one block, so we scope visibility to the individual cell instead. */
Expand Down
Loading