Skip to content

BB-876: feat: Add script option for aliases and name section#1278

Open
atharvsp02 wants to merge 1 commit intometabrainz:masterfrom
atharvsp02:BB-876
Open

BB-876: feat: Add script option for aliases and name section#1278
atharvsp02 wants to merge 1 commit intometabrainz:masterfrom
atharvsp02:BB-876

Conversation

@atharvsp02
Copy link
Copy Markdown
Contributor

@atharvsp02 atharvsp02 commented Mar 31, 2026

Problem

Currently there is no script option for aliases and entity names. Languages like Serbian use multiple scripts like Latin and Cyrillic and right now there is no way to tell which script a title is written in.

Solution

Added a Script dropdown to the alias editor and the main name section, following the same pattern as the existing Language field.

Database:

  • Added musicbrainz.script table to the schema
  • Migration adds script_id column to bookbrainz.alias

Server:

  • Added loadScripts middleware (same as loadLanguages)
  • Updated all entity routes to load scripts
  • Updated constructAliases to include `scriptId

Frontend:

  • New ScriptField component with grouped options (Frequently Used and Other) and recently used
  • Added Script dropdown to alias editor
  • Added Script dropdown to name section
  • Redux actions and reducers for both alias editor and name section

This PR relies on the Script model and alias relationship from metabrainz/bookbrainz-data-js #338.

  • I have run the code and manually tested the changes

Areas of impact

  • musicbrainz.sql, up.sql, down.sql - Database schema and migration
  • middleware.ts, entityRouteUtils.tsx - Server data loading and prop passing
  • author.ts, edition.ts, edition-group.ts, publisher.ts, series.ts, work.ts, merge.ts,unifiedform.ts - Routing middleware updates
  • entity.tsx - Server data parsing
  • script-field.tsx - New UI component
  • alias-editor.js, alias-modal-body.tsx, alias-row.js - Alias UI updates
  • actions.ts, reducer.js - State management for alias and name section
  • name-section.js - Name section UI updates

Screenshots

Script dropdown in Name Section

Screenshot from 2026-04-02 18-18-14

Script dropdown in Alias Editor

Screenshot from 2026-04-02 18-19-07

AI usage

  • I did not use any AI
  • I have used AI in this PR (add more details below)

If you did use AI:

  • I used AI tools for communication
  • I used AI tools for coding
  • I understand all the changes made in this PR

Action

  1. Run migration sql/migrations/2026-03-30/up.sql
  2. Merge bookbrainz-data-js PR #338

@atharvsp02 atharvsp02 marked this pull request as draft March 31, 2026 16:35
@atharvsp02 atharvsp02 marked this pull request as ready for review April 2, 2026 19:37
@atharvsp02
Copy link
Copy Markdown
Contributor Author

Hey @monkey !
Let me know if you have any suggestions or changes.
The CI is failing because bookbrainz-data does not have the Script model yet. It will pass once the bookbrainz-data-js #338 is merged

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.

1 participant