Skip to content

Document sub-app navigation and view re-display pattern#634

Merged
oblomov-dev merged 2 commits into
standardfrom
claude/view-init-navigation-3nfffr
Jul 6, 2026
Merged

Document sub-app navigation and view re-display pattern#634
oblomov-dev merged 2 commits into
standardfrom
claude/view-init-navigation-3nfffr

Conversation

@oblomov-dev

Copy link
Copy Markdown
Member

Summary

Updated CLAUDE.md documentation to clarify the required pattern for handling navigation returns from sub-apps and popups, and aligned two demo apps with this pattern.

Key Changes

  • Documentation (CLAUDE.md):

    • Added new section "Returning from a sub-app — always re-display the view" explaining that view_display() must be called in the check_on_navigated() branch to restore the view after a sub-app returns
    • Clarified that class attributes survive serialization, so only the view needs re-rendering (no need to call data_read())
    • Updated the lifecycle checks section with a note directing readers to the new sub-app navigation section
    • Revised the method extraction guidelines to reflect that on_navigation is no longer a recommended method — instead, call view_display() directly in the dispatcher's check_on_navigated() branch
    • Removed on_navigation from the maximum class structure example and replaced it with a direct view_display() call in the dispatcher
    • Removed the on_navigation method implementation example that called data_read() and client->view_model_update()
  • Demo Apps:

    • z2ui5_cl_demo_app_339: Added check_on_navigated() handling to call view_display() when returning from a sub-app
    • z2ui5_cl_demo_app_342: Added check_on_navigated() handling to call render_main() when returning from a sub-app

Implementation Details

The changes establish a clear, consistent pattern: after a sub-app or popup returns control, the framework does not automatically restore the previous view. Instead, apps must explicitly re-display their view in the check_on_navigated() branch. This is safe to do unconditionally — even after a popup where the main view remained on screen, re-rendering is harmless and ensures consistency.

https://claude.ai/code/session_018pLmFwyFsNPqgaKMDjdG2s

claude added 2 commits July 5, 2026 23:53
The frontend only replaces the main view when the response contains view
XML - after returning from a full-screen sub-app the browser still shows
the sub-app's view. App state survives the draft serialization, so the
check_on_navigated branch only needs view_display( ), no data re-read.

- CLAUDE.md: document the rule and fix the canonical template
  (on_navigation with data_read + view_model_update produced a blank
  screen after app-to-app navigation; view_model_update is only
  sufficient when returning from a popup)
- demo apps 339/342: add the missing re-display block on navigation
  return, matching sibling apps 335/337/343-349

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018pLmFwyFsNPqgaKMDjdG2s
view_display is always safe on navigation return - after a popup it just
re-renders the unchanged main view. Demote view_model_update to an
optional popup-only optimization instead of presenting it as an
equivalent alternative.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018pLmFwyFsNPqgaKMDjdG2s
@oblomov-dev oblomov-dev merged commit 7b24e96 into standard Jul 6, 2026
6 checks passed
@oblomov-dev oblomov-dev deleted the claude/view-init-navigation-3nfffr branch July 6, 2026 00:14
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.

2 participants