Skip to content

Reorganize documentation: move browser interaction and device features to cookbook - #87

Merged
oblomov-dev merged 3 commits into
mainfrom
claude/elegant-knuth-BKmIf
May 22, 2026
Merged

Reorganize documentation: move browser interaction and device features to cookbook#87
oblomov-dev merged 3 commits into
mainfrom
claude/elegant-knuth-BKmIf

Conversation

@oblomov-dev

Copy link
Copy Markdown
Member

Summary

This PR reorganizes the documentation structure to improve navigation and clarity. Content related to browser interactions and device capabilities has been moved from docs/development/specific/ to a new docs/cookbook/browser_interaction/ and docs/cookbook/device_capabilities/ structure, with corresponding updates to the sidebar navigation configuration.

Key Changes

  • Removed custom control approach: Deleted documentation for z2ui5.Timer, z2ui5.focus(), and z2ui5.scrolling() custom controls that relied on data binding
  • Introduced frontend events: Added new documentation for equivalent functionality using frontend events:
    • start_timer event for timer functionality (replaces Timer custom control)
    • set_focus event for focus management (replaces focus custom control)
    • scroll_to and scroll_into_view events for scrolling (replaces scrolling custom control)
    • keyboard_set_mode event for soft keyboard control
  • Reorganized documentation structure:
    • Created docs/cookbook/browser_interaction/ with: timer, focus, scrolling, title, clipboard, url_handling
    • Created docs/cookbook/device_capabilities/ with: info, camera, geolocation, barcode_scanning, soft_keyboard, pdf, upload_download, spreadsheet
    • Moved event-related docs to docs/cookbook/event_navigation/ with new action.md for follow-up actions
    • Moved expert topics to docs/cookbook/expert_more/
  • Updated navigation config (docs/.vitepress/config.mjs): Updated all sidebar links to reflect new directory structure and renamed pages for consistency
  • Simplified page titles: Changed plural titles to singular (e.g., "Locks" → "Lock", "Messages" → "Message") for consistency
  • Updated cross-references: Fixed internal links in barcode_scanning, soft_keyboard, and other docs to point to new locations

Implementation Details

The refactoring shifts from a custom control model (where UI state was bound to backend variables) to a frontend event model (where the backend explicitly triggers browser actions via client->action()). This approach is more explicit and aligns better with how modern web frameworks handle side effects.

All code examples have been updated to use the new event-based API while maintaining the same functionality.

https://claude.ai/code/session_01C1F5XKNxAH4WAYm4czApQy

claude added 3 commits May 22, 2026 18:53
Move files from docs/development/* into docs/cookbook/<section>/
where <section> matches each cookbook menu group (view,
model, event_navigation, popup_popover, device_capabilities,
browser_interaction, translation_messages, eml_cds_sql,
expert_more), and rename files so each filename matches the
menu entry text (e.g. nested.md -> nested_views.md, errors.md
-> exception.md, locks.md -> lock.md, files.md ->
upload_download.md, xlsx.md -> spreadsheet.md, device.md ->
device_model.md, translation.md -> translation_i18n.md).

The two Experimental items live under the Advanced Topic menu,
so move drag.md and smart_controls.md to
docs/advanced/experimental/. Update all sidebar/nav links in
.vitepress/config.mjs and fix intra-page references in
custom_js.md, next.md, popup.md and the moved files. Delete
the orphan placeholder development/navigation/navigation.md.
Update the H1 of each cookbook page so it matches the sidebar
entry that links to it: Follow-up -> Action, Inner/Cross App
-> Navigation, Errors -> Exception, Built-In Popups ->
Built-In, Geolocation, Maps -> Geolocation, Timer,
Auto-Refresh -> Timer, Messages -> Message, Logging, BAL ->
Logging, Locks -> Lock, App State, Share, Bookmark -> App
State, Share, CL_DEMO_OUTPUT -> Demo Output, Smart Controls
-> Smart Control.
Update all cookbook code samples and prose so that backend-triggered
frontend events use the new client->action( val = ..., t_arg = ... )
method instead of the deprecated
client->follow_up_action( client->_event_client( ... ) ) pattern.
follow_up_action is no longer the recommended call.

Rewrite the four browser interaction pages whose custom controls
(_z2ui5( )->focus/scrolling/timer and the document.title JS pattern)
are now redundant — they can be driven directly from the backend via
the corresponding cs_event constants:

  title.md      -> cs_event-set_title
  focus.md      -> cs_event-set_focus
  scrolling.md  -> cs_event-scroll_to / cs_event-scroll_into_view
  timer.md      -> cs_event-start_timer (re-arm in the handler to repeat)

Also update soft_keyboard.md to use cs_event-keyboard_set_mode, and
barcode_scanning.md to use cs_event-set_focus and cs_event-play_audio,
removing the previous raw-JavaScript follow-up patterns.

Extend frontend.md with the new cs_event constants
(set_title, set_focus, scroll_to, scroll_into_view, start_timer,
keyboard_set_mode, clipboard_copy, clipboard_app_state, history_back)
and explain the relationship between _event_client (inline frontend)
and the new action method (frontend event triggered from the backend).
@oblomov-dev
oblomov-dev merged commit 55928c8 into main May 22, 2026
@oblomov-dev
oblomov-dev deleted the claude/elegant-knuth-BKmIf branch May 22, 2026 19:07
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