more styling fixes, getting things consistent between view & edit

Orual 4f3bb8e0 9548c321

+47 -27
+22 -14
crates/weaver-app/assets/styling/record-view.css
··· 73 display: flex; 74 gap: 0; 75 border-bottom: 1px solid var(--color-border); 76 - margin-bottom: 1.5rem; 77 margin-top: 1.5rem; 78 align-items: center; 79 } ··· 166 display: flex; 167 flex-direction: column; 168 align-items: flex-start; 169 } 170 171 .record-field { ··· 173 flex-direction: column; 174 padding: 0rem 0 0rem 1rem; 175 padding-right: 1rem; 176 border-left: 2px solid var(--color-secondary); 177 border-bottom: 1px dashed var(--color-subtle); 178 z-index: 1; ··· 229 } 230 231 .record-section { 232 - padding-left: 1.5rem; 233 position: relative; 234 border-left: 1px dashed var(--color-border); 235 } ··· 242 padding-left: 1rem; 243 padding-top: 0.5rem; 244 padding-bottom: 0.25rem; 245 border-left: 2px solid var(--color-primary); 246 border-bottom: 1px dashed var(--color-muted); 247 - margin-left: -1.55rem; 248 } 249 250 .section-content .section-label { ··· 254 font-weight: 600; 255 padding-left: 1rem; 256 padding-top: 0.5rem; 257 - margin-left: -0.02rem; 258 border-left: 2px solid var(--color-secondary); 259 } 260 ··· 263 flex-direction: column; 264 align-items: flex-start; 265 padding-right: 1rem; 266 - margin-left: -0.02rem; 267 } 268 269 .section-content .record-field { ··· 425 font-family: var(--font-mono); 426 font-size: 0.9rem; 427 padding: 1rem; 428 - background: var(--color-background-alt, rgba(0, 0, 0, 0.2)); 429 border: 1px solid var(--color-border); 430 color: var(--color-text); 431 resize: vertical; ··· 442 font-family: var(--font-mono); 443 font-size: 0.85rem; 444 padding: 1rem; 445 - background: var(--color-background-alt, rgba(0, 0, 0, 0.2)); 446 border: 1px solid var(--color-border); 447 overflow-y: auto; 448 align-self: flex-start; ··· 450 451 .parse-error, 452 .validation-errors { 453 - color: var(--color-error, #ff6b6b); 454 margin-top: 0.5rem; 455 } 456 457 .parse-success, 458 .validation-success { 459 - color: var(--color-success, #51cf66); 460 } 461 462 .validation-errors h4 { ··· 468 469 .validation-errors .error { 470 padding: 0.25rem 0; 471 - border-left: 2px solid var(--color-error, #ff6b6b); 472 padding-left: 0.5rem; 473 margin: 0.25rem 0; 474 } ··· 481 } 482 483 .array-item .section-header { 484 - margin-left: -1.53rem; 485 } 486 .array-item .section-content .record-field { 487 - margin-left: 0rem; 488 } 489 490 .array-item .record-field { 491 - margin-left: -1.5rem; 492 } 493 494 .array-length { ··· 502 width: 100%; 503 display: flex; 504 flex-direction: column; 505 - margin-left: 1.49rem; 506 } 507 508 /* Pretty Editor Input Fields */ ··· 601 align-items: center; 602 padding: 0.75rem 0 0rem 0rem; 603 margin-bottom: 1rem; 604 border-left: 1px solid var(--color-border); 605 } 606
··· 73 display: flex; 74 gap: 0; 75 border-bottom: 1px solid var(--color-border); 76 margin-top: 1.5rem; 77 align-items: center; 78 } ··· 165 display: flex; 166 flex-direction: column; 167 align-items: flex-start; 168 + border-left: 1px dashed var(--color-subtle); 169 } 170 171 .record-field { ··· 173 flex-direction: column; 174 padding: 0rem 0 0rem 1rem; 175 padding-right: 1rem; 176 + margin-left: -1px; 177 border-left: 2px solid var(--color-secondary); 178 border-bottom: 1px dashed var(--color-subtle); 179 z-index: 1; ··· 230 } 231 232 .record-section { 233 + position: relative; 234 + margin-left: 1.5rem; 235 + border-left: 1px dashed var(--color-border); 236 + } 237 + 238 + .section-content .record-section { 239 + position: relative; 240 + border-left: 1px dashed var(--color-border); 241 + } 242 + 243 + .array-item .record-section { 244 position: relative; 245 border-left: 1px dashed var(--color-border); 246 } ··· 253 padding-left: 1rem; 254 padding-top: 0.5rem; 255 padding-bottom: 0.25rem; 256 + margin-left: -1px; 257 border-left: 2px solid var(--color-primary); 258 border-bottom: 1px dashed var(--color-muted); 259 } 260 261 .section-content .section-label { ··· 265 font-weight: 600; 266 padding-left: 1rem; 267 padding-top: 0.5rem; 268 + margin-left: -1px; 269 border-left: 2px solid var(--color-secondary); 270 } 271 ··· 274 flex-direction: column; 275 align-items: flex-start; 276 padding-right: 1rem; 277 } 278 279 .section-content .record-field { ··· 435 font-family: var(--font-mono); 436 font-size: 0.9rem; 437 padding: 1rem; 438 + background: var(--color-surface, rgba(0, 0, 0, 0.2)); 439 border: 1px solid var(--color-border); 440 color: var(--color-text); 441 resize: vertical; ··· 452 font-family: var(--font-mono); 453 font-size: 0.85rem; 454 padding: 1rem; 455 + background: var(--color-surface, rgba(0, 0, 0, 0.2)); 456 border: 1px solid var(--color-border); 457 overflow-y: auto; 458 align-self: flex-start; ··· 460 461 .parse-error, 462 .validation-errors { 463 + color: var(--color-error); 464 margin-top: 0.5rem; 465 } 466 467 .parse-success, 468 .validation-success { 469 + color: var(--color-success); 470 } 471 472 .validation-errors h4 { ··· 478 479 .validation-errors .error { 480 padding: 0.25rem 0; 481 + border-left: 2px solid var(--color-error); 482 padding-left: 0.5rem; 483 margin: 0.25rem 0; 484 } ··· 491 } 492 493 .array-item .section-header { 494 } 495 .array-item .section-content .record-field { 496 } 497 498 .array-item .record-field { 499 } 500 501 .array-length { ··· 509 width: 100%; 510 display: flex; 511 flex-direction: column; 512 + margin-left: 1.48rem; 513 } 514 515 /* Pretty Editor Input Fields */ ··· 608 align-items: center; 609 padding: 0.75rem 0 0rem 0rem; 610 margin-bottom: 1rem; 611 + margin-left: 1.5rem; 612 border-left: 1px solid var(--color-border); 613 } 614
+25 -13
crates/weaver-app/src/views/record.rs
··· 274 div { class: "section-content", 275 for (idx, item) in arr.iter().enumerate() { 276 { 277 - let item_path = format!("{}[{}]", path, idx); 278 let is_object = matches!(item, Data::Object(_)); 279 280 if is_object { 281 rsx! { 282 div { class: "record-section", 283 div { class: "section-label", "{item_path}" } 284 div { class: "section-content", ··· 289 } 290 } 291 } 292 } 293 } else { 294 rsx! { 295 DataView { 296 data: item.clone(), 297 path: item_path, 298 did: did.clone() 299 } 300 } 301 } 302 } ··· 307 } 308 Data::Object(obj) => { 309 let is_root = path.is_empty(); 310 - let is_array_item = path.contains('['); 311 312 if is_root || is_array_item { 313 // Root object or array item: just render children (array items already wrapped) 314 rsx! { 315 - for (key, value) in obj.iter() { 316 - { 317 - let new_path = if is_root { 318 - key.to_string() 319 - } else { 320 - format!("{}.{}", path, key) 321 - }; 322 - let did_clone = did.clone(); 323 - rsx! { 324 - DataView { data: value.clone(), path: new_path, did: did_clone } 325 } 326 } 327 } ··· 330 // Nested object (not array item): wrap in section 331 let label = path.split('.').last().unwrap_or(&path); 332 rsx! { 333 div { class: "record-section", 334 - div { class: "section-label", "{label}" } 335 div { class: "section-content", 336 for (key, value) in obj.iter() { 337 {
··· 274 div { class: "section-content", 275 for (idx, item) in arr.iter().enumerate() { 276 { 277 + let item_path = format!("{}[{}]", label, idx); 278 let is_object = matches!(item, Data::Object(_)); 279 280 if is_object { 281 rsx! { 282 + 283 + div { 284 + class: "array-item", 285 div { class: "record-section", 286 div { class: "section-label", "{item_path}" } 287 div { class: "section-content", ··· 292 } 293 } 294 } 295 + } 296 } 297 } else { 298 + 299 rsx! { 300 + 301 + div { 302 + class: "array-item", 303 DataView { 304 data: item.clone(), 305 path: item_path, 306 did: did.clone() 307 } 308 + } 309 } 310 } 311 } ··· 316 } 317 Data::Object(obj) => { 318 let is_root = path.is_empty(); 319 + let is_array_item = path.split('.').last().unwrap_or(&path).contains('['); 320 321 if is_root || is_array_item { 322 // Root object or array item: just render children (array items already wrapped) 323 rsx! { 324 + div { class: if !is_root { "record-section" } else {""}, 325 + for (key, value) in obj.iter() { 326 + { 327 + let new_path = if is_root { 328 + key.to_string() 329 + } else { 330 + format!("{}.{}", path, key) 331 + }; 332 + let did_clone = did.clone(); 333 + rsx! { 334 + DataView { data: value.clone(), path: new_path, did: did_clone } 335 + } 336 } 337 } 338 } ··· 341 // Nested object (not array item): wrap in section 342 let label = path.split('.').last().unwrap_or(&path); 343 rsx! { 344 + 345 + div { class: "section-label", "{label}" } 346 div { class: "record-section", 347 div { class: "section-content", 348 for (key, value) in obj.iter() { 349 {