Skip to content

Loom: validation conscience ribbon (top-right world health view)#273

Closed
CoreyRDean wants to merge 1 commit into
coreyrdean/gracious-napier-29553cfrom
coreyrdean/loom-conscience-ribbon
Closed

Loom: validation conscience ribbon (top-right world health view)#273
CoreyRDean wants to merge 1 commit into
coreyrdean/gracious-napier-29553cfrom
coreyrdean/loom-conscience-ribbon

Conversation

@CoreyRDean
Copy link
Copy Markdown
Collaborator

Summary

Second of four PRs porting concepts from the Loom GUE redesign into the existing F-UI editor. Stacked on top of #271 (uses GUE_JumpToEntity from that PR for click-to-jump on findings).

Adds an always-visible status group in the top-right of the editor window:

N unsaved · M issues · saved 2m ago [Issues...]

Clicking [Issues...] opens a modal with a list of findings; clicking a finding jumps straight to the offending entity.

Why this placement

GUE's menu bar (Y=0..20) currently has just File and Help on the left and acres of empty space on the right. Putting the ribbon there means zero coordinate churn for the 14 existing tabs and the thousands of inner gadgets that bottom-anchor off GUE_height. A bottom status bar would have required shrinking TabMain's height and chasing every gadget that uses GUE_height - N.

Validator (v1)

Walks Items and Spells whose Script$ is set and checks the script name still appears in CItemScript / CSpellScript (the per-type comboboxes GUE builds from Data\Server Data\Scripts\*.rsl at startup). Catches the common case where a script was renamed/deleted but the binding still points at the old name.

Adding more validators (missing meshes, orphaned portals, unused assets) is one ListAdd away via Conscience_AddFinding(message$, jumpKind$, jumpRefID).

Performance

  • Validator runs at most every 3 seconds
  • Label re-renders at most every 500 ms
  • Both internally throttled inside Conscience_Update so the per-frame call from the main loop is essentially free

Save-timestamp tracking

No hooks into the save buttons themselves. The module snapshots the 12 existing per-tab dirty flags (ItemsSaved, ActorsSaved, ZoneSaved, etc.) into a bitfield each refresh; when the popcount goes up, a save just happened and we record MilliSecs(). Tiny integration surface.

Blast radius

  • New self-contained module src/Modules/ConscienceRibbon.bb
  • src/GUE.bb gets four small hook lines (include, init, per-frame update, per-event dispatch)
  • No existing widget moves, resizes, or changes behavior
  • Server / Client / Project Manager / Tools don't pull in the module

Verification

  • GUE.exe compiles clean
  • Server.exe, Client.exe, Project Manager.exe all compile clean
  • Not yet exercised in-app

Test plan

  • Open GUE — ribbon visible top-right: All saved · 0 issues · no save yet
  • Edit an actor's name — within ~500ms the count flips to 1 unsaved · 0 issues · …
  • Save actors — within ~500ms it flips back to All saved · 0 issues · just saved
  • Edit an item's script binding to a name that doesn't exist on disk — within ~3s M issues appears
  • Click Issues... — modal opens listing the finding
  • Click the finding — Items tab opens with that item selected
  • Close modal with the X — fine, can reopen

🤖 Generated with Claude Code

Adds an always-visible at-a-glance status group in the top-right corner
of the editor window, in the empty real estate of the menu bar (no
existing geometry shifts). Shows:

    N unsaved  ·  M issues  ·  saved 2m ago    [Issues...]

The "Issues..." button opens a hidden modal with a scrollable list of
findings, each clickable to jump straight to the offending entity via
GUE_JumpToEntity (the primitive added in the Ctrl+K palette PR).

v1 validator pass walks Items and Spells whose Script$ is set and
verifies the bound script still appears in CItemScript / CSpellScript
(the per-type comboboxes GUE builds at startup from
Data\Server Data\Scripts\*.rsl). This catches the most common kind of
broken reference: someone renamed or deleted a script file but the
entity still binds the old name.

The unsaved count reads GUE's existing per-tab dirty flags
(ItemsSaved, ActorsSaved, ZoneSaved, etc.). The "saved Nm ago"
timestamp is derived by snapshotting the OR of all 12 dirty flags
between updates and detecting True transitions -- no hooks into the
save buttons themselves, so the integration surface stays tiny.

Validator runs every ~3s; label refreshes every ~500ms. Both internally
throttled so the per-frame Conscience_Update call is essentially free.

Adding more validators is one ListAdd away (Conscience_AddFinding).
Future PRs can plug in missing-mesh / orphaned-portal / unused-asset
checks.

Branch is stacked on top of #271 (it uses GUE_JumpToEntity for the
"click a finding to jump" behavior).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5878a5c91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +294 to +295
FUI_SendMessage(CR_Window, M_SHOW)
FUI_SendMessage(CR_Window, M_BRINGTOFRONT)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use window open/close messages for findings modal

CR_Window is created with FUI_Window, but this code sends M_SHOW/M_HIDE to it. In this codebase, the window message handler only changes visibility on M_OPEN/M_CLOSE (see src/Modules/F-UI.bb window branch), so the findings modal does not reliably hide/show: it can remain visible after Conscience_CloseModal() and may not reopen correctly after titlebar close interactions. Switching these calls to window-specific messages will make modal visibility match CR_Open.

Useful? React with 👍 / 👎.

Comment on lines +269 to +272
FUI_SendMessage(cb, M_SETINDEX, i)
Local item = FUI_SendMessage(cb, M_GETSELECTED)
Local cap$ = Upper$(FUI_SendMessage(item, M_GETCAPTION))
If cap$ = target$ Then Return True
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve combobox selection while validating scripts

The validator mutates live UI state by calling M_SETINDEX on CItemScript/CSpellScript for every lookup and never restoring the prior selection. Because Conscience_Validate() runs periodically, users editing items/spells can see the script dropdown jump to whichever index was last scanned, which is confusing and can lead to accidental edits. Snapshot and restore the combobox index (or inspect item captions without changing selection).

Useful? React with 👍 / 👎.

@CoreyRDean
Copy link
Copy Markdown
Collaborator Author

Closing this PR. Pivoting from "port Loom concepts into the existing GUE" to building a fresh Loom.bb editor as a parallel alpha. The F-UI quirks we hit (window M_HIDE no-ops, listbox/combobox handle inversion, the Tab M_SETINDEX nested-iterator pathology) make incremental retrofit a losing game. New approach will be a clean drop-in editor launched from Project Manager alongside GUE, sharing the on-disk data formats but not the UI shell. Branch will be deleted; nothing landed on develop so no revert needed.

@CoreyRDean CoreyRDean closed this May 26, 2026
@CoreyRDean CoreyRDean deleted the coreyrdean/loom-conscience-ribbon branch May 26, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant