Skip to content

Conversation

@mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Jan 28, 2026

This creates a bit of a rules engine for when there are multiple mime types that handles 1) sorting and 2) hiding duplicates

@vercel
Copy link

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 28, 2026 7:19pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a small rules engine for handling mime bundles, adding explicit precedence and visibility logic when multiple mime types are present, and wires it into the existing output rendering path.

Changes:

  • Add frontend/src/utils/mime-types.ts with utilities to declare mime-type precedence, hiding rules, and a processMimeBundle pipeline.
  • Add comprehensive unit tests in frontend/src/utils/__tests__/mime-types.test.ts covering hiding rules, precedence sorting, default config, and the main pipeline behavior.
  • Update MimeBundleOutputRenderer in frontend/src/components/editor/Output.tsx to use processMimeBundle, replacing the previous ad-hoc "HTML first" sort and ensuring the rendered data comes from the processed entries.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
frontend/src/utils/mime-types.ts Defines the mime-type precedence/hiding configuration, plus helper functions to apply hiding rules, sort entries, and process mime bundles end-to-end.
frontend/src/utils/tests/mime-types.test.ts Adds Vitest coverage for the new mime-type configuration and processing helpers, validating hiding, precedence, defaults, and data preservation.
frontend/src/components/editor/Output.tsx Integrates the new mime-bundle processing pipeline into MimeBundleOutputRenderer, using processed entries (with precedence and hiding applied) for both single-output and tabbed rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mscolnick mscolnick merged commit b9deb98 into main Jan 28, 2026
41 of 44 checks passed
@mscolnick mscolnick deleted the ms/mime-type-precendence branch January 28, 2026 21:20
@github-actions
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.7-dev34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants