From 37d91663488e64a41103b71bcc8f41a216692de9 Mon Sep 17 00:00:00 2001 From: Malte Langkabel Date: Fri, 7 Aug 2026 19:06:01 +0200 Subject: [PATCH] divide the always-available rows in the General context too The General card was the one that ran its context rows and the global ones together as a flat list. That made it the exception a player has to notice: the same six rows sit under a caption everywhere else, so leaving them uncaptioned here asks the reader to work out that they are the same six. Requirement wording corrected with it -- it claimed the always-available rows were the General context's entire content, which was never true. General has Select, Select area and Deconstruct mode of its own above the divider, exactly like the other contexts. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01YHcUerKAZKWNvSKJxYKbnG --- docs/requirements.md | 2 +- src/ui/ControlsPanel.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/requirements.md b/docs/requirements.md index 37c7470..b40f7b7 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -623,7 +623,7 @@ The controls panel tells the player which controls are available right now. It i - **Header** — always shown, and the panel's only interactive element (REQ-UI-CONTROLS-PANEL). It holds a colored context dot on the left, the context's name beside it in upper case, and, for contexts that define one, a **detail suffix** separated by a middle dot (`BUILD MODE · Assembler`). The name and detail per context are given in REQ-UI-CONTROLS-CONTENT. - **Rows** — one per available control, shown only while the panel is expanded. Each row is one or more **key badges** on the left — the key or mouse button drawn as a small bordered chip — and a **label** beside them naming what it does. An action reachable two ways carries both badges in the same row (`RMB` `Q` — Exit placement) rather than occupying two rows. A row whose action leaves the current mode is drawn with the destructive badge styling, distinguishing it from the rows that act within the mode. No row is ever drawn greyed or otherwise disabled: a control the player cannot currently use is not shown at all (REQ-UI-CONTROLS-ACCURACY). - The rows that are live in every context (REQ-UI-CONTROLS-CONTENT) are shown last, under a divider and the caption `ALWAYS AVAILABLE`. In the General context those rows are the entire content, so neither divider nor caption is shown there. + The rows that are live in every context (REQ-UI-CONTROLS-CONTENT) are shown last, under a divider and the caption `ALWAYS AVAILABLE`. This holds in every context including the General one, which has context rows of its own above the divider like any other, so the card is read the same way wherever the player is. - REQ-UI-CONTROLS-CONTENT: **Content catalog.** The control context follows from the active build mode and the selection alone. Build modes are mutually exclusive (REQ-BLD-BUILDER-MODE), so exactly one context applies at any moment: | Context | When | Header name | Header detail | diff --git a/src/ui/ControlsPanel.cpp b/src/ui/ControlsPanel.cpp index 2201920..219433b 100644 --- a/src/ui/ControlsPanel.cpp +++ b/src/ui/ControlsPanel.cpp @@ -159,11 +159,10 @@ void ControlsPanel::rebuild(const ControlContext& context) m_rowsLayout->addWidget(makeRow(action, context, m_rows)); } - // The always-available block sits under a divider, except in the General context, - // where those rows and the context's own are the same kind of thing to a player - // with nothing selected and no mode active (REQ-UI-CONTROLS-CARD). - if (!m_shownAlwaysActions.empty() - && getControlContextKind(context) != ControlContextKind::General) + // The always-available block sits under a divider in every context, the General one + // included, so the card is read the same way wherever the player is + // (REQ-UI-CONTROLS-CARD). + if (!m_shownAlwaysActions.empty()) { QFrame* divider = new QFrame(m_rows); divider->setFrameShape(QFrame::HLine);