Skip to content

Fix toolbar download bug: use correct file extension, MIME type, dynamic UI text, and address CodeQL security alert - #72

Merged
Dan Marshall (danmarshall) merged 18 commits into
mainfrom
copilot/fix-ddeaff9e-c035-4a98-b20b-7fd67d80db7f
Sep 10, 2025
Merged

Fix toolbar download bug: use correct file extension, MIME type, dynamic UI text, and address CodeQL security alert#72
Dan Marshall (danmarshall) merged 18 commits into
mainfrom
copilot/fix-ddeaff9e-c035-4a98-b20b-7fd67d80db7f

Conversation

Copilot AI commented Sep 5, 2025

Copy link
Copy Markdown
Contributor
  • Fix toolbar download bug - use correct extension and MIME type based on mode
  • Make download text dynamic based on mode (json/markdown)
  • Add displayMode variable to fix CodeQL alert for safe HTML construction
  • Undo unintended package-lock.json changes - revert version back to 1.0.0

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits September 5, 2025 16:51
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
…on mode

Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
@danmarshall

Copy link
Copy Markdown
Collaborator

Copilot can the text say: Source (just the json/markdown content)

Copilot AI changed the title [WIP] For the toolbar, there is a bug where it always downloads as a markdown .md file, even if the mode is json. Fix toolbar download bug: use correct file extension and MIME type based on mode Sep 5, 2025
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>

Copilot AI commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

Copilot can the text say: Source (just the json/markdown content)

Updated the download UI text as requested. Changed "Source content (just the content)" to "Source (just the json/markdown content)" and the button text from "Source content" to "Source". This makes it clearer what type of content is being downloaded. (e5b4c4f)

@danmarshall

Copy link
Copy Markdown
Collaborator

Copilot i meant the mode text should be dynamic, not literally show both "json/markdown"

Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>

Copilot AI commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

Copilot i meant the mode text should be dynamic, not literally show both "json/markdown"

Updated the download text to be dynamic based on the current mode. Now it shows "Source (just the json content)" when in JSON mode and "Source (just the markdown content)" when in Markdown mode, instead of literally showing "json/markdown". (d4a8f4b)

Comment thread packages/toolbar/src/toolbar.ts Fixed
Copilot AI changed the title Fix toolbar download bug: use correct file extension and MIME type based on mode Fix toolbar download bug: use correct file extension, MIME type, and dynamic UI text based on mode Sep 5, 2025
… from library input

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@danmarshall

Copy link
Copy Markdown
Collaborator

Copilot can you make a displayMode variable that uses mode to make a safe displayable of it to avoid to fix the codeQL alerts

Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>

Copilot AI commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

Copilot can you make a displayMode variable that uses mode to make a safe displayable of it to avoid to fix the codeQL alerts

Created a displayMode variable that safely maps the validated mode to display strings, which should fix the CodeQL alert. The variable ensures only pre-defined safe strings ('json' or 'markdown') are used in HTML construction instead of directly using user input. (90474ab)

Copilot AI changed the title Fix toolbar download bug: use correct file extension, MIME type, and dynamic UI text based on mode Fix toolbar download bug: use correct file extension, MIME type, dynamic UI text, and address CodeQL security alert Sep 5, 2025
@danmarshall

Copy link
Copy Markdown
Collaborator

Copilot undo the package-lock

Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>

Copilot AI commented Sep 10, 2025

Copy link
Copy Markdown
Contributor Author

Copilot undo the package-lock

Reverted the unintended package-lock.json changes. The version has been restored from "1.0.4" back to "1.0.0" as it was originally. (9c939db)

@danmarshall
Dan Marshall (danmarshall) merged commit 878572a into main Sep 10, 2025
5 checks passed
@danmarshall
Dan Marshall (danmarshall) deleted the copilot/fix-ddeaff9e-c035-4a98-b20b-7fd67d80db7f branch September 10, 2025 17:32
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.

3 participants