Skip to content

Conversation

@meganrm
Copy link
Contributor

@meganrm meganrm commented Oct 22, 2025

Problem

closes #119

Solution

used a tree structure to show nested items

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Steps to Verify:

  1. bun dev
  2. pick a recipe
  3. click on Full recipe

Screenshots (optional):

Screenshot 2025-10-21 at 7 00 47 PM

@github-actions
Copy link

github-actions bot commented Oct 22, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 22.06% 364 / 1650
🔵 Statements 22.06% 364 / 1650
🔵 Functions 40.35% 23 / 57
🔵 Branches 71.42% 80 / 112
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/components/JSONViewer/formattingUtils.tsx 0% 0% 0% 0% 1, 3-5, 7-16, 18-20, 22-28, 30, 32-36, 38, 41-52, 54-62, 64-68
src/components/JSONViewer/index.tsx 0% 0% 0% 0% 1-2, 8-9, 18-19, 21-23, 25, 28, 30, 32-44, 47-57, 59-63, 67-70, 72-95, 97, 99
Generated in workflow #99

Copy link

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 new tree-based visualization for displaying recipe data by replacing the previous JSON viewer with a structured hierarchical display using Ant Design components.

Key Changes:

  • Replaced the collapsible JSON text viewer with a combination of Descriptions and Tree components from Ant Design
  • Added utility functions for formatting arrays, converting underscores to spaces, and handling null values
  • Removed the editable text area functionality in favor of read-only structured display

Reviewed Changes

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

File Description
src/components/JSONViewer/index.tsx Replaced Collapse/Input components with Descriptions and Tree components to display recipe data hierarchically
src/components/JSONViewer/style.css Updated styles to support the new tree-based layout with descriptions and tree titles
src/components/JSONViewer/formattingUtils.tsx Added new utility functions for formatting arrays, converting underscores, and rendering key-value pairs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Oct 22, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-10-27 23:00 UTC

Comment on lines 47 to 57
Object.entries(contentAsObj).forEach(([key, value]) => {
if (typeof value === "string") {
descriptions.push({
label: convertUnderscoreToSpace(key),
children: <>{value}</>,
});
} else if (Array.isArray(value)) {
descriptions.push({
label: convertUnderscoreToSpace(key),
children: <>{formatArray(value)}</>,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the clean format! just one note: Endosome is missing the display for "randomness_seed": 742470, We should also add handling for value === "number" in the top level descriptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added check for number but I don't see the randomness seed still (I logged all the key value pairs)

Copy link
Contributor

Choose a reason for hiding this comment

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

ah sorry, just checked firebase and looks like it’s actually a bug in the upload script. Frontend should be fine now. We’ll be able to display all data once this backend upload bug is fixed.

Copy link
Contributor

@ascibisz ascibisz left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@meganrm meganrm merged commit 197849e into main Oct 27, 2025
2 checks passed
@meganrm meganrm deleted the feature/recipe-items branch October 27, 2025 22:59
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.

Display the json content in a more readable way

4 participants