|
| 1 | +## JsonViewer Component – Feature TODO Roadmap |
| 2 | + |
| 3 | +Below is a **prioritized roadmap** you can turn directly into **GitHub issues**. |
| 4 | +For each feature there is: an **Issue title**, a **short description**, and a **task checklist**. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Milestone: Core UX & Editing (MVP+) |
| 9 | + |
| 10 | +### 1. Inline JSON value editing (basic edit mode) |
| 11 | + |
| 12 | +- **Issue Title**: `Add inline JSON value editing (basic edit mode)` |
| 13 | +- **Description**: |
| 14 | + Enable users to edit primitive JSON values (string, number, boolean, null) directly from the viewer UI. The change should be reflected in the underlying JSON model and exposed via a component callback/event so consumers can react to updates (e.g., save to server). |
| 15 | +- **Tasks**: |
| 16 | + - [ ] Add edit controls for primitive values (e.g. click to edit, or small edit icon). |
| 17 | + - [ ] Validate edited values according to their JSON type. |
| 18 | + - [ ] Update internal JSON model when a value changes. |
| 19 | + - [ ] Expose an `OnJsonChanged` (or similar) callback with the updated JSON. |
| 20 | + - [ ] Add basic docs and a minimal demo in the sample app. |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +### 2. Live JSON validation feedback |
| 25 | + |
| 26 | +- **Issue Title**: `Provide live JSON validation and error feedback` |
| 27 | +- **Description**: |
| 28 | + Add live JSON validation so that invalid JSON input (e.g., from a bound string or edit mode) shows clear error messages. When the JSON is invalid, the viewer should fail gracefully and show the error instead of crashing or silently failing. |
| 29 | +- **Tasks**: |
| 30 | + - [ ] Add JSON parsing/validation with clear error messages. |
| 31 | + - [ ] Display validation errors in the UI (error panel or inline banner). |
| 32 | + - [ ] Ensure invalid JSON does not break the component rendering. |
| 33 | + - [ ] Optionally surface error details via a callback/event. |
| 34 | + - [ ] Document how validation works and how consumers can handle errors. |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +### 3. Node selection and events API |
| 39 | + |
| 40 | +- **Issue Title**: `Add node selection support and selection events` |
| 41 | +- **Description**: |
| 42 | + Allow users to select a node (object, array, property, value) in the JSON tree and expose selection information to the parent application. This enables features like context menus, external inspectors, or property editors. |
| 43 | +- **Tasks**: |
| 44 | + - [ ] Add visual selection state for a node (e.g., highlight selected row). |
| 45 | + - [ ] Expose an `OnNodeSelected` (or similar) event with JSON path and value. |
| 46 | + - [ ] Ensure keyboard/mouse selection behavior is consistent. |
| 47 | + - [ ] Add an example that logs the selected node information. |
| 48 | + - [ ] Document the selection API. |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## Milestone: Advanced Navigation & Query |
| 53 | + |
| 54 | +### 4. JSONPath query input and results highlighting |
| 55 | + |
| 56 | +- **Issue Title**: `Add JSONPath query input with result highlighting` |
| 57 | +- **Description**: |
| 58 | + Provide an input where users can type a JSONPath expression and see all matching nodes highlighted in the viewer. Optionally show the list of matches (paths/values) in a side panel. |
| 59 | +- **Tasks**: |
| 60 | + - [ ] Add a JSONPath input UI to the component (configurable to show/hide). |
| 61 | + - [ ] Evaluate JSONPath expressions against the current JSON. |
| 62 | + - [ ] Highlight all matched nodes in the tree view. |
| 63 | + - [ ] Optionally show a list of matched paths/values. |
| 64 | + - [ ] Handle invalid JSONPath with a friendly error message. |
| 65 | + - [ ] Document JSONPath usage and limitations. |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +### 5. Enhanced search and navigation between matches |
| 70 | + |
| 71 | +- **Issue Title**: `Enhance search with next/previous navigation and filters` |
| 72 | +- **Description**: |
| 73 | + Improve the existing search feature by allowing users to jump between matches (next/previous) and optionally filter by key, value, or data type. |
| 74 | +- **Tasks**: |
| 75 | + - [ ] Add "Next" / "Previous" navigation for search results. |
| 76 | + - [ ] Optionally add filters: search in keys, values, or both. |
| 77 | + - [ ] Optionally add filter by data type (string, number, bool, etc.). |
| 78 | + - [ ] Make the current match clearly highlighted. |
| 79 | + - [ ] Ensure performance is acceptable for medium/large JSON. |
| 80 | + - [ ] Update docs and demos to show the new search UX. |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Milestone: Visualization & Insights |
| 85 | + |
| 86 | +### 6. JSON statistics panel (advanced insights) |
| 87 | + |
| 88 | +- **Issue Title**: `Add advanced JSON statistics and insights panel` |
| 89 | +- **Description**: |
| 90 | + Provide an optional statistics panel that gives insights into the JSON structure (counts, depth, type distribution, approximate size, etc.). This can build upon or extend any existing statistics feature. |
| 91 | +- **Tasks**: |
| 92 | + - [ ] Compute basic metrics: total nodes, objects, arrays, max depth. |
| 93 | + - [ ] Compute per-type counts (string, number, bool, null, etc.). |
| 94 | + - [ ] Estimate JSON size in bytes/KB. |
| 95 | + - [ ] Display metrics in a compact panel next to or above the viewer. |
| 96 | + - [ ] Allow enabling/disabling the stats panel via a parameter. |
| 97 | + - [ ] Document the statistics feature and configuration. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +### 7. Smart expand/collapse controls |
| 102 | + |
| 103 | +- **Issue Title**: `Implement smart expand/collapse controls for JSON tree` |
| 104 | +- **Description**: |
| 105 | + Improve the expand/collapse behavior with global controls (expand/collapse all) and a configurable default depth, so complex JSON structures remain manageable and fast to explore. |
| 106 | +- **Tasks**: |
| 107 | + - [ ] Add "Expand all" and "Collapse all" actions (optional UI buttons). |
| 108 | + - [ ] Add a parameter for default expansion depth (e.g., `DefaultExpandDepth`). |
| 109 | + - [ ] Ensure expand/collapse operations are efficient for large JSON. |
| 110 | + - [ ] Preserve expand/collapse state when possible (e.g., when re-rendering with same data). |
| 111 | + - [ ] Update documentation with examples for configuration. |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +## Milestone: Large JSON & Performance |
| 116 | + |
| 117 | +### 8. Large JSON virtualization and lazy loading |
| 118 | + |
| 119 | +- **Issue Title**: `Optimize rendering for large JSON documents (virtualization)` |
| 120 | +- **Description**: |
| 121 | + Add performance optimizations (such as virtualization and/or lazy loading) to handle large JSON documents without freezing the UI. Only visible portions of the tree should be rendered at any time. |
| 122 | +- **Tasks**: |
| 123 | + - [ ] Identify performance bottlenecks with large JSON samples. |
| 124 | + - [ ] Implement virtualization or incremental rendering for tree nodes. |
| 125 | + - [ ] Optionally add a soft limit or warning for very large inputs. |
| 126 | + - [ ] Ensure scrolling and interaction remain smooth. |
| 127 | + - [ ] Add a demo page with a large JSON file. |
| 128 | + - [ ] Document performance considerations and any configuration options. |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## Milestone: Theming & Integration |
| 133 | + |
| 134 | +### 9. Theming with CSS variables and dark mode |
| 135 | + |
| 136 | +- **Issue Title**: `Improve theming support and dark mode customization` |
| 137 | +- **Description**: |
| 138 | + Enhance theming by exposing key colors and styles via CSS variables and making sure dark mode looks polished. Consumers should be able to easily align the JSON viewer with their app theme. |
| 139 | +- **Tasks**: |
| 140 | + - [ ] Identify key style tokens (background, text, borders, selection, etc.). |
| 141 | + - [ ] Expose them as CSS variables or clear class hooks. |
| 142 | + - [ ] Ensure dark mode theme is consistent and readable. |
| 143 | + - [ ] Add examples for overriding styles from a parent app. |
| 144 | + - [ ] Update documentation with theming guidance. |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +### 10. Improved copy/export options |
| 149 | + |
| 150 | +- **Issue Title**: `Enhance copy and export options for JSON and nodes` |
| 151 | +- **Description**: |
| 152 | + Extend the existing copy/export functionality to support copying a node or subtree as JSON, and exporting either the whole document or a selected part with pretty-print or minified formats. |
| 153 | +- **Tasks**: |
| 154 | + - [ ] Add option to copy a single node or subtree as JSON. |
| 155 | + - [ ] Support copy/export of full JSON in pretty/minified modes. |
| 156 | + - [ ] Expose configuration for which copy/export options are visible. |
| 157 | + - [ ] Ensure exported JSON is always valid and uses current state. |
| 158 | + - [ ] Add documentation and examples. |
0 commit comments