Description
Multiple styles with identical names from Figma silently overwrite each other during code generation. Only the last style is kept, with no warning to the user.
Steps To Reproduce
- Create a Figma file with multiple styles having the same name (e.g., "Headline/Headline 2") but different node IDs
- Run
figmage forge -f <fileId> -t <token>
- Check generated typography file
- Notice only one "Headline 2" style is present despite Figma having multiple
Expected Behavior
- Warn user about duplicate style names detected from Figma API
- Either generate unique names for all duplicates (e.g.,
headline2, headline2_1, headline2_2)
- Or allow user to configure which duplicates to keep/exclude
Screenshots
N/A - can provide API response showing duplicate styles if needed
Additional Context
- Occurs in
base_file_generator.dart:75-99 when grouping tokens by collectionId
- Figma API returns multiple nodes with same
name but different id values
- Currently uses
collectionName from first token, causing Map key collisions for duplicates
- Affects both
/v1/files/{fileId}/styles and /v1/files/{fileId} endpoints
EOF
cat /tmp/duplicate_styles_issue.md
Description
Multiple styles with identical names from Figma silently overwrite each other during code generation. Only the last style is kept, with no warning to the user.
Steps To Reproduce
- Create a Figma file with multiple styles having the same name (e.g., "Headline/Headline 2") but different node IDs
- Run
figmage forge -f <fileId> -t <token>
- Check generated typography file
- Notice only one "Headline 2" style is present despite Figma having multiple
Expected Behavior
- Warn user about duplicate style names detected from Figma API
- Either generate unique names for all duplicates (e.g.,
headline2, headline2_1, headline2_2)
- Or allow user to configure which duplicates to keep/exclude
Screenshots
N/A - can provide API response showing duplicate styles if needed
Additional Context
- Occurs in
base_file_generator.dart:75-99 when grouping tokens by collectionId
- Figma API returns multiple nodes with same
name but different id values
- Currently uses
collectionName from first token, causing Map key collisions for duplicates
- Affects both
/v1/files/{fileId}/styles and /v1/files/{fileId} endpoints
Description
Multiple styles with identical names from Figma silently overwrite each other during code generation. Only the last style is kept, with no warning to the user.
Steps To Reproduce
figmage forge -f <fileId> -t <token>Expected Behavior
headline2,headline2_1,headline2_2)Screenshots
N/A - can provide API response showing duplicate styles if needed
Additional Context
base_file_generator.dart:75-99when grouping tokens bycollectionIdnamebut differentidvaluescollectionNamefrom first token, causing Map key collisions for duplicates/v1/files/{fileId}/stylesand/v1/files/{fileId}endpointsEOF
cat /tmp/duplicate_styles_issue.md
Description
Multiple styles with identical names from Figma silently overwrite each other during code generation. Only the last style is kept, with no warning to the user.
Steps To Reproduce
figmage forge -f <fileId> -t <token>Expected Behavior
headline2,headline2_1,headline2_2)Screenshots
N/A - can provide API response showing duplicate styles if needed
Additional Context
base_file_generator.dart:75-99when grouping tokens bycollectionIdnamebut differentidvaluescollectionNamefrom first token, causing Map key collisions for duplicates/v1/files/{fileId}/stylesand/v1/files/{fileId}endpoints