Skip to content

feat: Support direct clan detail links#3928

Open
Aotumuri wants to merge 3 commits into
mainfrom
add-clan-link
Open

feat: Support direct clan detail links#3928
Aotumuri wants to merge 3 commits into
mainfrom
add-clan-link

Conversation

@Aotumuri
Copy link
Copy Markdown
Member

@Aotumuri Aotumuri commented May 15, 2026

Description:

Add support for opening clan details directly with clan=<tag>

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

aotumuri

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e23a9f9-3cf8-46d2-ba9e-0152921a64d8

📥 Commits

Reviewing files that changed from the base of the PR and between 9057f3d and e3738fe.

📒 Files selected for processing (1)
  • src/client/ModalRouter.ts

Walkthrough

Adds ModalRouter.syncArgs(name, args) to serialize selected modal arguments into the URL hash (dropping null/undefined/empty values and skipping the "modal" key) and updates writeHash to ignore empty-string args; ClanModal uses this to sync/clear clan detail args.

Changes

ModalRouter hash synchronization

Layer / File(s) Summary
syncArgs implementation and URL hash update
src/client/ModalRouter.ts
Adds ModalRouter.syncArgs(name: string, args: Record<string, unknown>) that filters/sanitizes primitive arg values, ignores the "modal" key, avoids updates when routing is URL-driven or name mismatches, and writes the new window.location.hash via history.replaceState. Also updates internal writeHash to treat empty string ("") as no value.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • openfrontio/OpenFrontIO#3924: Introduced modal URL routing earlier; this PR extends that work by syncing non-tab modal arguments into the hash.

Poem

The router trims the empty, keeps the rest,
Arguments tidy, no more unrest,
Clan modal whispers its chosen tag,
Hash updated softly, no noisy flag,
URL and modal walk aligned, abreast.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Support direct clan detail links' clearly and specifically describes the main change: enabling direct linking to clan detail views via a query parameter.
Description check ✅ Passed The description is directly related to the changeset, explaining the feature to open clan details with a clan= parameter and confirming standard checklist items were completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/client/ModalRouter.ts`:
- Around line 134-139: syncArgs and writeHash use different arg-filtering rules
causing inconsistent hashes; update writeHash to match syncArgs by treating
undefined, null, and empty string the same (delete the param) and
continue/skipping when typeof value === "object", then set params.set(key,
String(value)) for remaining values; locate the logic in writeHash (mirror the
checks from syncArgs) so both functions apply identical filtering for keys and
values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 638199be-4667-4a5c-8651-e6f584f0f49f

📥 Commits

Reviewing files that changed from the base of the PR and between df765ed and 9057f3d.

📒 Files selected for processing (2)
  • src/client/ClanModal.ts
  • src/client/ModalRouter.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/client/ClanModal.ts

Comment thread src/client/ModalRouter.ts
@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management May 15, 2026
@ryanbarlow97
Copy link
Copy Markdown
Contributor

https://add-clan-link.openfront.dev/#modal=clan&clan=UN

Doesn’t look that nice, can we change this to be

https://add-clan-link.openfront.dev/clan/UN or something?

@ryanbarlow97
Copy link
Copy Markdown
Contributor

https://add-clan-link.openfront.dev/#modal=clan&clan=UN

Doesn’t look that nice, can we change this to be

https://add-clan-link.openfront.dev/clan/UN or something?

I realise it was already like this, never mind

@ryanbarlow97 ryanbarlow97 added this to the v32 milestone May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Development

Development

Successfully merging this pull request may close these issues.

3 participants