Skip to content

feat: LVGL 8.4 upgrade, focus navigation, component API refactors, navigation/gateway demos, fix memory leak, and i18n#54

Open
sunnyswag wants to merge 62 commits intolvgl:masterfrom
sunnyswag:master
Open

feat: LVGL 8.4 upgrade, focus navigation, component API refactors, navigation/gateway demos, fix memory leak, and i18n#54
sunnyswag wants to merge 62 commits intolvgl:masterfrom
sunnyswag:master

Conversation

@sunnyswag
Copy link
Copy Markdown
Contributor

@sunnyswag sunnyswag commented Feb 22, 2026

Summary

This PR includes LVGL and React dependency upgrades, LVGL Group-based focus navigation, component API and styling refactors, new navigation and gateway demos with i18n, and build/config improvements.

Dependencies & core

  • LVGL: Upgrade from v8.3.0-dev to v8.4.0 (includes scroll-to-view fix for horizontal focus navigation).
  • React: Upgrade to 18.3.1 with react-reconciler 0.29.2; improved instance cleanup and finalization.
  • Txiki: Update subproject to support fetch blob.
  • Build: CMake updates for LVGLJS_CONF_DIR and display resolution; add static library build and refactor main entry.

Focus & navigation

  • Implement LVGL Group focus navigation (GroupManager later removed in favor of direct lv_group_* usage).
  • Add addToFocusGroup and focus handling on View; refine LV_OBJ_FLAG_SCROLL_ON_FOCUS usage.
  • Simplify focus handling: remove useAutoFocus hook and GroupManager; use autoFocus and addToFocusGroup props.
  • Improve child insertion and focus order via reorderFocusGroup and BasicComponent changes.

Component API & styling

  • setProps: Refactor to use UpdatePayload and propDiffer across Button, Text, View, Arc, Calendar, Canvas, Chart, Checkbox, Dropdownlist, GIF, Image, Input, Keyboard, Line, Mask, ProgressBar, Roller, Slider, Switch, Tabs, Textarea, Window.
  • Replace CommonComponentApi with setComponentProps for consistent property handling.
  • Use CreateStyle instead of Record<string, any> for style types; rename style-transition-time to transition-time.
  • Simplify align logic in common setters; remove duplicate code in style.cpp.
  • Style updates: padding/border-radius across components; remove background-opacity; improve color handling (4/8-digit hex with opacity); countdown angle and CountdownSettingsPage styles.

Demos

  • Navigation demo: Multi-page demo with React Router, auto-focus, and ref-based component registration.
  • i18n: Internationalization (EN/CN/JP) with message caching and improved locale loading.
  • Gateway demo: New demo with device info, device status, event log, settings, and updated icons/header.

Fixes & misc

  • fetchBinary: Better HTTP error handling and messaging; GIF/Image use shared fetchBinary instead of getBinary.
  • Fix image paths in test components; fix countdown angle calculation; fix select item order; resolve compile and TS warnings.
  • Refactor init_input_devices for indev init; update .gitignore.

Summary by cubic

Upgrades LVGL to 8.4 and React to 18.3.1, adds LVGL group-based focus navigation, and ships new navigation/gateway demos with i18n. Also adds a static library build and device resolution config, plus component API and styling refactors.

  • New Features

    • Focus navigation: LVGL group-based; add autoFocus and addToFocusGroup; expose focus() on components; improved focus order; focus edge callback for pagination.
    • Demos: new multi-page navigation and gateway demos using React Router and i18n (EN/JA/ZH) with message caching.
    • Build: static library option (-DBUILD_STATIC_LIB), LVGLJS_CONF_DIR support, and configurable DISP_HOR_RES/DISP_VER_RES.
    • Component/API: unified setComponentProps with UpdatePayload/propDiffer; CreateStyle for styles; improved color parsing (3/4/6/8-digit hex).
  • Bug Fixes

    • Horizontal scroll-to-view works correctly with LVGL 8.4.
    • fetchBinary now reports HTTP errors; GIF/Image use the shared loader.
    • Fixed countdown angle and select item order; resolved compile and TypeScript warnings.

Written for commit d34d458. Summary will update on new commits.

sunnyswag and others added 30 commits November 11, 2025 12:21
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…y point

