Skip to content

Commit 679c217

Browse files
committed
web/communities: remove explanatory comments from sub-community dropdown
1 parent 43117da commit 679c217

4 files changed

Lines changed: 0 additions & 10 deletions

File tree

app/web/features/communities/CommunityPage/CommunityPageSubHeader.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const StyledBreadcrumbs = styled(Breadcrumbs)(({ theme }) => ({
3636
"& .MuiTypography-root, & .MuiLink-root, & .MuiButton-root": {
3737
fontSize: "inherit",
3838
},
39-
// Wrap a whole crumb to the next line instead of truncating a name.
4039
"& li": {
4140
flexShrink: 0,
4241
whiteSpace: "nowrap",
@@ -56,8 +55,6 @@ export default function CommunityPageSubHeader({
5655

5756
const router = useRouter();
5857

59-
// Read the children query here (not in the dropdown) so the whole breadcrumb element can be
60-
// omitted on leaves — MUI Breadcrumbs renders a dangling separator for a child that returns null.
6158
const {
6259
data: subCommunitiesData,
6360
hasNextPage,

app/web/features/communities/CommunityPage/SubCommunitiesDropdown.test.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ jest.mock("next/router", () => ({
1616
}),
1717
}));
1818

19-
// jest.mock("next/router") above replaces the whole module, which drops the `Router.events`
20-
// emitter @sentry/nextjs reads at import time - stub Sentry out the same way CommunitySearch's
21-
// test does so the import doesn't crash.
2219
jest.mock("platform/sentry", () => {
2320
const mockCaptureException = jest.fn();
2421
return {
@@ -123,7 +120,6 @@ describe("SubCommunitiesDropdown", () => {
123120
const searchInput = screen.getByPlaceholderText(
124121
t("communities:sub_community_search_placeholder"),
125122
);
126-
// stopPropagation on the search input must NOT swallow Escape, or the menu can't close.
127123
searchInput.focus();
128124
await user.keyboard("{Escape}");
129125

app/web/features/communities/CommunityPage/SubCommunitiesDropdown.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export default function SubCommunitiesDropdown({
6060
handleClose();
6161
};
6262

63-
// MUI Menu hijacks typeahead/arrow keys meant for the search input; Escape must still bubble to close.
6463
const handleSearchKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
6564
if (event.key !== "Escape") {
6665
event.stopPropagation();
@@ -93,7 +92,6 @@ export default function SubCommunitiesDropdown({
9392
disableAutoFocusItem
9493
anchorOrigin={{ vertical: "bottom", horizontal: "left" }}
9594
transformOrigin={{ vertical: "top", horizontal: "left" }}
96-
// fixed width so the Paper doesn't reflow as results filter
9795
slotProps={{
9896
paper: { sx: { width: 300, maxWidth: "90vw", maxHeight: 288 } },
9997
}}

app/web/features/communities/discussions/DiscussionPage.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ describe("Discussion page", () => {
124124
beforeEach(() => {
125125
getLiteUserMock.mockImplementation(getLiteUser);
126126
getCommunityMock.mockResolvedValue(community);
127-
// CommunityPageSubHeader lists sub-communities for its breadcrumb drill-down dropdown.
128127
listCommunitiesMock.mockResolvedValue({
129128
communitiesList: [],
130129
nextPageToken: "",

0 commit comments

Comments
 (0)