diff --git a/src/app/pages/project-view/project-view.component.scss b/src/app/pages/project-view/project-view.component.scss
index f4732ac..698ce02 100644
--- a/src/app/pages/project-view/project-view.component.scss
+++ b/src/app/pages/project-view/project-view.component.scss
@@ -15,7 +15,7 @@ mat-toolbar {
}
.categories-sidebar {
- width: 380px;
+ width: 420px;
border-right: 1px solid #e0e0e0;
background-color: #fff;
@@ -31,6 +31,8 @@ mat-toolbar {
font-size: 1.25rem;
font-weight: 500;
}
+
+ // icon centering handled globally via styles.scss
}
.loading-container {
@@ -68,6 +70,10 @@ mat-toolbar {
background-color: #bbdefb;
border-left: 4px solid #1976d2;
padding-left: calc(0.5rem - 4px);
+
+ .node-actions {
+ opacity: 1;
+ }
&:hover {
background-color: #90caf9;
@@ -85,13 +91,12 @@ mat-toolbar {
}
&.subcategory-node {
- padding-left: 3rem;
font-size: 0.95rem;
background-color: #fff;
-
+
&.selected {
background-color: #bbdefb;
- padding-left: calc(3rem - 4px);
+ border-left: 4px solid #1976d2;
}
}
@@ -110,8 +115,8 @@ mat-toolbar {
align-items: center;
gap: 0.25rem;
flex-shrink: 0;
- opacity: 0.7;
- transition: opacity 0.2s;
+ opacity: 0;
+ transition: opacity 0.15s;
mat-slide-toggle {
transform: scale(0.75);
@@ -119,15 +124,16 @@ mat-toolbar {
}
button {
- // width: 32px;
- // height: 32px;
- // line-height: 32px;
-
+ --mdc-icon-button-state-layer-size: 30px;
+ --mdc-icon-button-icon-size: 18px;
+ width: 30px;
+ height: 30px;
+ padding: 0;
+
mat-icon {
font-size: 18px;
width: 18px;
height: 18px;
- line-height: 18px;
}
&:hover {
@@ -143,6 +149,10 @@ mat-toolbar {
.subcategories {
background-color: #fafafa;
+ padding-left: 1rem;
+ border-left: 2px solid #e3e8ef;
+ margin-left: 1.25rem;
+ overflow: hidden;
}
}
diff --git a/src/app/pages/project-view/project-view.component.ts b/src/app/pages/project-view/project-view.component.ts
index b178728..8800601 100644
--- a/src/app/pages/project-view/project-view.component.ts
+++ b/src/app/pages/project-view/project-view.component.ts
@@ -253,8 +253,8 @@ export class ProjectViewComponent implements OnInit {
return;
}
- const parentId = parentNode.type === 'category' ? parentNode.id : parentNode.id;
- this.apiService.createSubcategory(parentId, result).subscribe({
+ const parentType = parentNode.type === 'category' ? 'category' : 'subcategory';
+ this.apiService.createSubcategory(parentNode.id, parentType, result).subscribe({
next: () => {
this.snackBar.open('Subcategory created!', 'Close', { duration: 2000 });
this.loadCategories();
diff --git a/src/app/pages/subcategory-editor/subcategory-editor.component.html b/src/app/pages/subcategory-editor/subcategory-editor.component.html
index bb42346..0818cb6 100644
--- a/src/app/pages/subcategory-editor/subcategory-editor.component.html
+++ b/src/app/pages/subcategory-editor/subcategory-editor.component.html
@@ -15,11 +15,7 @@
@if (saving()) {
Saving...
}
-
-
@@ -109,10 +105,17 @@
-
- list
- View Items ({{ subcategory()!.itemCount || 0 }})
-
+ @if (subcategory()!.subcategories?.length) {
+
+ account_tree
+ This subcategory has child subcategories — items can only be added to leaf nodes.
+
+ } @else {
+
+ {{ subcategory()!.hasItems ? 'list' : 'add' }}
+ {{ subcategory()!.hasItems ? 'View Items (' + (subcategory()!.itemCount || 0) + ')' : 'Add Items' }}
+
+ }