fix(icon): eliminate dead code by using $final in dynamic-component calls#164
Merged
Conversation
Merged
… 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 Mar 22, 2026
$final in dynamic-component calls
Contributor
There was a problem hiding this comment.
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
$finalattribute bag in bothx-dynamic-componentbranches (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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
$finalwas computed in the@phpblock but never referenced — the identical->merge()chain was repeated inline in bothx-dynamic-componentbranches instead.Changes
resources/views/components/icon.blade.php: Replace duplicated$attributes->merge(...)expressions in both@elseifbranches with the already-computed$finalvariableMerge 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.