Document sub-app navigation and view re-display pattern#634
Merged
Conversation
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
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.
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):
view_display()must be called in thecheck_on_navigated()branch to restore the view after a sub-app returnsdata_read())on_navigationis no longer a recommended method — instead, callview_display()directly in the dispatcher'scheck_on_navigated()branchon_navigationfrom the maximum class structure example and replaced it with a directview_display()call in the dispatcheron_navigationmethod implementation example that calleddata_read()andclient->view_model_update()Demo Apps:
z2ui5_cl_demo_app_339: Addedcheck_on_navigated()handling to callview_display()when returning from a sub-appz2ui5_cl_demo_app_342: Addedcheck_on_navigated()handling to callrender_main()when returning from a sub-appImplementation 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