Drop redundant coord from pending-proposal map label

The coord was already shown right below via _draw_marker's own
coord=coord line -- repeating it in the main label too was pure
noise. Shows detected type/id instead when known ("? Mechanized#3",
same shape Target.name/Ally.name use, via TargetType.short so the
preview reads the same as what accepting it produces), falling back
to a bare "?" when neither is known.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Dominik Moritz Roth 2026-08-13 19:32:38 +02:00
parent d2f70675b8
commit 218909b6cf

View File

@ -638,14 +638,24 @@ class GridCanvas(Gtk.DrawingArea):
what a proposal is until the user accepts it.""" what a proposal is until the user accepts it."""
for p, coord in self._pending_proposals(): for p, coord in self._pending_proposals():
color = CATEGORY_COLOR["ally" if p.side == "friendly" else "target"] color = CATEGORY_COLOR["ally" if p.side == "friendly" else "target"]
# detected_id (map_vision.read_marker_id's best-effort read of # No coord here: _draw_marker already shows one right below
# the marker's own "#<N>" label) shown right on the map while # this label (`coord=coord` below), repeating it in the main
# the screenshot backing it is still up, so it's checkable # label too was pure noise. detected_type/detected_id
# against the actual pixels -- same id _accept_proposal will # (map_vision.classify_marker/read_marker_id's best-effort
# use for the entity if this gets accepted, see its own comment. # reads) shown instead when known -- same "? Mechanized#3"
# shape an accepted entity's own name takes (Target.name),
# checkable against the actual screenshot pixels while it's
# still up, and detected_id is the same id _accept_proposal
# will use for the entity if this gets accepted.
detected_type = icons.target_type_from_icon(p.unit)
# .short, not target_type_label(): matches Target.name/Ally.name's
# own naming exactly ("SupplyCache" not "Supply Cache"), so this
# preview label reads the same as what accepting it produces.
type_part = detected_type.short if detected_type else ""
id_part = f"#{p.detected_id}" if p.detected_id else "" id_part = f"#{p.detected_id}" if p.detected_id else ""
label = f"? {type_part}{id_part}" if (type_part or id_part) else "?"
self._draw_marker(cr, view, coord.as_fraction(), color, self._draw_marker(cr, view, coord.as_fraction(), color,
f"?{id_part} {coord.label()}", width, height, label, width, height,
hollow=True, coord=coord) hollow=True, coord=coord)
def _hit_test(self, view: _View, x: float, y: float): def _hit_test(self, view: _View, x: float, y: float):