amelioro / ameliorate

A tool for analyzing debatable problems effectively, collaboratively, and with an open mind.
https://ameliorate.app
MIT License
26 stars 10 forks source link

When entering a map title it should accept spaces and replace them with hyphens in the URL #536

Open prototyperspective opened 1 month ago

prototyperspective commented 1 month ago

Describe your issue

When creating a new topic most users will probably add a sentence with spaces. It will show an error and many will not understand what the problem is. Moreover, it shouldn't be a problem at all.

Solution you'd like

The title with spaces could be displayed somewhere at the map and the URL get automatically changed so it replaces spaces with hyphens -

Alternatives you've considered

No response

Additional context

Created a topic named like https://ameliorate.app/Prototyperspective/CarsAreHarmfulToSociety because I didn't think of using spaces because I didn't know this title was used for the URL. It would be better to have all topics with spaces like …/problems-of-cars

Technical ideas and questions

No response

keyserj commented 1 month ago

Yeah this seems good to do at some point. I think these are roughly the needed changes:

  1. allow the topic.title column to have spaces (currently is disallowed via zod validation)
  2. continue displaying the title wherever we currently are
  3. replace all spaces with hyphens wherever the title is used for a URL

Known places where title is used for URL:

  1. topic settings "view your topic at..."
  2. user page, topic column (display text should be same, anchor text should be replaced)
  3. topic details pane "[username]/[title]" (display text should be same, anchor text should be replaced)