Repository navigation
cf234 [Grida Canvas] Hierarchy Renaming - #349
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
WalkthroughA hierarchical, interactive tree component with drag-and-drop and multi-select was introduced and integrated into the editor, including a new UI for node hierarchy management with renaming and accessibility features. Supporting utilities and dependencies for tree management were added, and related types and UI elements were refactored for clarity and consistency. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Sidebar
participant TreeComponent
participant DocumentState
User->>Sidebar: Opens sidebar (Node Hierarchy)
Sidebar->>TreeComponent: Initializes tree with scene root
TreeComponent->>DocumentState: Loads children for root
DocumentState-->>TreeComponent: Returns node hierarchy
TreeComponent-->>User: Renders interactive tree (expand, select, drag, rename)
User->>TreeComponent: Drags or renames node
TreeComponent->>DocumentState: Updates hierarchy or node name
DocumentState-->>TreeComponent: Confirms update
TreeComponent-->>User: Updates tree display
sequenceDiagram
participant User
participant AllComponentsPage
participant OriginComp569
User->>AllComponentsPage: Navigates to dev UI page
AllComponentsPage->>OriginComp569: Renders tree demo
OriginComp569-->>User: Displays interactive tree with drag-and-drop and multi-select
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
cf234 [Grida Canvas] Hierarchy Renaming
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (4)
editor/app/(dev)/ui/comp/comp-569.tsx (1)
123-123: Fix typo in accessibility textThere's a small typo in the accessibility text.
-Tee with multi-select and drag and drop ∙{" "} +Tree with multi-select and drag and drop ∙{" "}editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx (3)
293-298:onDrophandler only logs – consider implementing or gating featureDrag-and-drop is enabled (
dragAndDropFeature,keyboardDragAndDropFeature) yet the callback currently just prints to the console.
If left as-is, users can drag layers with no visible effect, creating confusion.Options:
- onDrop(items, target) { - const ids = items.map((item) => item.getId()); - const target_id = target.item.getId(); - const index = "insertionIndex" in target ? target.insertionIndex : 0; - console.log("drop", ids, target_id, index); - }, + async onDrop(items, target) { + const ids = items.map((i) => i.getId()); + const parentId = target.item.getId(); + const index = "insertionIndex" in target ? target.insertionIndex : 0; + + // TODO: call document.moveNodes(ids, parentId, index); + // await persistChange(); + // tree.rebuildTree(); + },or temporarily disable DnD until implemented.
341-346: Avoid arbitrary 200 ms timeout when starting renameUsing
setTimeout(..., 200)introduces race conditions (slow machines, differing context-menu close times).If the issue is focus loss while the context-menu unmounts, prefer
queueMicrotask/requestAnimationFrameor the library’sonOpenChangecallback:-onStartRenaming={() => { - // prevent from input blurring caused by the context menu closing - setTimeout(() => { - item.startRenaming(); - }, 200); -}} +onStartRenaming={() => { + // run after the menu closes on the next frame + requestAnimationFrame(() => item.startRenaming()); +}}This guarantees minimal delay and removes the magic number.
395-418: Add accessible labels for lock / visibility buttonsIcon-only controls should expose an
aria-labelso screen-reader users understand their purpose.-<button +<button + aria-label={node.locked ? "Unlock layer" : "Lock layer"} … -<button +<button + aria-label={node.active ? "Hide layer" : "Show layer"}Consider adding
titleattributes for non-assistive hover hints as well.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
editor/app/(dev)/ui/comp/comp-569.tsx(1 hunks)editor/app/(dev)/ui/page.tsx(2 hunks)editor/components/ui-editor/tree.tsx(1 hunks)editor/grida-react-canvas-starter-kit/starterkit-icons/node-type-icon.tsx(1 hunks)editor/grida-react-canvas/action.ts(2 hunks)editor/package.json(1 hunks)editor/scaffolds/playground-canvas/playground.tsx(2 hunks)editor/scaffolds/sidebar/sidebar-mode-design-form.tsx(1 hunks)editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx(5 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
editor/scaffolds/sidebar/sidebar-mode-design-form.tsx (1)
editor/components/ui/sidebar.tsx (1)
SidebarGroupLabel(708-708)
editor/components/ui-editor/tree.tsx (1)
editor/components/lib/utils/index.ts (1)
cn(4-6)
editor/grida-react-canvas/action.ts (1)
packages/grida-canvas-schema/grida.ts (2)
NodeID(806-806)NodeID(2109-2109)
🔇 Additional comments (19)
editor/scaffolds/playground-canvas/playground.tsx (2)
340-340: Clean UI spacing improvement.Adding margin-end to the icon improves the visual spacing between the icon and the "Tools" label.
384-384: Consistent UI spacing enhancement.Added margin-end to maintain consistent spacing between the icon and the "Examples" label, matching the pattern used with other menu items.
editor/grida-react-canvas/action.ts (3)
223-240: Excellent refactoring of hierarchy action types.The introduction of
EditorHierarchyActionwith its specific subtypes provides better type organization and control for hierarchy operations. The newEditorHierarchyMoveActioninterface with source and target properties enables precise node movement, which is essential for the drag-and-drop functionality described in the PR objectives.This refactoring creates a clean separation of concerns between ordering nodes and moving nodes within the hierarchy, making the code more maintainable and the actions more semantically clear.
45-46: Improved type naming for better code readability.The updated type names in
DocumentActionprovide clearer semantics about their purposes:
EditorHierarchyOrderActionexplicitly indicates hierarchy orderingEditorVectorPathActionclarifies that these actions relate to vector pathsThis naming improvement helps distinguish between different action categories.
243-243: Better naming for vector path actions.Renaming from
EditorPathActiontoEditorVectorPathActionadds clarity by explicitly indicating these actions relate to vector paths rather than general paths or hierarchical paths.editor/grida-react-canvas-starter-kit/starterkit-icons/node-type-icon.tsx (1)
39-41: LGTM: Improved consistency in className prop usageThe addition of the
classNameprop toViewVerticalIconandViewHorizontalIconcomponents makes the code more consistent, as all other icon components in this file already had the className prop applied. This ensures uniform styling capabilities across all icons.editor/app/(dev)/ui/page.tsx (3)
2-2: LGTM: Consolidated React importsGood cleanup by consolidating the React imports into a single statement.
9-9: LGTM: New tree component importProper import of the new tree UI component that will be showcased on this page.
27-28: LGTM: Added new component with proper separationThe new tree component is properly added to the components showcase with an appropriate divider.
editor/app/(dev)/ui/comp/comp-569.tsx (5)
3-20: LGTM: Well-structured imports for tree functionalityThe imports are organized in logical groups - React core, headless tree functionality, UI icons, and custom tree components. This organization makes the dependencies clear and maintainable.
22-55: LGTM: Clear data model structureThe
Iteminterface and initial data structure are well-defined, providing a good hierarchical structure for demonstrating the tree functionality. The nested departments and teams effectively showcase the component's capabilities for handling multi-level hierarchies.
62-92: LGTM: Comprehensive tree configurationThe tree hook configuration is thorough, with proper initial state setup, item handlers, and comprehensive feature enablement. The reordering implementation using state updates is clean and efficient.
94-116: LGTM: Well-structured tree renderingThe component renders the tree with appropriate accessibility features and visual indicators for folder states. The mapping over tree items is clean and each item is properly keyed.
118-132: LGTM: Good accessibility implementationThe component includes appropriate ARIA attributes and explanatory text with a link to documentation, enhancing usability for all users.
editor/components/ui-editor/tree.tsx (5)
9-23: LGTM: Well-structured context setupThe TreeContext is properly set up with reasonable defaults and a strongly-typed hook for accessing context values.
30-56: LGTM: Flexible Tree component implementationThe Tree component has a clean implementation that:
- Properly merges props from tree controller if available
- Sets up custom CSS variables for indentation
- Provides the context to child components
- Uses appropriate data attributes for styling
64-128: LGTM: Comprehensive TreeItem implementationThe TreeItem component handles all necessary state and styling concerns:
- Dynamic padding based on item level and indent size
- Data attributes for various item states (focused, folder, selected, etc.)
- Appropriate ARIA attributes for accessibility
- Proper context propagation
135-165: LGTM: Flexible TreeItemLabel with fallbacksThe TreeItemLabel component is well-implemented with:
- Support for items from either props or context
- Proper error handling when no item is provided
- Conditional rendering of folder indicator
- Flexible content rendering (children or item name)
167-191: LGTM: Robust TreeDragLine implementationThe TreeDragLine component:
- Properly handles the case when tree or required methods are missing
- Applies styles from the tree controller
- Uses appropriate styling for visual feedback during drag operations
| "@headless-tree/core": "^1.0.1", | ||
| "@headless-tree/react": "^1.0.1", |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
LGTM! Appropriate dependencies for implementing tree UI components.
Adding these tree-related packages aligns well with the PR objectives of introducing a new Tree UI component with hierarchical management capabilities. The versioning looks good with stable 1.x releases.
🌐 Web query:
What is the latest version of @headless-tree/react?
💡 Result:
The latest version of @headless-tree/react is 1.0.0, which was published 13 days ago as of May 21, 2025[1]. This is the current stable release version available on npm. The package is part of the headless-tree project by Lukas Bach, which provides tree component functionality for React applications[3].
The package can be installed via npm using the command npm i @headless-tree/react[1]. It's designed to work alongside @headless-tree/core, which provides the core functionality for the tree components[3][4].
The headless-tree project is aimed at providing super-easy integration of complex tree components into React applications, with support for ordered and unordered drag-and-drop, extensive keybindings, search, renaming, and more features[3]. The latest release was published to GitHub as well, where both @headless-tree/react and @headless-tree/core received version 1.0.0 releases[7].
Citations:
- 1: https://www.npmjs.com/package/@headless-tree/react
- 2: https://www.npmjs.com/package/react-headless-tree
- 3: https://github.com/lukasbach/headless-tree
- 4: https://headless-tree.lukasbach.com/getstarted/
- 5: https://www.npmjs.com/package/@minoru/react-dnd-treeview
- 6: https://www.npmjs.com/package/@headlessui/react
- 7: https://github.com/lukasbach/headless-tree/releases
- 8: https://github.com/lukasbach/react-complex-tree
- 9: https://www.npmjs.com/package/@layerok/react-headless-treeview?activeTab=readme
- 10: https://dev.to/lukasbach/headless-tree-is-now-available-in-beta-j62
Update Headless-Tree dependency versions
The specified versions (^1.0.1) aren’t available on npm—the latest stable release for both packages is 1.0.0. Please adjust your editor/package.json accordingly:
- File: editor/package.json
- Lines: 46–47
- "@headless-tree/core": "^1.0.1",
- "@headless-tree/react": "^1.0.1",
+ "@headless-tree/core": "^1.0.0",
+ "@headless-tree/react": "^1.0.0",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "@headless-tree/core": "^1.0.1", | |
| "@headless-tree/react": "^1.0.1", | |
| "@headless-tree/core": "^1.0.0", | |
| "@headless-tree/react": "^1.0.0", |
🤖 Prompt for AI Agents
In editor/package.json at lines 46 to 47, the versions specified for
@headless-tree/core and @headless-tree/react are ^1.0.1, which do not exist on
npm. Update both dependency versions to the latest stable release, which is
1.0.0, to ensure the packages can be correctly resolved and installed.
|
|
||
| <SidebarGroup> | ||
| <SidebarGroupLabel>Layers</SidebarGroupLabel> | ||
| <SidebarGroupLabel>Blocks</SidebarGroupLabel> |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Terminology update from "Layers" to "Blocks".
This label change reflects a conceptual shift in how hierarchy items are presented to users. The term "Blocks" better aligns with the component-based structure being implemented with the new tree UI components.
To ensure consistency, let's verify that this terminology is used consistently across the application:
🏁 Script executed:
#!/bin/bash
# Check for occurrences of both "Layers" and "Blocks" in the codebase to ensure consistency
echo "Searching for 'Layers' references that might need updating:"
rg -i "layers" --glob="*.{tsx,ts,js,jsx}" | grep -v "node_modules" | grep -i "label\|title\|heading"
echo -e "\nSearching for 'Blocks' terminology usage:"
rg -i "blocks" --glob="*.{tsx,ts,js,jsx}" | grep -v "node_modules" | grep -i "label\|title\|heading"Length of output: 1422
Ensure consistent “Blocks” terminology across sidebar labels
The update in sidebar-mode-design-form.tsx replaces “Layers” with “Blocks”, but there are two remaining instances that should also be updated for consistency:
-
editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx
- <SidebarGroupLabel>Layers</SidebarGroupLabel> + <SidebarGroupLabel>Blocks</SidebarGroupLabel>
-
editor/components/formfield/grida-canvas/index.tsx
- <SidebarSectionHeaderLabel>Layers</SidebarSectionHeaderLabel> + <SidebarSectionHeaderLabel>Blocks</SidebarSectionHeaderLabel>
Please make these changes so users encounter a uniform “Blocks” label throughout the UI.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In editor/scaffolds/sidebar/sidebar-mode-design-form.tsx at line 47, the label
"Layers" has been updated to "Blocks" but two other files still use "Layers" in
their sidebar labels: editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx
and editor/components/formfield/grida-canvas/index.tsx. Locate the label or
heading text in these files that still say "Layers" and update them to "Blocks"
to maintain consistent terminology across the UI.
| (e: React.KeyboardEvent<HTMLInputElement>) => { | ||
| if (e.key === "Enter" || e.keyCode === 13) { | ||
| e.preventDefault(); | ||
| e.stopPropagation(); | ||
| onValueCommit?.(value); | ||
| ref.current?.blur(); | ||
| return; | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
NameInput commits twice – duplicate callbacks on Enter
onKeyDown commits (onValueCommit) and triggers blur(), then the capture-phase listener (lines 506-514) commits again when the same event bubbles. This results in two rename events.
Simplify by relying on one handler (React’s onKeyDown) and drop the manual addEventListener:
-// Set up capture-phase event listener …
-useEffect(() => {
- const handleKeyDown = (e: KeyboardEvent) => {
- if (e.key === "Enter" || e.keyCode === 13) {
- …
- }
- };
- const input = ref.current;
- if (input) {
- input.addEventListener("keydown", handleKeyDown, true);
- }
- return () => {
- if (input) input.removeEventListener("keydown", handleKeyDown, true);
- };
-}, [ref.current, initialValue, onValueCommit, value]);
+// (effect removed – onKeyDown already prevents propagation & commits)This avoids duplicate dispatches and simplifies cleanup.
Also applies to: 506-514
🤖 Prompt for AI Agents
In editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx around lines 484 to
491 and 506 to 514, the onValueCommit callback is triggered twice on Enter key
press due to both React's onKeyDown handler and a manual capture-phase event
listener committing the value. To fix this, remove the manual addEventListener
code (lines 506-514) and rely solely on the React onKeyDown handler to commit
the value and blur the input, preventing duplicate rename events and simplifying
event handling and cleanup.
| return children.filter( | ||
| (id) => (document.nodes[id] as grida.program.nodes.UnknwonNode).expanded | ||
| ); |
There was a problem hiding this comment.
Fix typo in generic cast – current spelling breaks type-checking and compilation
grida.program.nodes.UnknwonNode is misspelled.
The incorrect reference will cause a TypeScript error and block the build.
- (id) => (document.nodes[id] as grida.program.nodes.UnknwonNode).expanded
+ (id) => (document.nodes[id] as grida.program.nodes.UnknownNode /* or more specific */).expandedDouble-check the actual exported name in @grida/schema; if no such alias exists, fall back to Node or a local interface.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return children.filter( | |
| (id) => (document.nodes[id] as grida.program.nodes.UnknwonNode).expanded | |
| ); | |
| return children.filter( | |
| (id) => (document.nodes[id] as grida.program.nodes.UnknownNode /* or more specific */).expanded | |
| ); |
🤖 Prompt for AI Agents
In editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx around lines 265 to
267, fix the typo in the type cast from grida.program.nodes.UnknwonNode to the
correct spelling, likely grida.program.nodes.UnknownNode. Verify the exact
exported type name from @grida/schema and update the cast accordingly to restore
proper type-checking and compilation.
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx (2)
265-267: Fix the typo in type cast: "UnknwonNode" → "UnknownNode"This typo will cause TypeScript errors and block the build.
- (id) => (document.nodes[id] as grida.program.nodes.UnknwonNode).expanded + (id) => (document.nodes[id] as grida.program.nodes.UnknownNode).expanded
506-527:NameInputcommits twice – remove duplicate enter key handlerThe current implementation has both React's
onKeyDownhandler and a manual capture-phase event listener that trigger the same action, resulting in duplicate commits on Enter key press.-// Set up capture-phase event listener to intercept events before they reach other handlers -useEffect(() => { - const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === "Enter" || e.keyCode === 13) { - e.preventDefault(); - e.stopPropagation(); - onValueCommit?.(value); - ref.current?.blur(); - } - }; - - const input = ref.current; - if (input) { - // Using capture phase (true) to intercept events before they reach other handlers - input.addEventListener("keydown", handleKeyDown, true); - } - - return () => { - if (input) { - input.removeEventListener("keydown", handleKeyDown, true); - } - }; -}, [ref.current, initialValue, onValueCommit, value]);
🧹 Nitpick comments (2)
editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx (2)
400-406: Add aria-label to lock/unlock button for better accessibilityThe button currently lacks an accessible label that explains its purpose.
<button + aria-label={node.locked ? "Unlock node" : "Lock node"} onClick={(e) => { e.stopPropagation(); toggleNodeLocked(node.id); }} >
412-418: Add aria-label to visibility toggle button for better accessibilityThe button currently lacks an accessible label that explains its purpose.
<button + aria-label={node.active ? "Hide node" : "Show node"} onClick={(e) => { e.stopPropagation(); toggleNodeActive(node.id); }} >
| onDrop(items, target) { | ||
| const ids = items.map((item) => item.getId()); | ||
| const target_id = target.item.getId(); | ||
| const index = "insertionIndex" in target ? target.insertionIndex : 0; | ||
| console.log("drop", ids, target_id, index); | ||
| }, |
There was a problem hiding this comment.
Implement the onDrop handler function
The onDrop function currently only logs the drop operation but doesn't actually handle updating the document structure. This will make the drag-and-drop feature non-functional.
onDrop(items, target) {
const ids = items.map((item) => item.getId());
const target_id = target.item.getId();
const index = "insertionIndex" in target ? target.insertionIndex : 0;
- console.log("drop", ids, target_id, index);
+ // Handle actual node reparenting/reordering logic
+ if (target_id === "<scene-root>") {
+ // Move nodes to scene root at specified index
+ } else {
+ // Move nodes to be children of target node at specified index
+ }
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| onDrop(items, target) { | |
| const ids = items.map((item) => item.getId()); | |
| const target_id = target.item.getId(); | |
| const index = "insertionIndex" in target ? target.insertionIndex : 0; | |
| console.log("drop", ids, target_id, index); | |
| }, | |
| onDrop(items, target) { | |
| const ids = items.map((item) => item.getId()); | |
| const target_id = target.item.getId(); | |
| const index = "insertionIndex" in target ? target.insertionIndex : 0; | |
| // Handle actual node reparenting/reordering logic | |
| if (target_id === "<scene-root>") { | |
| // Move nodes to scene root at specified index | |
| } else { | |
| // Move nodes to be children of target node at specified index | |
| } | |
| }, |
🤖 Prompt for AI Agents
In editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx around lines 293 to
298, the onDrop handler only logs the drop event without updating the document
structure. To fix this, implement logic inside onDrop to update the underlying
data model by moving the dragged items to the new target location at the
specified insertion index. Ensure the document state is updated accordingly to
reflect the changes in the UI and persist the new hierarchy.
| useEffect(() => { | ||
| const input = ref.current; | ||
| if (input && !isInitiallyFocused.current) { | ||
| input.focus(); | ||
| input.select(); | ||
| isInitiallyFocused.current = true; | ||
| } | ||
| }, [ref.current]); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Fix dependency array in useEffect for input focus
The current implementation incorrectly uses ref.current in the dependency array, which doesn't trigger re-renders when it changes. Also, the effect doesn't include all dependencies it uses.
useEffect(() => {
const input = ref.current;
if (input && !isInitiallyFocused.current) {
input.focus();
input.select();
isInitiallyFocused.current = true;
}
-}, [ref.current]);
+}, []); // Run only once when component mounts📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| useEffect(() => { | |
| const input = ref.current; | |
| if (input && !isInitiallyFocused.current) { | |
| input.focus(); | |
| input.select(); | |
| isInitiallyFocused.current = true; | |
| } | |
| }, [ref.current]); | |
| useEffect(() => { | |
| const input = ref.current; | |
| if (input && !isInitiallyFocused.current) { | |
| input.focus(); | |
| input.select(); | |
| isInitiallyFocused.current = true; | |
| } | |
| }, []); // Run only once when component mounts |
🤖 Prompt for AI Agents
In editor/scaffolds/sidebar/sidebar-node-hierarchy-list.tsx around lines 529 to
536, the useEffect hook incorrectly lists ref.current in its dependency array,
which does not properly trigger the effect when the ref changes. Update the
dependency array to include the ref object itself or other relevant stable
dependencies instead of ref.current, and ensure all variables used inside the
effect, such as isInitiallyFocused, are included as dependencies if necessary.
This will ensure the effect runs correctly when the input element becomes
available.
Introduces new Tree UI w/
@headless-tree/reactAdded inline renaming feature
day-234-grida-canvas-hierarchy-renaming.mp4
Summary by CodeRabbit
New Features
UI Improvements
Bug Fixes
Chores