Skip to content

Add a Comments tab placeholder to Browse's mod details - #24926

Merged
r1chm8 merged 4 commits into
masterfrom
laz-1708
Nov 16, 2026
Merged

r1chm8 merged 4 commits into
masterfrom
laz-1708

Conversation

@r1chm8

@r1chm8 r1chm8 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Browse's mod details get a Comments tab next to Details. Vortex doesn't show comments yet, so the tab says they're coming and links to the mod's comments on the website. Design: Figma.

What changes

  • Comments tab: ModCommentsComingSoon shows "Mod comments are coming to Vortex soon", with a View comments button that opens the mod's Posts tab (nexusModCommentsUrl, …/mods/<id>?tab=posts). It reuses NoResults, as Browse's mods "coming soon" screen does, inside a card.
  • Tracking:
    • browse_mods_details_tab_selected {mod_uid, tab, previous_tab} when the user switches tab, by click or the keys. Clicking the open tab sends nothing.
    • browse_mods_comments_opened {mod_uid} from View comments.
  • Secondary tabs: the selected and hover backgrounds use the translucent surface colours (surface-translucent-low and -mid), so they sit on the game art. This changes every secondary tab, not just Browse's.

Tests

  • ModDetails checks that View comments opens the comments page and is counted, and that each tab switch is counted once, with the tab it left.
  • Two existing ModDetails tests found the scroll area by tabindex="-1", which the unselected tab now has too. They use a test id instead.
  • pnpm run verify passes (it excludes E2E). Not tried in the app yet.

Part of LAZ-1708

@r1chm8
r1chm8 requested a review from a team as a code owner November 16, 2026 16:02
@r1chm8 r1chm8 self-assigned this Nov 16, 2026
… mod's comments on the website, and count switching tabs and opening the comments (part of LAZ-1708)
@@ -0,0 +1,8 @@
/** The tabs of a mod's details, by their panel ids. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: browseModsTracker.ts now imports this type from a component folder. docs/frontend.md says a type shared across files goes in util/, so this could live at util/mod_details_tab/modDetailsTab.ts, next to util/empty_state_kind, which the tracker already uses. That would also give isModDetailsTab a home for a small test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved to util/mod_details_tab/modDetailsTab.ts in 9f96c6b, with a test for isModDetailsTab.

tabListId="browse-mod-details-tabs"
tabType="secondary"
onSetSelectedTab={setTab}
onSetSelectedTab={(next) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: could this be a named selectTab above the return? The component is already long, and a name makes the guard easier to read.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We keep handlers that are only used once inline, so the guard stays where the tab is wired up. Happy to name it if a second caller appears.

}

setTab(next);
tracker.trackDetailsTabSelected({ mod_uid: mod.id, tab: next, previous_tab: tab });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: the doc comment on ModDetails (line 57) still says it counts opening the mod page and the gallery's picks and paging. It now also counts tab changes and opening comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in 9f96c6b: it now mentions the Comments tab, and counting tab switches and opening comments.

"https://www.nexusmods.com/skyrimspecialedition/mods/1?tab=posts",
);
expect(propertiesOf("browse_mods_comments_opened")).toEqual([{ mod_uid: "1704-1" }]);
vi.unstubAllGlobals();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: if the expect above fails, vi.unstubAllGlobals() never runs and the stubbed api leaks into later tests. An afterEach(() => vi.unstubAllGlobals()) would cover it. (Sibling tests do the same thing, so this is optional.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added the afterEach in 9f96c6b and dropped the two trailing unstubAllGlobals calls it covers.

vi.stubGlobal("api", { ...window.api, shell: { openUrl } });
renderComponent();

await userEvent.click(screen.getByRole("tab", { name: "Comments" }));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: docs/testing.md says to use a data-testid when several elements share a role, because t hands back the key in tests. The two tabs share role="tab", so the name is matching text. The existing Details lookups do the same, so this is optional.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 9f96c6b: the tabs have mod-details-tab-details and mod-details-tab-comments test ids, and View comments has mod-comments-website. The older Details lookups use them too.

ecemooo
ecemooo previously approved these changes Nov 16, 2026
…in ModDetails' doc what it counts now, unstub globals after each test, and find the tabs and View comments by test id (part of LAZ-1708)
ecemooo
ecemooo previously approved these changes Nov 16, 2026
…, as the updated design does (part of LAZ-1708)
@r1chm8
r1chm8 enabled auto-merge November 16, 2026 16:45
@r1chm8
r1chm8 merged commit 9bd489e into master Nov 16, 2026
11 checks passed
@r1chm8
r1chm8 deleted the laz-1708 branch November 16, 2026 17:07
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