- Introduced option to build lvgljs as a static library.
- Refactored engine initialization and execution into separate functions.
- Updated CMakeLists.txt and Makefile to accommodate new build configurations.
- Added main.cpp as the entry point for executable builds.
- Add GroupManager singleton to manage lv_group_t instances
- Modify BasicComponent appendChild/removeChild to handle group membership
- Add unregisterContainer call in BasicComponent destructor
- Remove auto lv_group_add_obj from all component constructors (21 files)
- Add setInGroup method to View component for JS binding
- Add DefaultGroup constant in React layer
- Add group prop support in View React component
- Add onFocusedStyle support in CommonComponentApi
- Add test case in test/group/1/index.jsx
- Introduced AddChildToDefGroup and AddCurToDefGroup symbols for group type management.
- Updated View component to support groupType prop for specifying group behavior.
- Modified GroupManager to handle new group types and improve child management.
- Refactored BasicComponent methods to integrate with the new group system.
- Updated documentation and examples to reflect changes in group handling.
…ality

- Introduced a new navigation demo with five pages showcasing various UI components.
- Implemented auto-focus behavior for buttons and interactive elements using the useAutoFocus hook.
- Added components for lists, info display, controls, and a countdown timer.
- Enhanced the BasicComponent class to support focus functionality for improved accessibility.
- Updated styles and layout for a cohesive user experience across pages.
- Refactored component registration to use registerWithRef for improved ref handling.
- Updated the View, Text, Image, Button, and other components to utilize the new registration method.
- Simplified the ref assignment in the Page1List component for better readability and functionality.
- Upgraded React to version 16.14.0 and ensured consistent versioning for react-reconciler.
- Refactored instance management in the reconciler to use Map for better performance and reliability.
- Added cleanupInstance function to handle child component destruction and prevent memory leaks.
- Introduced RootContainer class to manage child components with stable ordering semantics.
- Improved text handling in the reconciler to support props for Text components.
- Added i18n functionality to the navigation demo, allowing for language switching between English and Chinese.
- Integrated translation keys for all text elements across the demo pages.
- Created separate JSON files for English and Chinese translations.
- Introduced a LangSwitcher component for selecting the language.
- Updated the App component to use I18nProvider for managing localization context.
- Refactored the messages handling in the I18nProvider to support dynamic loading of locale-specific messages.
- Introduced caching for loaded messages to enhance performance and reduce redundant loading.
- Updated the navigation demo to utilize the new message loading mechanism, ensuring proper fallback handling for translations.
- Adjusted type definitions for better clarity and maintainability in the i18n module.
…ization

- Updated React to version 18.3.1 and react-reconciler to version 0.29.2 for improved performance and features.
- Refactored component finalization methods to ensure proper cleanup and memory management, including logging during component destruction.
- Enhanced the cleanup process in the reconciler to prevent potential memory leaks by managing child instances more effectively.
- Updated type definitions for better clarity and maintainability in the React integration.
…mponents

- Eliminated the useAutoFocus hook to streamline focus handling.
- Updated components to utilize autoFocus and addToFocusGroup props for improved focus management.
- Refactored GroupManager to introduce addToFocusGroup and reorderFocusGroup methods for better focus group handling.
- Removed deprecated groupType prop from View component and adjusted related logic in the reconciler.
- Cleaned up unused imports and improved overall code clarity.
…ents

- Eliminated the GroupManager class and its methods for managing focus groups.
- Updated components to directly utilize lv_group_add_obj for focus management.
- Removed related function definitions and imports from the View and component files.
- Adjusted reconciler logic to remove obsolete focus group reordering functionality.
- Enhanced focus handling by integrating autoFocus directly into component props.
…, add LV_OBJ_FLAG_SCROLL_ON_FOCUS when invoke NativeCompAddToFocusGroup
This upgrade includes the fix for horizontal scroll-to-view bug:
- fix(scroll): fix scroll to view to the left (commit 7c74f65)

The bug caused focus_prev not working properly on horizontal
scrollable containers (e.g., ViewPager with flex-row layout).
- Set default scrollbar mode to off for the window instance to streamline UI experience.
huanghuiqing and others added 28 commits January 21, 2026 18:32
…le components

