Skip to content

refactor: unify contact number actions into a single source of truth#1410

Merged
SERDUN merged 2 commits into
developfrom
refactor/contact-actions-dedup
Jun 18, 2026
Merged

refactor: unify contact number actions into a single source of truth#1410
SERDUN merged 2 commits into
developfrom
refactor/contact-actions-dedup

Conversation

@SERDUN

@SERDUN SERDUN commented Jun 18, 2026

Copy link
Copy Markdown
Member

Overview

The contact action surfaces each kept their own hardcoded list of actions, so the same action was offered twice at once with inconsistent wording:

  • The inline expandable actions bar and the popup menu both listed audio/video call, history and view-contact. The More button reopened the full menu, repeating everything already shown in the bar.
  • Labels diverged between the two surfaces: "History" vs "View call history", "Contact" vs "View Contact".
  • ContactPhoneTile (contact details) maintained a third, separate popup builder with the same actions yet again.

Changes

  • Add NumberAction plus a single buildNumberActions builder (lib/widgets/call/number_actions.dart) as the one source of truth for the set, labels, icons and ordering of contact actions. Each action carries a primary flag.
  • CallTile now derives both surfaces from that model:
    • the inline bar renders the primary actions;
    • More opens an overflow menu with only the remaining actions, so it never repeats what is already in the bar (and is hidden when there is no overflow);
    • long press / the collapsed-row menu button still expose the full set.
  • ContactPhoneTile builds its overflow menu from the same builder instead of its own hardcoded entries; inline call/video/message icons and the favorite / initiated-transfer affordances are unchanged.
  • Labels consolidated to one key per action ("History", "Contact").

Messaging/chat behavior is intentionally left as-is.

Testing

  • flutter analyze clean.
  • flutter test - full suite green (updated call_tile, contact_tile, contact_phone_tile_adapter tests for the new overflow semantics; added coverage for long-press = full menu and More-hidden-without-overflow).

Out of scope

  • keypad/widgets/actionpad.dart still has its own popup builder - a candidate to migrate onto the same model later.

The inline actions bar and the popup menu each maintained their own
hardcoded list of contact actions, so the same action (audio/video call,
history, view contact) appeared in both surfaces at once, with diverging
labels (History vs View call history, Contact vs View Contact). The More
button reopened the full menu, repeating everything already in the bar.

Introduce NumberAction plus a single buildNumberActions builder that both
surfaces derive from: the inline bar renders the primary actions, the More
menu shows only the rest, and long press still exposes the full set on a
collapsed row. ContactPhoneTile now builds its overflow menu from the same
builder instead of its own hardcoded entries.
@SERDUN SERDUN changed the title refactor: unify contact number actions into a single source of truth (WT-945) refactor: unify contact number actions into a single source of truth Jun 18, 2026
The trailing dial button is a static call shortcut that stays visible in
both states. When the tile is expanded, drop the inline call action of the
same kind as the dial button (audio or video) so the actions bar no longer
repeats it.
@SERDUN SERDUN force-pushed the refactor/contact-actions-dedup branch from 26802eb to c80e465 Compare June 18, 2026 13:11
@SERDUN SERDUN requested a review from Copilot June 18, 2026 13:19

Copilot AI left a comment

Copy link
Copy Markdown

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 refactors contact/phone-number action handling into a shared model so that inline action bars and popup menus stay consistent (labels, ordering, and duplication behavior) across call tiles and contact phone tiles.

Changes:

  • Introduces NumberAction, buildNumberActions, and numberActionsToMenu as a single source of truth for number-related actions.
  • Updates CallTile to derive inline actions from primary actions and show a true overflow-only More menu (with long-press still showing the full menu).
  • Updates ContactPhoneTile to build its overflow menu from the shared builder and aligns tests with the new semantics and labels.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/widgets/call/call_tile_test.dart Adds coverage for dial-button duplication suppression, overflow-only More behavior, and long-press full menu.
test/features/contacts/widgets/contact_tile_test.dart Updates expanded-tile expectations to reflect More hiding when no overflow actions exist.
test/features/contact/widgets/contact_phone_tile_adapter_test.dart Updates expectations for the consolidated “History” label.
lib/widgets/call/number_actions.dart Adds shared NumberAction model and builders for action lists and popup menu entries.
lib/widgets/call/call.dart Exports number_actions.dart alongside call widgets.
lib/widgets/call/call_tile.dart Refactors action bar and menus to use the shared action model and overflow-only More menu.
lib/features/contact/widgets/contact_phone_tile.dart Replaces hardcoded popup entries with shared number-actions builder/menu conversion.

@SERDUN SERDUN merged commit d3bc4b6 into develop Jun 18, 2026
3 checks passed
@SERDUN SERDUN deleted the refactor/contact-actions-dedup branch June 18, 2026 14:02
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.

2 participants