feat(content-sidebar): add data-target-id to integrations tabs - #4775
feat(content-sidebar): add data-target-id to integrations tabs#4775EdDaWord wants to merge 2 commits into
Conversation
The integrations rail in the sidebar nav had no data-target-id, so Pendo fell back to CSS selectors (hashed classnames, nth-child chains) that break silently on refactors and build-hash changes. Tag the shared AdditionalTab button, distinguishing the overflow "more" tab from a real integration tab via the existing id < 0 condition, and the rail container in SidebarNav. Names follow the SidebarNavButton-* convention already used for the primary tabs. UXF-1331 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Edward Wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
A single shared id for every tab in the integrations rail made the
attribute useless: Slack, Adobe Sign, Outlook and Gmail were
indistinguishable in analytics.
Derive the id from the integration's backend serviceName, so each app
gets a stable, readable target ("Adobe Sign" -> AdditionalTab-adobeSign).
serviceName is already supplied per tab by consumers. Add an optional
targetId to override the derived value, and keep the shared fallback for
tabs with no serviceName. targetId is excluded from callbackData so it
does not reach consumer click handlers; serviceName stays, since
consumers read it from there.
UXF-1331
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Problem
The integrations rail in the
ContentSidebarnav — the app icons below the primary tabs, plus the overflow "more" tab — has nodata-target-id. Analytics tooling therefore falls back to CSS selectors (hashed module classnames,nth-childchains) that break silently on any refactor or build-hash change.Tagging the rail is only useful if each app is distinguishable: a single shared id across Slack, Adobe Sign, Adobe Acrobat, Outlook and Gmail would make the attribute unusable for measuring which integrations users actually open.
Change
Every icon in the rail is one instance of the shared
AdditionalTabbutton, so the id is derived per tab rather than hardcoded:serviceName→ slug.AdditionalTabderives the id from the integration's backendserviceNamevialodash/camelCase, which consumers already supply per tab:serviceNamedata-target-idSlackAdditionalTab-slackAdobe SignAdditionalTab-adobeSignAdobe AcrobatAdditionalTab-adobeAcrobatMicrosoft OutlookAdditionalTab-microsoftOutlookGmailAdditionalTab-gmailserviceNameis a backend identifier, not a localized display name, so the id is stable across locales.Optional
targetIdoverride. A consumer can settargetIdon the tab data to pin an exact value, taking precedence over the derived one. It is excluded fromcallbackDataso it does not reach consumer click handlers;serviceNameis deliberately left in place, since consumers read it from there.Overflow and fallback. The overflow tab (
id < 0) getsAdditionalTab-moreButton— it has no service of its own. A tab with noserviceNamefalls back to the sharedAdditionalTab-integrationButtonrather than an empty or malformed id.Rail container.
SidebarNav.jsgetsSidebarNav-additionalTabsOverflow, matching the existingdata-testid="additional-tabs-overflow".serviceNameandtargetIdare added to theAdditionalSidebarTabflow type. Names follow theSidebarNavButton-*convention already used for the primary tabs, and sit alongside the existingdata-resin-targetattributes rather than replacing them.Verification
yarn flow check src/elements/content-sidebar— 0 errorsyarn test src/elements/content-sidebar/additional-tabs— 22 passed, 8 snapshots passedyarn test src/elements/content-sidebar/__tests__/SidebarNav— 82 passedeslinton all touched files — cleanNew test coverage: slug derivation across several
serviceNameshapes (includingzoom.us→zoomUs), the overflow id, the missing-serviceNamefallback,targetIdprecedence, and an assertion thattargetIddoes not leak intocallbackDatawhileserviceNamestill does.Not verified in a running app. No visual or behavioral change is expected — only DOM attributes were added.
Internal ref: UXF-1331