Skip to content

Add community right-click menu, collapsible tooltip sections, and usa… - #54

Open
sberhorst wants to merge 3 commits into
solocommand:masterfrom
sberhorst:feature/updates
Open

Add community right-click menu, collapsible tooltip sections, and usa…#54
sberhorst wants to merge 3 commits into
solocommand:masterfrom
sberhorst:feature/updates

Conversation

@sberhorst

Copy link
Copy Markdown

…ge hint

Reworks tooltip/config locale strings and adds community right-click support alongside existing guild right-click actions.

…ge hint

Reworks tooltip/config locale strings and adds community right-click support
alongside existing guild right-click actions.
@sberhorst

Copy link
Copy Markdown
Author

Summary of changes

New feature: Battle.net Community support

  • functions.lua — new addon:renderCommunities(frame) renders one collapsible section per subscribed Character-type club (in-game Community), excluding the player's guild. Shows Online/Away/Busy members, sorted alphabetically, with a gold header to distinguish from guild (green).
    • Class-colors names via GetPlayerInfoByGUID(guid) (no inspect/group requirement).
    • Falls back to the guild roster (addon._guildRosterByGUID, built in renderGuild) for level, since the Club API doesn't expose it directly.
    • New right-click menu: showCommunityRightClick(player) (whisper / invite / who).
  • config.lua — new "Communities" options group with a ShowCommunities toggle.
  • Socialite.luaShowCommunities added to the saved-variable defaults (defaults true); new events CLUB_MEMBER_UPDATED and CLUB_ADDED registered so presence changes and post-login club data trigger a refresh.
  • i18n/enUS.lua — new locale strings for the Communities section.

TWW (12.x) compatibility fixes

  • functions.lua — right-click menus rewritten with MenuUtil.CreateContextMenu (the old UIDropDownMenuTemplate path was removed in TWW and previously just printed "temporarily disabled, sorry!" instead of working).
  • Socialite.luaGUILD_MEMBER_ONLINE/GUILD_MEMBER_OFFLINE no longer exist in TWW; event handling now relies on GUILD_ROSTER_UPDATE (which Blizzard fires for all guild state changes) with a 0.5s debounce to coalesce bursts (e.g. several guildmates logging in at once).

Bug fixes

  • Socialite.lua / functions.lua — guard against calling guild APIs when not in a guild (renderGuild now bails early via IsInGuild(); data-text click handler no longer calls ToggleGuildFrame when ungrouped) — previously could throw nil errors for unguilded characters.
  • functions.luacollectGuildRosterInfo nil-coalesces GetNumGuildMembers() results in case the API returns nil mid-load.
  • i18n/enUS.lua — fixed a copy-paste typo: minimap tooltip string said "Show the Scoreboard minimap button" instead of "Socialite".

UX improvements

  • functions.lua / Socialite.lua — tooltip sections (Battle.net, Friends, Guild, each Community) are now click-to-collapse, with state persisted per-section in saved variables, and the tooltip re-renders in place rather than requiring a reopen.
  • Friend/guild "right-click" and "whisper" actions now consistently use Ambiguate(name, "none") for display, stripping realm suffixes while keeping the full name for API calls.

Cleanup

  • Removed dead code: unused tprint() debug serializer, legacy getRightClickFrame() dropdown-frame helper.
  • i18n/enUS.lua reorganized into labeled sections (Core / Tooltip headers / Config panel groups); removed several stale _DESCRIPTION keys that were either already commented out or unreferenced anywhere in the codebase (confirmed via grep — no breakage).
  • Reformatted all 4 files from tabs to the project's standard 2-space indentation (.editorconfig/stylua.toml).

Open question for reviewers

  • i18n/enUS.lua adds L["TOOLTIP_COMMUNITY"] = "Community" but it isn't referenced anywhere — community headers currently use the club's actual name (club.name) instead. Harmless, but flagging in case it was meant to be used as a fallback label.

@sberhorst

Copy link
Copy Markdown
Author

This PR is ready for review whenever you have a chance — all checks are passing (GitGuardian clean) and there are no merge conflicts with master. Let me know if you'd like any changes before merging. Thanks!

Steven added 2 commits June 30, 2026 14:41
…allback

- Pre-subscribe to each community's presence via
  C_Club.SetClubPresenceSubscription() on addon load so Blizzard pushes
  full member data before the user first opens the Communities panel.
  Resolves members rendering as "Unknown" on the first tooltip open
  after login.

- Wire up the previously-unused L.TOOLTIP_COMMUNITY locale string as
  the fallback club name in renderCommunities(), resolving the open
  reviewer question noted in the PR summary comment.
…OMMUNITY

- Pre-subscribe to each community's presence via
  C_Club.SetClubPresenceSubscription() on addon load so Blizzard pushes
  full member data before the first tooltip open after login. Resolves
  community members rendering as "Unknown" on the first hover.

- Detect guild rank promotions and demotions via locale-safe pattern
  matches against ERR_GUILD_PROMOTE_SSS / ERR_GUILD_DEMOTE_SSS system
  messages and force a fresh C_GuildInfo.GuildRoster() request, so rank
  changes reflect in the tooltip immediately without a UI reload.

- Wire the previously-unused L.TOOLTIP_COMMUNITY locale string as the
  fallback club name in renderCommunities(), resolving the open reviewer
  question noted in the PR summary comment.

@solocommand solocommand left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!

These changes all look fine, but I'm unable to verify the Communities feature. When I load your changes, I see the configuration for communities, but I don't see them displayed in the tooltip. Is this verified working for you?

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