respira/src/utils/displayFilename.ts
Jan-Henrik Bruhn 095c879ea3 fix: Address Copilot review feedback
- Simplify StepCircle cursor logic to use isComplete || isCurrent
- Fix UploadButton to use boundsFits prop instead of !!boundsError
- Remove XSS vulnerability by parsing markdown safely without dangerouslySetInnerHTML
- Move ColorBlock type to shared types.ts file to reduce coupling
- Rename useDisplayFilename to getDisplayFilename and move to utils (not a hook)
- Improve threadMetadata JSDoc with detailed examples
- Make WorkflowStep interface properties readonly for full immutability
- Fix PyodideProgress redundant negation logic

All issues from Copilot review resolved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 16:41:58 +01:00

22 lines
501 B
TypeScript

/**
* getDisplayFilename Utility
*
* Determines which filename to display based on priority:
* 1. currentFileName (from pattern store)
* 2. localFileName (from file input)
* 3. resumeFileName (from cache)
* 4. Empty string
*/
export function getDisplayFilename(options: {
currentFileName: string | null;
localFileName: string;
resumeFileName: string | null;
}): string {
return (
options.currentFileName ||
options.localFileName ||
options.resumeFileName ||
""
);
}