improvement: include mime-type precedence and visibilty rules#8037
Merged
improvement: include mime-type precedence and visibilty rules#8037
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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.tswith utilities to declare mime-type precedence, hiding rules, and aprocessMimeBundlepipeline. - Add comprehensive unit tests in
frontend/src/utils/__tests__/mime-types.test.tscovering hiding rules, precedence sorting, default config, and the main pipeline behavior. - Update
MimeBundleOutputRendererinfrontend/src/components/editor/Output.tsxto useprocessMimeBundle, 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.
manzt
approved these changes
Jan 28, 2026
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.7-dev34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This creates a bit of a rules engine for when there are multiple mime types that handles 1) sorting and 2) hiding duplicates