Skip to content

Conversation

@lsabor
Copy link
Contributor

@lsabor lsabor commented Nov 22, 2025

closes #3824

adds Post- and Project- level bulletins

verified functionality manually

@lsabor lsabor requested a review from hlbmtc November 22, 2025 16:48
@lsabor lsabor requested review from elisescu, hlbmtc and ncarazon and removed request for elisescu and hlbmtc November 22, 2025 16:48
Comment on lines +39 to +47
const questionMatch = pathname.match(/^\/questions\/(\d+)(?:\/|$)/);
if (questionMatch) {
return { post_id: Number(questionMatch[1]) };
}

const projectMatch = pathname.match(/^\/tournament\/([^/]+)(?:\/|$)/);
if (projectMatch) {
return { project_slug: projectMatch[1] };
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is there a cleaner way to do this? @ncarazon
I need the post_id or project_slug
This just reads from the URL and uses regex. Maybe we have a helper or a better way to grab the relevant post or project?

Copy link
Contributor

Choose a reason for hiding this comment

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

I’m not totally sure we already have a helper for this
Given that, I’d keep the regex logic but extract it into a small helper under utils/navigation.ts (e.g. getBulletinParamsFromPathname(pathname)), and then just call that from here.

Copy link
Contributor

@hlbmtc hlbmtc left a comment

Choose a reason for hiding this comment

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

LGTM, but agree with Nikita's comment

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.

Post- and Project- level bulletins

4 participants