fix: standardize export filenames and remove hardcoded names#124
fix: standardize export filenames and remove hardcoded names#124NotYuSheng merged 1 commit intomainfrom
Conversation
- Standardize PDF and markdown exports to use consistent "_summary" suffix
- Replace hardcoded "meetmemo-summary.pdf" with professional filename generation
- Ensure all exports follow pattern: {meeting-name}_{type}_{date}.{ext}
- Fix PDF tab name by adding proper title and author metadata
- JSON exports use "_transcript" suffix for clarity
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Summary of Changes
Hello @NotYuSheng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances the user experience by standardizing and professionalizing the naming conventions for all exported files (PDF, Markdown, and JSON). It introduces a consistent, dynamic filename generation system and improves the metadata embedded within PDF documents, making exported content easier to identify and manage.
Highlights
- Standardized Export Filenames: PDF and Markdown exports now consistently use a "_summary" suffix, and JSON exports use a "_transcript" suffix, ensuring clarity across file types.
- Dynamic Filename Generation: Replaced hardcoded filenames (e.g., "meetmemo-summary.pdf") with a new system that generates professional filenames following the pattern: {meeting-name}{type}{date}.{ext}.
- Enhanced PDF Metadata: PDF exports now include proper title and author metadata, improving document professionalism and discoverability.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request is a great step towards standardizing export filenames and removing hardcoded values. The introduction of a dedicated function for this is a good practice. My review highlights a few areas for improvement, primarily focusing on the duplication of filename generation logic between the frontend and backend, which can pose a maintenance challenge. I've also pointed out a minor inconsistency in the cleaning logic between the two implementations and suggested some refactoring opportunities to enhance code clarity and conciseness. Addressing these points will make the solution more robust and easier to maintain.
There was a problem hiding this comment.
This generateProfessionalFilename function duplicates the logic from the Python backend. This creates a maintainability issue, as any future changes to the filename generation logic will need to be implemented in two places. It's best practice to have a single source of truth. The backend should be responsible for generating filenames and providing them in the Content-Disposition header for all downloads. For client-side generated files like the JSON export, consider if a small API endpoint to generate just the filename would be better than duplicating the logic.
| @@ -1099,9 +1124,9 @@ const MeetingTranscriptionApp = () => { | |||
| const link = document.createElement('a'); | |||
| link.href = url; | |||
There was a problem hiding this comment.
The filename cleaning logic here is inconsistent with the backend implementation. The Python version includes a step to remove leading or trailing hyphens (clean_title.strip('-')), which is missing here. This can lead to different filenames for the same input (e.g., a title with leading/trailing spaces). To ensure consistency, you should add a step to trim these hyphens.
| const cleanTitle = (meetingTitle || "Meeting") | |
| .replace(/\.(wav|mp3|mp4|m4a|flac|webm)$/i, '') // Remove audio extensions | |
| .replace(/[<>:"/\\|?*]/g, '') // Remove invalid filename characters | |
| .replace(/\s+/g, '-') // Replace spaces with hyphens | |
| .substring(0, 50) // Limit length | |
| .toLowerCase(); | |
| const cleanTitle = (meetingTitle || "Meeting") | |
| .replace(/\.(wav|mp3|mp4|m4a|flac|webm)$/i, '') // Remove audio extensions | |
| .replace(/[<>:"/\\|?*]/g, '') // Remove invalid filename characters | |
| .replace(/\s+/g, '-') // Replace spaces with hyphens | |
| .replace(/^-+|-+$/g, '') // Remove leading/trailing hyphens | |
| .substring(0, 50) // Limit length | |
| .toLowerCase(); |
| base_name = f"{clean_title}_summary" | ||
| elif file_type == 'markdown': |
| rightMargin=inch, | ||
| leftMargin=inch, | ||
| topMargin=inch, | ||
| bottomMargin=inch*1.2 # Extra space for footer | ||
| bottomMargin=inch*1.2, # Extra space for footer | ||
| title=summary_data.get('meetingTitle', 'MeetMemo Meeting Report'), | ||
| author='MeetMemo AI' | ||
| ) |
There was a problem hiding this comment.
The logic for 'pdf' and 'markdown' file types is identical. You can combine these conditions to make the code more concise and avoid repetition.
if file_type in ('pdf', 'markdown'):
base_name = f"{clean_title}_summary"
elif file_type == 'json':
base_name = f"{clean_title}_transcript"
else:
base_name = f"{clean_title}_export"There was a problem hiding this comment.
The logic for appending the date string is repeated in every case of the switch statement. This can be simplified by determining the suffix and extension first, and then constructing the final filename string once to avoid repetition (Don't Repeat Yourself principle).
const datePart = dateStr ? `_${dateStr}` : '';
let suffix;
let extension;
switch (type) {
case 'json':
suffix = '_transcript';
extension = '.json';
break;
case 'markdown':
case 'md':
suffix = '_summary';
extension = '.md';
break;
case 'pdf':
suffix = '_summary';
extension = '.pdf';
break;
default:
suffix = '_export';
extension = `.${type}`;
break;
}
return `${cleanTitle}${suffix}${datePart}${extension}`;
🤖 Generated with Claude Code