Skip to content

Commit bec8782

Browse files
wilhel1812wilhel1812
andauthored
tweak: 50/50 field width + lucide icon buttons for edit/search/fetch (#824)
- Change .field-grid to 50/50 label/input split (was 1fr 120px) - Add .field-inline-btn for icon-only button sizing - Replace "Edit" text with Pencil icon in AccessSettingsEditor - Replace "Search" text with Search/Loader2 icon in MapEditorPanel - Replace "Fetch" text with RefreshCw/Loader2 icon in MapEditorPanel - Add aria-label and title attributes for icon accessibility Co-authored-by: wilhel1812 <wilhelm@linksim.link>
1 parent d249585 commit bec8782

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

src/components/AccessSettingsEditor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo, useRef, useState } from "react";
2-
import { Trash2 } from "lucide-react";
2+
import { Pencil, Trash2 } from "lucide-react";
33
import type { CollaboratorDirectoryUser } from "../lib/cloudUser";
44
import { ActionButton } from "./ActionButton";
55
import { AvatarBadge } from "./AvatarBadge";
@@ -123,9 +123,10 @@ export function AccessSettingsEditor({
123123
ref={triggerRef}
124124
disabled={disabled}
125125
onClick={() => setPopoverOpen((open) => !open)}
126+
title="Edit collaborators"
126127
type="button"
127128
>
128-
Edit
129+
<Pencil size={14} />
129130
</ActionButton>
130131
</div>
131132
</div>

src/components/map/MapEditorPanel.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createPortal } from "react-dom";
22
import { useEffect, useRef, useState } from "react";
3-
import { History } from "lucide-react";
3+
import { History, Loader2, RefreshCw, Search } from "lucide-react";
44
import { FREQUENCY_PRESETS, frequencyPresetGroups } from "../../lib/frequencyPlans";
55
import {
66
fetchResourceChanges,
@@ -282,12 +282,14 @@ function SiteEditorCard({
282282
value={form.siteSearchQuery}
283283
/>
284284
<ActionButton
285+
aria-label="Search location"
285286
className="field-inline-btn"
286287
disabled={form.siteSearchBusy}
287288
onClick={() => void form.runSiteSearch()}
289+
title="Search location"
288290
type="button"
289291
>
290-
{form.siteSearchBusy ? "Searching..." : "Search"}
292+
{form.siteSearchBusy ? <Loader2 className="animate-spin" size={14} /> : <Search size={14} />}
291293
</ActionButton>
292294
</div>
293295
</label>
@@ -316,6 +318,7 @@ function SiteEditorCard({
316318
value={form.groundDraft}
317319
/>
318320
<ActionButton
321+
aria-label="Fetch elevation"
319322
className="field-inline-btn"
320323
disabled={form.isEditorTerrainFetching}
321324
onClick={() => {
@@ -328,9 +331,10 @@ function SiteEditorCard({
328331
}
329332
form.setGroundDraft(elevation);
330333
}}
334+
title="Fetch elevation"
331335
type="button"
332336
>
333-
{form.isEditorTerrainFetching ? "Loading…" : "Fetch"}
337+
{form.isEditorTerrainFetching ? <Loader2 className="animate-spin" size={14} /> : <RefreshCw size={14} />}
334338
</ActionButton>
335339
</div>
336340
</label>

src/index.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ button {
552552

553553
.field-grid {
554554
display: grid;
555-
grid-template-columns: minmax(0, 1fr) 120px;
555+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
556556
align-items: center;
557557
gap: 10px;
558558
font-size: 0.82rem;
@@ -598,6 +598,16 @@ button {
598598
min-height: 32px;
599599
}
600600

601+
.field-inline-btn {
602+
width: 32px;
603+
height: 32px;
604+
padding: 0;
605+
display: flex;
606+
align-items: center;
607+
justify-content: center;
608+
flex-shrink: 0;
609+
}
610+
601611
/* Upload label piggybacks off btn-ghost; only overrides live here */
602612
.upload-button {
603613
border-style: dashed;

0 commit comments

Comments
 (0)