Skip to content

feat: Channel.abbreviation for export name shortening (name qualifier only) #150

Description

@pskillen

Context

As part of #130 we shipped export-time name shortening and a first-class TalkGroup.abbreviation field — optional operator override used at the export boundary when “Use talk-group abbreviations” is enabled. See name-shortening.md.

The same pattern is needed for the channel name qualifier (Channel.name), so operators can set a shorter label for export without polluting the canonical name.

Problem

Expanded export names compose callsign + name (+ mode / talk-group suffixes). Operators often need to shorten the qualifier (name) while keeping the full logical name in the project. Today only generic shortening heuristics apply; there is no per-channel override analogous to TalkGroup.abbreviation.

Scope

Model

  • Add optional Channel.abbreviation?: string on Channel (schema bump from v13).
  • Vendor-neutral field — same semantics as TalkGroup.abbreviation: export label only, not an internal FK, not import identity.
  • Applies to channel.name only. channel.callsign is a separate concern and continues to be abbreviated automatically by the existing shortening pipeline (e.g. callsign-suffix downgrade, dictionary, vowel-squeeze) — no callsign.abbreviation field in this ticket.

Export integration

Wire into the channel-expansion / name-shortening path (src/lib/channelExpansion/) — early substitution of the name qualifier when composing export wire names, before generic dictionary / vowel-squeeze / truncate steps (mirror TG abbreviation placement in the pipeline).

  • Respect a new export-time toggle (e.g. useChannelAbbreviation on ExportOptions / useExportSettings, default on when shortening is enabled — align with TG toggle behaviour).
  • When enabled and channel.abbreviation is set, use it in place of channel.name for composeChannelWireName (and downstream zone / TG-list member consistency).
  • Callsign portion of the composed wire name is unchanged by this field.

UI

Surface Behaviour
Channels → Edit Abbreviation text input below Name; description that it is used when export names are shortened. Show auto-generated suggestions from channel.name at 6, 8, 10, 12 char targets (reuse shortenWireName — same pattern as talkGroupAbbreviationSuggestions).
Channels → Detail Show abbreviation when set (mirror talk-group detail).
Channels → List Hideable Abbreviation column (add to CHANNEL_OPTIONAL_COLUMNS; bump column schema version).
Import & export / Settings Toggle for “Use channel abbreviations” alongside existing talk-group toggle.

Storage / CRUD

Docs / tests

  • Update name-shortening.md and data-model docs.
  • Unit tests: export substitution, compose + shorten with abbreviation set, callsign unaffected.
  • UI smoke optional.

Out of scope

  • Channel.callsign manual abbreviation field (automatic only).
  • Per-profile overrides on CodeplugProject#122.
  • Changing canonical channel.name on export.

Reference implementation

Mirror the #130 talk-group slice:

  • TalkGroup.abbreviationsrc/models/codeplug.ts
  • talkGroupAbbreviationSuggestionssrc/lib/talkGroupAbbreviationSuggestions.ts
  • Edit / list / detail UI — TalkGroupEdit.tsx, TalkGroupsList.tsx, TalkGroupDetail.tsx
  • Export wiring — src/lib/channelExpansion/index.ts, useExportSettings.ts, ExportNameSettingsFields.tsx

Manual verify

  1. Channel with long name and abbreviation set → export wire name uses abbreviation in the qualifier position; callsign unchanged.
  2. Toggle off “Use channel abbreviations” → full name used (subject to generic shortening).
  3. Multi-mode / multi-TG expansion → abbreviated qualifier consistent in zone members.
  4. Channels list column shows/hides abbreviation; edit suggestions populate from name.
  5. Re-import: canonical name unchanged; wire names may differ (same round-trip caveat as Exported channel names from m×n expansion overflow tight radio LCD limits #130).

Related

  • #130 — export name shortening (parent)
  • #122 — long-term per-profile display-name overrides
  • #143 — relaxed re-import matching

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimport-exportquality-of-lifefeature to improve the QOL of the person making a codeplug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions