Skip to content

Add media playback layout to media page#75

Merged
baba-dev merged 1 commit into
mainfrom
codex/refactor-media-page-layout-with-new-ui-elements
Sep 19, 2025
Merged

Add media playback layout to media page#75
baba-dev merged 1 commit into
mainfrom
codex/refactor-media-page-layout-with-new-ui-elements

Conversation

@baba-dev
Copy link
Copy Markdown
Owner

Summary

  • refactor the media page content container to use a padded flex column layout
  • add a "Now Playing" room card with placeholder album art, track metadata, and transport controls
  • add a secondary "Quick Scenes" card populated with stub buttons for future actions

Testing

  • ./scripts/idf.py build (fails: IDF_PATH is not set in the container environment)

https://chatgpt.com/codex/tasks/task_e_68cc93f6eaf083249106126903067eac

@baba-dev baba-dev merged commit 08e27f7 into main Sep 19, 2025
1 of 7 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +22 to +30
lv_obj_t* content = lv_obj_create(page);
lv_obj_remove_style_all(content);
lv_obj_set_size(content, LV_PCT(100), LV_PCT(100));
lv_obj_set_style_bg_opa(content, LV_OPA_TRANSP, LV_PART_MAIN);
lv_obj_set_style_pad_left(content, 192, LV_PART_MAIN);
lv_obj_set_style_pad_right(content, 48, LV_PART_MAIN);
lv_obj_set_style_pad_top(content, 40, LV_PART_MAIN);
lv_obj_set_style_pad_bottom(content, 40, LV_PART_MAIN);
lv_obj_set_style_pad_row(content, 32, LV_PART_MAIN);
lv_obj_set_style_pad_all(content, 48, LV_PART_MAIN);
lv_obj_set_style_pad_gap(content, 32, LV_PART_MAIN);
lv_obj_set_flex_flow(content, LV_FLEX_FLOW_COLUMN);
lv_obj_set_flex_align(content, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);

lv_obj_t *title = lv_obj_create(content);
lv_obj_remove_style_all(title);
lv_obj_set_width(title, LV_PCT(100));
lv_obj_set_style_bg_color(title, lv_color_hex(0x171f2b), LV_PART_MAIN);
lv_obj_set_style_bg_opa(title, LV_OPA_80, LV_PART_MAIN);
lv_obj_set_style_radius(title, 16, LV_PART_MAIN);
lv_obj_set_style_shadow_width(title, 24, LV_PART_MAIN);
lv_obj_set_style_shadow_opa(title, LV_OPA_50, LV_PART_MAIN);
lv_obj_set_style_shadow_ofs_y(title, 10, LV_PART_MAIN);
lv_obj_set_style_border_width(title, 0, LV_PART_MAIN);
lv_obj_set_style_pad_all(title, 28, LV_PART_MAIN);

lv_obj_t *label = lv_label_create(title);
lv_label_set_text(label, title_text);
lv_obj_set_width(label, LV_PCT(100));
lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN);
lv_obj_set_style_text_font(label, &lv_font_montserrat_32, LV_PART_MAIN);
lv_obj_set_style_text_color(label, lv_color_hex(0xf8fafc), LV_PART_MAIN);
lv_obj_clear_flag(content, LV_OBJ_FLAG_SCROLLABLE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Allow page content to grow so media cards can scroll

The new layout stacks two full ui_room_card instances and a 240 px album art area, but the content container remains hard‑sized to LV_PCT(100) height and is marked non‑scrollable. When the stacked card heights exceed the display height (e.g. on Tab5’s 540 px panel), the second card and lower controls are clipped and unreachable because the parent page never enlarges its scrollable area. Consider letting content use LV_SIZE_CONTENT (or enabling scrolling on it) so the page can actually scroll through tall media sections.

Useful? React with 👍 / 👎.

Comment on lines +64 to +71
ui_room_card_t* now_playing_card = ui_room_card_create(content, &now_playing_config);
if (now_playing_card != NULL)
{
lv_obj_t* card_obj = ui_room_card_get_obj(now_playing_card);
if (card_obj != NULL)
{
lv_obj_t* toggle = ui_room_card_get_toggle(now_playing_card);
if (toggle != NULL)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Clear scrollable flag on room cards to keep page scroll responsive

Both media cards are created via ui_room_card_create but the code never clears LV_OBJ_FLAG_SCROLLABLE on their container objects. ui_room_card leaves the flag set by default, so vertical swipe gestures on the card try to scroll the card itself rather than the page, effectively blocking page scrolling even when the page has overflow. Other pages (e.g. the Rooms page) explicitly call lv_obj_clear_flag(card_obj, LV_OBJ_FLAG_SCROLLABLE) after card creation; the media page should do the same for now_playing_card and the quick scenes card.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant