Skip to content

Refactor UI actions to use client action API instead of view methods#630

Merged
oblomov-dev merged 1 commit into
standardfrom
claude/trusting-shannon-yw6os5
Jun 11, 2026
Merged

Refactor UI actions to use client action API instead of view methods#630
oblomov-dev merged 1 commit into
standardfrom
claude/trusting-shannon-yw6os5

Conversation

@oblomov-dev

Copy link
Copy Markdown
Member

Summary

This PR refactors multiple demo apps to use the new client->action->gen() API for triggering UI actions (timers, focus, title, scroll) instead of calling view builder methods like _z2ui5()->timer(), _z2ui5()->focus(), and _z2ui5()->title(). This aligns with the framework's shift toward a more explicit action-based architecture.

Key Changes

  • z2ui5_cl_demo_app_000: Replaced scroll state management (mt_scroll, mv_set_scroll) with a structured s_scroll variable. Removed view-based scrolling setup and replaced with client->action->gen() call using cs_event-scroll_to. Replaced lp_title() view method with client->action->gen() using cs_event-set_title_launchpad.

  • z2ui5_cl_demo_app_073: Removed timer and URL state attributes (mv_url, mv_check_timer_active). Replaced view-based timer setup with direct client->action->gen() call using cs_event-open_new_tab when the button is clicked.

  • z2ui5_cl_demo_app_064: Removed view-based timer setup. Added client->action->gen() call using cs_event-start_timer in the event handler when the timer completes.

  • z2ui5_cl_demo_app_082: Removed view-based timer setup. Added client->action->gen() calls using cs_event-start_timer in both the event handler and view display method.

  • z2ui5_cl_demo_app_049: Removed view-based timer setup. Added client->action->gen() calls using cs_event-start_timer in both the event handler and view display method.

  • z2ui5_cl_demo_app_118: Removed _z2ui5()->title() view method call. Added client->action->gen() call using cs_event-set_title in the view display method.

  • z2ui5_cl_demo_app_279: Removed _z2ui5()->focus() view method call. Added client->action->gen() call using cs_event-set_focus in the view display method.

  • z2ui5_cl_demo_app_307: Removed _z2ui5()->title() view method call. Added client->action->gen() call using cs_event-set_title in the view display method.

  • z2ui5_cl_demo_app_316: Removed _z2ui5()->title() view method call. Added client->action->gen() call using cs_event-set_title in the view display method.

  • z2ui5_cl_demo_app_320: Removed _z2ui5()->title() view method call. Added client->action->gen() call using cs_event-set_title in the view display method.

Implementation Details

  • All timer actions now use cs_event-start_timer with event name and delay in milliseconds as arguments.
  • Title actions use cs_event-set_title or cs_event-set_title_launchpad with the title string as an argument.
  • Focus actions use cs_event-set_focus with the control ID as an argument.
  • Scroll actions use cs_event-scroll_to with ID, Y position, and X position as arguments.
  • State management for transient UI actions (timers, URLs) has been removed from class attributes where the action is now triggered directly via the client API.

https://claude.ai/code/session_013vV6hf86priocTxjQCFC4v

Migrate samples from the obsolete z2ui5 custom controls (timer, title,
lp_title, focus, scrolling) to the built-in frontend events via
client->action->gen( cs_event-* ):

- 000: lp_title -> SET_TITLE_LAUNCHPAD, scrolling -> SCROLL_TO with
  s_scroll captured before sub-app navigation
- 049, 082: repeating timer -> START_TIMER re-armed on TIMER_FINISHED
- 064: conditional timer -> START_TIMER re-armed while loading is active
- 073: timer + open_new_tab workaround -> direct OPEN_NEW_TAB action
- 118, 307, 316, 320: title -> SET_TITLE
- 279: focus -> SET_FOCUS

https://claude.ai/code/session_013vV6hf86priocTxjQCFC4v
@oblomov-dev oblomov-dev merged commit 8b5ec8a into standard Jun 11, 2026
5 of 6 checks passed
@oblomov-dev oblomov-dev deleted the claude/trusting-shannon-yw6os5 branch June 11, 2026 10:54
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