fix(ui): PR #131 review round 2 — manifest cleanup, system index helper, stderr help

Addresses 6 mechanical issues from PR review:

- ImplantAppManifest: drop dead display_name and icon_path fields.
  default_key carries a TODO noting its future migration to a keybinds
  manifest (input concern in app manifest is a layering violation,
  tracked explicitly).
- default_mode wire format is now a String ("fullscreen" / "insert") for
  mod-author discovery. ImplantRegistry parses via _MODE_MAP, caches the
  resolved int in _resolved_modes, and exposes get_resolved_mode(app_path).
  main.gd reads the resolved int directly instead of re-parsing.
- Extract client/ui/implant/widgets/system_index.gd (class_name SystemIndex,
  static get_sorted_systems). Removes duplicated star_map_data.json loader +
  sort lambda from atlas_app and economics overview_screen.
- ImplantApp.on_insert_deactivated() default auto-closes only when the app
  is active in INSERT mode. FULLSCREEN apps no longer spuriously close on
  insert state changes.
- tooling/db/sqlite-query and sqlite-exec: --help output goes to stderr
  (exit 0). Keeps stdout reserved for JSON payloads so JSON-parsing
  callers can't get silently corrupted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 14:21:03 +02:00
co-authored by Claude Opus 4.6
parent cbcfeccd67
commit 48c8fb7dea
11 changed files with 77 additions and 77 deletions
+1 -3
View File
@@ -5,9 +5,7 @@
[resource]
script = ExtResource("1")
app_path = "implant/map"
display_name = "ATLAS"
icon_path = ""
scene_path = "res://ui/implant/apps/atlas/atlas_app.tscn"
default_mode = 2
default_mode = "fullscreen"
default_key = 77
preserves_state = true
+3 -23
View File
@@ -6,8 +6,6 @@ extends ImplantApp
signal economics_link_requested(system_id: String)
const STAR_MAP_DATA := "res://data/star_map_data.json"
var _systems: Array = []
var _system_lookup: Dictionary = {} # system_id → system dict
@@ -193,24 +191,6 @@ func _system_idx_by_id(system_id: String) -> int:
func _load_system_data() -> void:
if not FileAccess.file_exists(STAR_MAP_DATA):
push_warning("AtlasApp: %s not found" % STAR_MAP_DATA)
return
var file := FileAccess.open(STAR_MAP_DATA, FileAccess.READ)
if file == null:
return
var parsed: Variant = JSON.parse_string(file.get_as_text())
file.close()
if not (parsed is Dictionary):
return
for node: Dictionary in parsed.get("nodes", []):
var sid: String = node.get("system_id", "")
if not sid.is_empty():
_systems.append(node)
_system_lookup[sid] = node
_systems.sort_custom(
func(a: Dictionary, b: Dictionary) -> bool:
var na: String = a.get("proper_name", a.get("system_id", ""))
var nb: String = b.get("proper_name", b.get("system_id", ""))
return na < nb
)
_systems = SystemIndex.get_sorted_systems()
for node: Dictionary in _systems:
_system_lookup[node.get("system_id", "")] = node
+1 -3
View File
@@ -5,9 +5,7 @@
[resource]
script = ExtResource("1")
app_path = "implant/economics"
display_name = "ECONOMICS MONITOR"
icon_path = ""
scene_path = "res://ui/implant/apps/economics/economics_app.tscn"
default_mode = 1
default_mode = "insert"
default_key = 78
preserves_state = true
@@ -10,7 +10,6 @@ extends Control
signal economy_data_updated(system_id: String, data: Dictionary)
const RING_BUFFER_SIZE: int = 20
const STAR_MAP_DATA := "res://data/star_map_data.json"
const PANEL_WIDTH: float = 340.0
const PANEL_MARGIN: float = 16.0
@@ -112,26 +111,7 @@ func navigate(delta: int) -> void:
func _load_system_list() -> void:
if not FileAccess.file_exists(STAR_MAP_DATA):
push_warning("OverviewScreen: %s not found" % STAR_MAP_DATA)
return
var file := FileAccess.open(STAR_MAP_DATA, FileAccess.READ)
if file == null:
return
var parsed: Variant = JSON.parse_string(file.get_as_text())
file.close()
if not (parsed is Dictionary):
return
for node: Dictionary in parsed.get("nodes", []):
var sid: String = node.get("system_id", "")
if not sid.is_empty():
_systems.append(node)
_systems.sort_custom(
func(a: Dictionary, b: Dictionary) -> bool:
var na: String = a.get("proper_name", a.get("system_id", ""))
var nb: String = b.get("proper_name", b.get("system_id", ""))
return na < nb
)
_systems = SystemIndex.get_sorted_systems()
if not _systems.is_empty():
selected_system = _systems[0].get("system_id", "")