The "Municípios" column was dead text; it is now chips that navigate to the município, with a territory chip when a leadership covers a whole TI, and it is editable in place. What picks inline vs. Drawer is the `pointer:` media query, not viewport width: on a fine pointer the editor is always mounted (the "×" sits at the chip's corner, revealed on hover/focus) and on a coarse pointer a tap anywhere in the cell opens a Drawer with 44 px targets. `AdvisorMunicipalityCell` is promoted to `shared/MunicipalityPortfolioCell` and /campanha/assessores migrates onto it in the same change, so the second call site is born with the first. One batch action only; the single-id advisor twin is deleted with its int tests migrated. The anti-goal on always-mounted list inputs is amended for chip-based relations on fine pointers, not reopened. Also fixes a latent bug: `CampaignTableHead`'s `description` seam broke any RSC caller, because its two helpers lived in a 'use client' module.
16 lines
803 B
TypeScript
16 lines
803 B
TypeScript
/**
|
|
* Client-safe half of `CampaignHoverTooltip`. These must NOT live in that
|
|
* `'use client'` module: `CampaignTableHead` is a server component and renders
|
|
* the tooltip for a column `description`, and a `'use client'` module turns
|
|
* every export into a client reference that the server cannot call.
|
|
*/
|
|
|
|
/** Dotted-underline affordance for any label wrapped in a `CampaignHoverTooltip`. */
|
|
export const campaignHoverExplanationClassName =
|
|
'underline decoration-dotted decoration-muted-foreground/70 underline-offset-2'
|
|
|
|
/** Maps a left/center/right layout align to the tooltip `align` it should open toward. */
|
|
export const campaignHoverTooltipAlign = (
|
|
align: 'left' | 'center' | 'right',
|
|
): 'start' | 'center' | 'end' =>
|
|
align === 'right' ? 'end' : align === 'center' ? 'center' : 'start'
|