Index Tab selected feedback, no-op guard, page-zero block, and auto-page creation#370
Merged
Conversation
…-page creation - IndexTabZone::State() returns selected state (1) when the terminal's current page matches the tab's jump_id, giving automatic visual feedback using the tab's configured selected-state edge, texture, and font color. - IndexTabZone::Touch() returns SIGNAL_IGNORED when already on the target page, preventing a redundant jump. - ZoneDB::Add() now rejects page id == 0 with a ReportError. - ZoneDB::NextAvailablePageID(start_id, page_size) added: returns the first unused page ID >= start_id for the given screen size. - Terminal::ReadZone(): when a brand-new ZONE_INDEX_TAB is saved with no jump target (JUMP_NONE), a PAGE_ITEM menu page is automatically created from the button name at the first available ID >= 60, and the button is wired to JUMP_NORMAL pointing at it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR implements three quality-of-life improvements to Index Tab buttons that together make it dramatically easier to build and navigate multi-page interfaces.
What changed
Visual feedback — active tab highlights automatically
IndexTabZone::State()is overridden to return the selected state (1) whenever the terminal's current page matches the tab'sjump_id. BecauseZone::Draw()already uses theState()result to pickframe[state],texture[state], andcolor[state], the tab for the page you're on renders automatically in its configured selected appearance (edge, texture, font color). No new fields onTerminalare needed.No-op guard — tapping your current tab does nothing
IndexTabZone::Touch()returnsSIGNAL_IGNOREDwhen the terminal is already on the tab's target page. This prevents a pointless re-jump and a screen flash when a user taps the tab for the page they're already viewing.Block page number zero
ZoneDB::Add(Page*)— the single authoritative insertion point for all pages — now rejects any page withid == 0with aReportError. No page numbered zero can be created through any code path.Auto-create a menu page when a new Index Tab button is saved
ZoneDB::NextAvailablePageID(int start_id, int page_size)is a new helper that walks up fromstart_iduntil it finds an unused page ID.In
Terminal::ReadZone(), when a brand-newZONE_INDEX_TABis saved with no jump target yet (JUMP_NONE), the system automatically:PAGE_ITEMmenu page named after the button.JUMP_NORMALtargeting the new page.Editing an existing Index Tab that already has a configured jump is completely unaffected.
Files changed
State()andTouch()overrides toIndexTabZoneZoneDB::NextAvailablePageID()ZoneDB::Add(); implementNextAvailablePageID()Terminal::ReadZone()[Unreleased] → Added6 files changed, 73 insertions(+), 1 deletion(-)