Skip to content

fix(icon): eliminate dead code by using $final in dynamic-component calls#164

Merged
namumakwembo merged 2 commits into
improvementsfrom
copilot/sub-pr-163
Mar 22, 2026
Merged

fix(icon): eliminate dead code by using $final in dynamic-component calls#164
namumakwembo merged 2 commits into
improvementsfrom
copilot/sub-pr-163

Conversation

Copilot AI commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

$final was computed in the @php block but never referenced — the identical ->merge() chain was repeated inline in both x-dynamic-component branches instead.

Changes

  • resources/views/components/icon.blade.php: Replace duplicated $attributes->merge(...) expressions in both @elseif branches with the already-computed $final variable
-    <x-dynamic-component :component="$icon" {{  $attributes
-        ->merge($iconBag->getAttributes())
-        ->merge(['class' => 'size-6 text-zinc-700 dark:text-gray-100 dark:hover:text-gray-200']) }} />
+    <x-dynamic-component :component="$icon" {{ $final }} />
 
-    <x-dynamic-component :component="$default" {{ $attributes
-        ->merge($iconBag->getAttributes())
-        ->merge(['class' => 'size-6 text-zinc-700 dark:text-gray-100 dark:hover:text-gray-200']) }} />
+    <x-dynamic-component :component="$default" {{ $final }} />

Merge logic is now defined once; any future attribute changes only need to be made in one place.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… merge logic

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/f2515fc8-4fb2-4f8d-be8c-57cda63337f6
Copilot AI changed the title [WIP] [WIP] Address feedback from PR #163 for feature improvements fix(icon): eliminate dead code by using $final in dynamic-component calls Mar 22, 2026
Copilot AI requested a review from namumakwembo March 22, 2026 12:20
@namumakwembo namumakwembo marked this pull request as ready for review March 22, 2026 12:29
Copilot AI review requested due to automatic review settings March 22, 2026 12:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes duplicated attribute-merge logic in the shared icon Blade component by reusing the already-computed $final attribute bag when rendering dynamic icon components.

Changes:

  • Use the precomputed $final attribute bag in both x-dynamic-component branches (icon + fallback default).
  • Eliminate duplicated inline ->merge(...) chains to keep attribute defaults defined in one place.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@namumakwembo namumakwembo merged commit 9eb8753 into improvements Mar 22, 2026
4 checks passed
namumakwembo added a commit that referenced this pull request Mar 22, 2026
* improvement: updated chats query logic to avoid requery on rerendering

* updated chats action icons and fixed redirect route rendering wrong route

* fix:persisted panel across chat drawer

* fixed:reorder bug on converations load more

* Fix chats load-more ordering with cursor pagination

* feat: added url param to redirectToHomeAction

* fix(ui): wrap persisted chats panel to restore responsive sidebar behavior

Move `x-persist="chats"` inside a non-persisted `<aside>` so Tailwind breakpoints (`hidden md:*`) control visibility correctly on small screens.

* ui:improved send message icon space

* feat(panel): support icons + icon attributes for chat actions

- Add per-action icon config (string/Htmlable/Closure)
- Add per-action iconAttributes (array/Closure) getters
- Keep existing enable/disable closures intact

* updates

* php stan

* added wirechat:storage disk env variable

* Update resources/views/components/tooltip.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/Panel/Concerns/HasActions.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update resources/views/livewire/chat/partials/header.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(icon): eliminate dead code by using `$final` in dynamic-component calls (#164)

* Initial plan

* fix(icon): use $final in dynamic-component calls to remove duplicated merge logic

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/f2515fc8-4fb2-4f8d-be8c-57cda63337f6

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>

* Fix invalid `$attributes->merge()` call in logout icon component (#166)

* Initial plan

* Fix $attributes->merge() in logout icon to use proper key-value format

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/d52bca44-4bde-4767-b1f3-548e78b27593

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>

* Add cursor-based pagination tests for Chats component

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/980dee24-199c-4bb8-b1c3-961c87cd4465

* Update tests/Feature/ChatsTest.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix Carbon compounding in loadMore, hardRefresh and search loop tests

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/b03192ce-2b54-4247-8e75-c4c501e248ba

* Update resources/views/livewire/chats/partials/header.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update resources/views/livewire/chats/partials/header.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update resources/views/components/tooltip.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/Panel/Concerns/HasChatActions.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Convert widget-mode return button from anchor to button element in chat header

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/a1f95912-3b1a-4803-8ef2-812302b2c92b

* Add type="button" to widget-mode return button in chat header

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/5f7b7a34-f5af-4ebf-a649-3bf4f4d1bc91

* Add chevron-left icon component and aria-label to header return controls

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/5d914ae4-95ec-4c6e-b32c-fd16e5785f3d

* feat(tooltip): add focus/blur accessibility and aria-describedby/role=tooltip

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/6ee5e1af-ebfa-4d2e-99c4-04da0bed0876

* Update resources/views/components/tooltip.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat(tooltip): touch support, aria-describedby on focused element, preserve focus-while-hover

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/88cbc727-99d2-48b1-80e2-756152e5f064

* Update resources/views/livewire/chats/chats.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/Livewire/Chats/Chats.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Initial plan

* fix: use created_at as cursor tie-breaker for UUID-safe pagination

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/295ccc86-e747-4c37-805a-8bbe0409fa11

* Update src/Livewire/Chats/Chats.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Initial plan

* Update tests/Feature/ChatsTest.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: hide redirect-to-home action when getHomeUrl() returns null

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/465c17c4-d740-4545-bb08-b7a24704144c

* Fix UUID-incompatible (int) casts on conversation IDs in Chats.php

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/1426c4e3-7267-440a-a992-9c208e9f9ddb

* fix: add id as third cursor tie-breaker for total ordering

Co-authored-by: namumakwembo <77463693+namumakwembo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wirechat/wirechat/sessions/1ff87733-a98c-4cfb-9a40-408d37a1cf4a

* Update resources/views/livewire/chats/partials/header.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update resources/views/livewire/chat/partials/footer.blade.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
@namumakwembo namumakwembo deleted the copilot/sub-pr-163 branch May 11, 2026 08:48
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