feat(sim-links): create or copy a Sim link from search results and file shares

Merged
WA
6d ago
+361-87

Summary

  • Every returned link's actions menu (Search results, sources under Assistant answers, the Sources panel, search history) gets a Sim link entry when the organization has Sim links on: Copy sim/ when a link already opens that exact address, so we never invite a duplicate, otherwise Create Sim link, which opens the existing form with the address filled in and a name suggested from the title
  • The file share dialog gets the same choice as a footer chip next to Copy link, for a shared file's public address
  • GET /api/organizations/[id]/sim-links takes an exact url filter through the existing list operation, so the lookup keeps the same authorization and unlisted visibility as browsing
  • Shortcuts are scoped to the organization sim/<name> resolves for the session (resolveSimLinkOrganization, the resolver the redirect and extension suggestions use), resolved server-side in the organization and workspace layouts and provided by SimLinkOrganizationProvider; null hides them, so guests and orgs with Sim links off see nothing, and a failed lookup offers nothing rather than risk a duplicate
  • suggestSimLinkName turns a title into a valid lower-case name; simLinkUrl builds the copyable address (the Links page now uses it too)

Type of Change

  • New feature

Testing

  • scripts/test-sim-links-e2e.ts: new check that a destination lookup returns only links opening exactly that address, hides another member's unlisted link, and returns nothing for an unknown address
  • lib/sim-links/validation.test.ts: title to name (case, punctuation, hyphen collapse), cut to the length limit without a trailing hyphen, empty when nothing usable; reverting the lower-casing or the trailing-hyphen trim turns a case red
  • Targeted suites green (77 tests: sim-links, links page, share modal, message sources, search results)
  • Lookup only runs when a menu opens or the share dialog shows an active share, so long result lists make no extra requests
  • /cleanup and /simplify passes applied

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)