Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Commit adc3f83

Browse files
authored
Merge pull request #890 from trey-wallis/dev
Dev
2 parents 5362e0c + 89bdef7 commit adc3f83

File tree

9 files changed

+37
-19
lines changed

9 files changed

+37
-19
lines changed

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"fundingUrl": {
1010
"Buymeacoffee": "https://www.buymeacoffee.com/treywallis"
1111
},
12-
"version": "8.15.4"
12+
"version": "8.15.5"
1313
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-dataloom",
3-
"version": "8.15.4",
3+
"version": "8.15.5",
44
"description": "Weave together data from diverse sources into different views. Inspired by Excel Spreadsheets and Notion.so.",
55
"main": "main.js",
66
"scripts": {

src/obsidian/modal/welcome-modal/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default class WelcomeModal extends Modal {
3232
cardContainerEl,
3333
"Quick start",
3434
"Learn the basics of creating a loom",
35-
"https://dataloom.xyz/basics/quick-start",
35+
"https://dataloom.xyz/quick-start",
3636
"table"
3737
);
3838

@@ -48,7 +48,7 @@ export default class WelcomeModal extends Modal {
4848
cardContainerEl,
4949
"Embedded looms",
5050
"Learn how to embed a loom into a markdown note",
51-
"https://dataloom.xyz/basics/embed-loom",
51+
"https://dataloom.xyz/basics/embed-looms",
5252
"sticky-note"
5353
);
5454

src/react/loom-app/option-bar/filter-menu/filter-row/index.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ interface Props {
2626
conditionOptions: FilterCondition[];
2727
selectedCondition: FilterCondition;
2828
inputNode?: React.ReactNode;
29+
useSpacer?: boolean;
2930
onToggle: (id: string) => void;
3031
onColumnChange: (id: string, columnId: string) => void;
3132
onConditionChange: (id: string, value: FilterCondition) => void;
@@ -38,6 +39,7 @@ export default function FilterRow({
3839
index,
3940
id,
4041
columns,
42+
useSpacer,
4143
isEnabled,
4244
selectedColumnId,
4345
selectedOperator,
@@ -53,15 +55,17 @@ export default function FilterRow({
5355
return (
5456
<div className="dataloom-filter-row">
5557
<Wrap>
56-
{index !== 0 ? (
58+
{index !== 0 && (
5759
<FilterOperator
5860
id={id}
5961
value={selectedOperator}
6062
onChange={onOperatorChange}
6163
/>
62-
) : (
64+
)}
65+
{useSpacer && (
6366
<div className="dataloom-filter-row__spacer"></div>
6467
)}
68+
6569
<FilterColumnSelect
6670
id={id}
6771
columns={columns}

src/react/loom-app/option-bar/filter-menu/index.tsx

+6-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Padding from "src/react/shared/padding";
33
import Stack from "src/react/shared/stack";
44
import Icon from "src/react/shared/icon";
55
import FilterRow from "./filter-row";
6-
import Text from "src/react/shared/text";
76
import Button from "src/react/shared/button";
87

98
import ColumnNotFoundError from "src/shared/error/column-not-found-error";
@@ -613,6 +612,7 @@ export default function FilterMenu({
613612
index={i}
614613
key={id}
615614
id={id}
615+
useSpacer={filters.length > 1 && i === 0}
616616
columns={columns}
617617
selectedColumnId={columnId}
618618
selectedCondition={condition}
@@ -628,16 +628,11 @@ export default function FilterMenu({
628628
/>
629629
);
630630
})}
631-
<Stack isHorizontal>
632-
<Button
633-
icon={<Icon lucideId="plus" />}
634-
ariaLabel="Add filter"
635-
onClick={() => onAddClick()}
636-
/>
637-
{filters.length === 0 && (
638-
<Text value="No filters to display" />
639-
)}
640-
</Stack>
631+
<Button
632+
icon={<Icon lucideId="plus" />}
633+
ariaLabel="Add filter"
634+
onClick={() => onAddClick()}
635+
/>
641636
</Stack>
642637
</Padding>
643638
</div>

src/react/loom-app/option-bar/index.tsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,24 @@ export default function OptionBar({
110110

111111
function handleFilterMenuOpen() {
112112
filterMenu.onOpen(LoomMenuLevel.ONE);
113+
if (filters.length === 0) {
114+
onFilterAddClick();
115+
}
113116
}
114117

115118
function handleMoreMenuOpen() {
116119
moreMenu.onOpen(LoomMenuLevel.ONE);
117120
}
118121

122+
function handleFilterDelete(id: string) {
123+
onFilterDeleteClick(id);
124+
125+
//Close the menu when the last filter is deleted
126+
if (filters.length === 1) {
127+
filterMenu.onClose();
128+
}
129+
}
130+
119131
const activeFilters = filters.filter((filter) => filter.isEnabled);
120132

121133
const sortedColumns = columns.filter(
@@ -228,7 +240,7 @@ export default function OptionBar({
228240
columns={columns}
229241
filters={filters}
230242
onUpdate={onFilterUpdate}
231-
onDeleteClick={onFilterDeleteClick}
243+
onDeleteClick={handleFilterDelete}
232244
onAddClick={onFilterAddClick}
233245
/>
234246
</>

src/react/shared/base-menu/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface Props {
1818
width?: number;
1919
height?: number;
2020
maxWidth?: number;
21+
minWidth?: number;
2122
maxHeight?: number;
2223
children: React.ReactNode;
2324
}
@@ -31,6 +32,7 @@ const BaseMenu = React.forwardRef<HTMLDivElement, Props>(
3132
position,
3233
width = 0,
3334
height = 0,
35+
minWidth = 0,
3436
maxHeight = 0,
3537
maxWidth = 0,
3638
children,
@@ -79,6 +81,7 @@ const BaseMenu = React.forwardRef<HTMLDivElement, Props>(
7981
left: numToPx(position.left),
8082
width: width !== 0 ? numToPx(width) : "max-content",
8183
height: height !== 0 ? numToPx(height) : "max-content",
84+
minWidth: minWidth !== 0 ? numToPx(minWidth) : undefined,
8285
maxWidth: maxWidth !== 0 ? numToPx(maxWidth) : undefined,
8386
maxHeight: maxHeight !== 0 ? numToPx(maxHeight) : undefined,
8487
overflowY: maxHeight !== 0 ? "scroll" : undefined,

src/react/shared/menu/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface Props {
1414
openDirection?: LoomMenuOpenDirection;
1515
topOffset?: number;
1616
leftOffset?: number;
17+
minWidth?: number;
1718
width?: number;
1819
height?: number;
1920
maxWidth?: number;
@@ -27,6 +28,7 @@ export default function Menu({
2728
hideBorder = false,
2829
openDirection,
2930
position,
31+
minWidth = 0,
3032
width = 0,
3133
height = 0,
3234
leftOffset = 0,
@@ -53,6 +55,7 @@ export default function Menu({
5355
position={position}
5456
width={width}
5557
height={height}
58+
minWidth={minWidth}
5659
maxHeight={maxHeight}
5760
maxWidth={maxWidth}
5861
>

versions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,6 @@
153153
"8.15.1": "1.4.0",
154154
"8.15.2": "1.4.0",
155155
"8.15.3": "1.4.0",
156-
"8.15.4": "1.4.0"
156+
"8.15.4": "1.4.0",
157+
"8.15.5": "1.4.0"
157158
}

0 commit comments

Comments
 (0)