- Updated components including Arc, Button, Calendar, Canvas, Chart, Checkbox, Dropdownlist, GIF, Image, Input, Keyboard, Line, Mask, ProgressBar, Roller, Slider, Switch, Tabs, Text, Textarea, View, and Window to utilize setComponentProps for improved property management.
- This change enhances consistency across components and simplifies the property setting logic.
This update reflects the latest changes in the lvgl dependency, ensuring compatibility and access to recent improvements.
…ency

- Adjusted ProgressBar and Roller components to utilize reordered props for improved property management.
- Modified MiscStyle type and its processing logic to reflect the new naming convention.
…t, and View components

- Modified setProps in ButtonComp, TextComp, and ViewComp to accept UpdatePayload instead of newProps, enhancing property management.
- Updated corresponding config files to align with the new setProps signature.
- Introduced propDiffer utility to handle prop differences and streamline updates across components.
… components

- Refactored setProps in various components including Arc, Calendar, Canvas, Chart, Checkbox, Dropdownlist, GIF, Image, Input, Keyboard, Line, Mask, ProgressBar, Roller, Slider, Switch, Tabs, Textarea, and Window to accept UpdatePayload instead of newProps.
- Updated corresponding config files to align with the new setProps signature.
- Enhanced property management and consistency across components by utilizing the propDiffer utility for handling prop differences.
- Updated language handling in index.tsx to correctly load JSON files based on locale.
- Added new navigation icons for device info, device status, event log, and settings.
- Modified Header component to accept a backIcon prop for improved navigation.
- Adjusted styles for focused states and various components to ensure consistent UI experience.
- Updated multiple pages to utilize new icons and enhance header functionality.
…ay demo

- Updated index.tsx to load Japanese language JSON file based on locale.
- Modified ListItem component to use translation function for titles.
- Enhanced various pages to support localization and improved UI consistency.
- Updated language settings to reflect direct language labels instead of translation keys.
…across multiple components

- Removed "background-opacity" property from ListItem, CountdownSettingsPage, and DeviceInfoPage components for consistency.
- Updated "arc-color" in CountdownSettingsPage to a darker shade for improved visibility.
- Adjusted "background-color" in HomePage to a semi-transparent white for better UI aesthetics.
- Enhanced color handling in color.ts to support 4-digit and 8-digit hex formats, including opacity extraction.
… styling across components

- Updated ConfirmDialog, Header, ListItem, and various pages to use CreateStyle for defining styles.
- Improved code consistency and readability by standardizing the style definition approach.
…ion strings

- Implemented previous and next page navigation in LogDetailPage.
- Added corresponding localization strings for English, Japanese, and Chinese.
- Enhanced the user interface with new navigation items for improved usability.
…agination

- Added focus group support to LogDetailPage for improved navigation.
- Updated pagination logic to use constants for better readability.
- Included focus group initialization in the render bootstrap process.
- Refactored LogDetailPage to remove deprecated navigation components and streamline the UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 176 files

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="doc/style/color.md">

<violation number="1" location="doc/style/color.md:29">
P3: The example uses duplicate "background-color" keys in one object literal, so the first value is overwritten and the standard color case is never demonstrated.</violation>
</file>

<file name=".gitignore">

<violation number="1" location=".gitignore:6">
P2: Narrowing the ignore rule to `build/*` no longer ignores `build_lib/` created by the Makefile, so build artifacts can be accidentally committed.</violation>
</file>

<file name="demo/gateway/components/ConfirmDialog.tsx">

<violation number="1" location="demo/gateway/components/ConfirmDialog.tsx:33">
P2: confirmText/cancelText props are defined but the button labels are hard-coded (✕/✓), so callers cannot customize button text (e.g., localization).</violation>
</file>

<file name="demo/navigation/index.tsx">

<violation number="1" location="demo/navigation/index.tsx:379">
P2: Pager uses scroll-snap-x for horizontal paging but is laid out with flex-direction: "column", which stacks pages vertically and prevents horizontal scroll snapping/scrollIntoView from working as intended.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@sunnyswag sunnyswag changed the title feat: LVGL 8.4 upgrade, focus navigation, component API refactors, navigation/gateway demos, and i18n feat: LVGL 8.4 upgrade, focus navigation, component API refactors, navigation/gateway demos, fix memory leak, and i18n Feb 23, 2026
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.

1 participant