Skip to content

Conversation

laszlobalint
Copy link
Contributor

@laszlobalint laszlobalint commented Sep 9, 2025

Summary by cubic

Revamps the examples with a new, themed component library and showcase cards, replacing legacy widgets and updating fonts and build setup. Improves Editor preview compatibility and unifies component create APIs.

  • New Features

    • Added basic components: bar, button, card (+card_header), circle_button, column, div, icon_button, roller, row, slider, switch, table.
    • Added showcase cards: alarm, thermostat, weather (+location), music_player, speaker_volume, light_temperature, move_goal (+stat_col), theme_switcher.
    • Introduced theme tokens and units in examples_gen.h (light/dark colors, OPA_MUTED, UNIT_*), with simple dark theme bindings across components.
    • Added new fonts: Geist (Light/Regular/SemiBold), Abril Fatface, Big Shoulders; removed Inter.
    • Editor/Build: sample top-level CMake for preview (examples/CMakeLists copy.txt) and updated file_list_gen.cmake to include new sources.
  • Migration

    • Removed old components: checkbox, header, icon, setclock, step_button, subtitle, title, and legacy column/row variants. Update includes and calls to the new basic/* components or use LVGL built-ins where appropriate (e.g., lv_checkbox, lv_image, lv_label).
    • Replace header/subtitle/title usages with card_header or labels using the new Geist fonts; replace icon with icon_button or lv_image.
    • Verify build picks up new files via examples/file_list_gen.cmake and remove references to deleted sources and Inter font.

Copy link

@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.

40 issues found across 265 files

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


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

selector_and_prop = ((LV_STYLE_OPA & 0xff) << 24) | 0;
lv_anim_init(&a);
lv_anim_set_custom_exec_cb(&a, int_anim_exec_cb);
lv_anim_set_var(&a, "div_1");
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Animation var set to "div_1" string; treated as lv_obj_t* in exec callback, causing a crash.

Prompt for AI agents
Address the following comment on examples/components/cards/alarm/alarm_gen.c at line 254:

<comment>Animation var set to &quot;div_1&quot; string; treated as lv_obj_t* in exec callback, causing a crash.</comment>

<file context>
@@ -0,0 +1,282 @@
+    selector_and_prop = ((LV_STYLE_OPA &amp; 0xff) &lt;&lt; 24) | 0;
+    lv_anim_init(&amp;a);
+    lv_anim_set_custom_exec_cb(&amp;a, int_anim_exec_cb);
+    lv_anim_set_var(&amp;a, &quot;div_1&quot;);
+    lv_anim_set_values(&amp;a, 0, 255);
+    lv_anim_set_duration(&amp;a, 200);
</file context>
Fix with Cubic

selector_and_prop = ((LV_STYLE_OPA & 0xff) << 24) | 0;
lv_anim_init(&a);
lv_anim_set_custom_exec_cb(&a, int_anim_exec_cb);
lv_anim_set_var(&a, "div_0/roller_1");
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Animation var set to "div_0/roller_1" string; exec callback treats it as lv_obj_t*, leading to undefined behavior.

Prompt for AI agents
Address the following comment on examples/components/cards/alarm/alarm_gen.c at line 234:

<comment>Animation var set to &quot;div_0/roller_1&quot; string; exec callback treats it as lv_obj_t*, leading to undefined behavior.</comment>

<file context>
@@ -0,0 +1,282 @@
+    selector_and_prop = ((LV_STYLE_OPA &amp; 0xff) &lt;&lt; 24) | 0;
+    lv_anim_init(&amp;a);
+    lv_anim_set_custom_exec_cb(&amp;a, int_anim_exec_cb);
+    lv_anim_set_var(&amp;a, &quot;div_0/roller_1&quot;);
+    lv_anim_set_values(&amp;a, 0, 255);
+    lv_anim_set_duration(&amp;a, 200);
</file context>
Fix with Cubic

selector_and_prop = ((LV_STYLE_OPA & 0xff) << 24) | 0;
lv_anim_init(&a);
lv_anim_set_custom_exec_cb(&a, int_anim_exec_cb);
lv_anim_set_var(&a, "div_0/roller_0");
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Animation var set to "div_0/roller_0" string; exec callback expects an lv_obj_t*, leading to invalid pointer use.

Prompt for AI agents
Address the following comment on examples/components/cards/alarm/alarm_gen.c at line 214:

<comment>Animation var set to &quot;div_0/roller_0&quot; string; exec callback expects an lv_obj_t*, leading to invalid pointer use.</comment>

<file context>
@@ -0,0 +1,282 @@
+    selector_and_prop = ((LV_STYLE_OPA &amp; 0xff) &lt;&lt; 24) | 0;
+    lv_anim_init(&amp;a);
+    lv_anim_set_custom_exec_cb(&amp;a, int_anim_exec_cb);
+    lv_anim_set_var(&amp;a, &quot;div_0/roller_0&quot;);
+    lv_anim_set_values(&amp;a, 0, 255);
+    lv_anim_set_duration(&amp;a, 200);
</file context>
Fix with Cubic

selector_and_prop = ((LV_STYLE_TRANSLATE_Y & 0xff) << 24) | 0;
lv_anim_init(&a);
lv_anim_set_custom_exec_cb(&a, int_anim_exec_cb);
lv_anim_set_var(&a, "header");
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Animation target is set to a string literal, but the exec callback treats it as an lv_obj_t*, leading to invalid pointer dereference at runtime.

Prompt for AI agents
Address the following comment on examples/components/cards/alarm/alarm_gen.c at line 194:

<comment>Animation target is set to a string literal, but the exec callback treats it as an lv_obj_t*, leading to invalid pointer dereference at runtime.</comment>

<file context>
@@ -0,0 +1,282 @@
+    selector_and_prop = ((LV_STYLE_TRANSLATE_Y &amp; 0xff) &lt;&lt; 24) | 0;
+    lv_anim_init(&amp;a);
+    lv_anim_set_custom_exec_cb(&amp;a, int_anim_exec_cb);
+    lv_anim_set_var(&amp;a, &quot;header&quot;);
+    lv_anim_set_values(&amp;a, -40, 0);
+    lv_anim_set_duration(&amp;a, 200);
</file context>
Fix with Cubic

@@ -0,0 +1,554 @@
project/CMakeFiles/lib-ui.dir/components/cards/weather/weather_gen.c.o: \
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Generated build dependency file (.o.d) is committed. Exclude CMake build outputs (e.g., examples/preview-build) from VCS to avoid churn, conflicts, and leaking environment-specific paths.

Prompt for AI agents
Address the following comment on examples/preview-build/project/CMakeFiles/lib-ui.dir/components/cards/weather/weather_gen.c.o.d at line 1:

<comment>Generated build dependency file (.o.d) is committed. Exclude CMake build outputs (e.g., examples/preview-build) from VCS to avoid churn, conflicts, and leaking environment-specific paths.</comment>

<file context>
@@ -0,0 +1,554 @@
+project/CMakeFiles/lib-ui.dir/components/cards/weather/weather_gen.c.o: \
+  /lved/project/components/cards/weather/weather_gen.c \
+  /lved/project/components/cards/weather/weather_gen.h \
</file context>
Fix with Cubic

@@ -0,0 +1,554 @@
project/CMakeFiles/lib-ui.dir/components/basic/switch/switch_gen.c.o: \
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Generated build artifacts are committed (object and dep files under preview-build), which are environment-specific and should be ignored to keep the repo clean and builds reproducible.

Prompt for AI agents
Address the following comment on examples/preview-build/project/CMakeFiles/lib-ui.dir/components/basic/switch/switch_gen.c.o.d at line 1:

<comment>Generated build artifacts are committed (object and dep files under preview-build), which are environment-specific and should be ignored to keep the repo clean and builds reproducible.</comment>

<file context>
@@ -0,0 +1,554 @@
+project/CMakeFiles/lib-ui.dir/components/basic/switch/switch_gen.c.o: \
+  /lved/project/components/basic/switch/switch_gen.c \
+  /lved/project/components/basic/switch/switch_gen.h \
</file context>
Fix with Cubic

}
}

var noExitRuntime = Module['noExitRuntime'] || true;
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Using || true here overrides an explicit false and prevents expected runtime exit; use nullish coalescing to preserve false.

Prompt for AI agents
Address the following comment on examples/preview-build/CMakeFiles/3.22.1/CompilerIdC/a.out.js at line 904:

<comment>Using || true here overrides an explicit false and prevents expected runtime exit; use nullish coalescing to preserve false.</comment>

<file context>
@@ -0,0 +1,1521 @@
+    }
+  }
+
+  var noExitRuntime = Module[&#39;noExitRuntime&#39;] || true;
+
+  var ptrToString = (ptr) =&gt; {
</file context>
Fix with Cubic


string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/lved/project/preview-build/${CMAKE_INSTALL_MANIFEST}"
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Writes manifest to a hard-coded absolute path; use a path relative to the script directory for portability.

Prompt for AI agents
Address the following comment on examples/preview-build/cmake_install.cmake at line 54:

<comment>Writes manifest to a hard-coded absolute path; use a path relative to the script directory for portability.</comment>

<file context>
@@ -0,0 +1,55 @@
+
+string(REPLACE &quot;;&quot; &quot;\n&quot; CMAKE_INSTALL_MANIFEST_CONTENT
+       &quot;${CMAKE_INSTALL_MANIFEST_FILES}&quot;)
+file(WRITE &quot;/lved/project/preview-build/${CMAKE_INSTALL_MANIFEST}&quot;
+     &quot;${CMAKE_INSTALL_MANIFEST_CONTENT}&quot;)
</file context>
Fix with Cubic


if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
include("/lved/project/preview-build/project/cmake_install.cmake")
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Absolute include path is non-portable; use a path based on CMAKE_CURRENT_LIST_DIR.

Prompt for AI agents
Address the following comment on examples/preview-build/cmake_install.cmake at line 42:

<comment>Absolute include path is non-portable; use a path based on CMAKE_CURRENT_LIST_DIR.</comment>

<file context>
@@ -0,0 +1,55 @@
+
+if(NOT CMAKE_INSTALL_LOCAL_ONLY)
+  # Include the install script for each subdirectory.
+  include(&quot;/lved/project/preview-build/project/cmake_install.cmake&quot;)
+
+endif()
</file context>
Fix with Cubic

@@ -0,0 +1,63 @@
file(REMOVE_RECURSE
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 9, 2025

Choose a reason for hiding this comment

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

Generated CMake build artifacts are being committed; these should be excluded from source control (e.g., via .gitignore) and removed from the repo to avoid churn and platform-specific noise.

Prompt for AI agents
Address the following comment on examples/preview-build/project/CMakeFiles/lib-ui.dir/cmake_clean.cmake at line 1:

<comment>Generated CMake build artifacts are being committed; these should be excluded from source control (e.g., via .gitignore) and removed from the repo to avoid churn and platform-specific noise.</comment>

<file context>
@@ -0,0 +1,63 @@
+file(REMOVE_RECURSE
+  &quot;CMakeFiles/lib-ui.dir/components/basic/bar/bar_gen.c.o&quot;
+  &quot;CMakeFiles/lib-ui.dir/components/basic/bar/bar_gen.c.o.d&quot;
</file context>
Fix with Cubic

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.

3 participants