Conversation
Greptile SummaryThis PR adds structured rendering for base64-encoded images inside the JSON tree view, allowing API responses (e.g. from image-generation or vision APIs) to be displayed inline with size metadata and a raw/image toggle.
Confidence Score: 5/5The new image-rendering path is well-guarded: SVG is excluded from both the data URL and sibling media_type branches, bare base64 detection requires a cooperative field name plus an explicit image MIME type from a sibling key, and the raw/image toggle is always reachable regardless of collapsed state. The changes are self-contained within a single display component. Detection logic is defensively written — it prefers false negatives over false positives, and the previously identified SVG XSS and toggle-accessibility concerns have been addressed in this PR. No correctness or security regressions were found in the new code paths. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[JsonValue receives name/data/parentData] --> B{dataType === 'string'?}
B -- No --> Z[Render number/boolean/null]
B -- Yes --> C[detectImageSource]
C --> D{data URL pattern match?}
D -- Yes, non-SVG --> E[Return cleaned data URL]
D -- Yes, SVG --> F[Return null]
D -- No --> G{sibling media_type or b64_json name?}
G -- No --> F
G -- Yes --> H{imageMimePattern + isLikelyImageFieldName + valid base64?}
H -- Yes --> I[Return data:mime;base64,...]
H -- No --> F
E --> J{imageSource truthy and showRawString false?}
I --> J
F --> K[tryParseJson]
K --> L{parsedJson truthy and showRawString false?}
J -- Yes --> M[Render inline image + size + raw button]
J -- No --> L
L -- Yes --> N[Render embedded JsonNode + raw button]
L -- No --> O[Render raw string with optional image/parse toggle]
Reviews (2): Last reviewed commit: "feat: render structured request log cont..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.