Skip to content

Commit 7fa6531

Browse files
committed
[attribute] Selection panel attribute layout
readability enhancement proposal
1 parent fb7e424 commit 7fa6531

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

packages/gephi-lite/src/styles/_graph-page.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,9 @@
8181
:root {
8282
--sigma-background-color: transparent;
8383
}
84+
85+
ul.attributes-list {
86+
li:not(:last-child) {
87+
border-bottom: 1px solid var(--gl-container-border-color);
88+
}
89+
}

packages/gephi-lite/src/views/graphPage/Selection.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ import { useNavigate } from "react-router";
88

99
import Dropdown from "../../components/Dropdown";
1010
import { InfiniteScroll } from "../../components/InfiniteScroll";
11-
import { CaretDownIcon, CaretUpIcon, ThreeDotsVerticalIcon, TrashIcon } from "../../components/common-icons";
11+
import {
12+
CaretDownIcon,
13+
CaretUpIcon,
14+
FieldModelIcon,
15+
ThreeDotsVerticalIcon,
16+
TrashIcon,
17+
} from "../../components/common-icons";
1218
import { RenderItemAttribute, RenderText } from "../../components/data/Attribute";
1319
import { EdgeComponent } from "../../components/data/Edge";
1420
import { EditEdgeModal } from "../../components/data/EditEdge";
@@ -180,11 +186,17 @@ function SelectedItem<
180186
</Dropdown>
181187
</h4>
182188
<AnimateHeight height={expanded ? "auto" : 0} className="position-relative" duration={400}>
183-
<ul className="list-unstyled small">
189+
<ul className="attributes-list list-unstyled small">
184190
{attributes.map((attribute, i) => (
185-
<li key={i} className="overflow-hidden">
186-
<div className="gl-container-muted-bg text-break gl-border gl-px-2 gl-py-1">{attribute.label}</div>{" "}
187-
<div className="mb-1 text-break gl-px-2 gl-py-1">
191+
<li
192+
key={i}
193+
className="overflow-hidden gl-px-2 gl-py-2 d-flex flex-column flex-wrap align-items-start gl-gap-x-2 gl-gap-y-1 "
194+
>
195+
<span className="d-inline-flex align-items-center gl-gap-1 text-break ">
196+
{attribute.field && <FieldModelIcon type={attribute.field.type} />}
197+
{attribute.label}
198+
</span>{" "}
199+
<span className="text-break ">
188200
{!isNil(attribute.value) ? (
189201
attribute.field ? (
190202
<RenderItemAttribute value={attribute.value} field={attribute.field} />
@@ -194,7 +206,7 @@ function SelectedItem<
194206
) : (
195207
<span className="fst-italic">{t("selection.no_value")}</span>
196208
)}
197-
</div>
209+
</span>
198210
</li>
199211
))}
200212
</ul>

0 commit comments

Comments
 (0)