Skip to content

Commit 2ec5f37

Browse files
committed
basic image sync working
1 parent 5e2399d commit 2ec5f37

File tree

7 files changed

+1651
-34
lines changed

7 files changed

+1651
-34
lines changed

package-lock.json

Lines changed: 79 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
"@angular/router": "^18.2.0",
2121
"@angular/service-worker": "^18.2.0",
2222
"@auth0/auth0-angular": "^2.2.3",
23+
"@types/jszip": "^3.4.0",
2324
"bootstrap-icons": "^1.11.3",
2425
"exifreader": "^4.23.5",
26+
"jszip": "^3.10.1",
2527
"primeflex": "^3.3.1",
2628
"primeicons": "^7.0.0",
2729
"primeng": "^17.18.9",

src/_shared/mobians-image.interface.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,31 @@ export interface MobiansImage {
1010
prompt?: string;
1111
promptSummary?: string;
1212
loras?: any[];
13-
thumbnailUrl?: string; // Add this line
13+
thumbnailUrl?: string;
1414
blob?: Blob;
1515
favorite?: boolean;
16+
// New fields for enhanced history features
17+
tags?: string[]; // User-defined tags for organizing images
18+
model?: string; // Model used for generation (for display in hover)
19+
seed?: number; // Seed used for generation
20+
negativePrompt?: string; // Negative prompt used
21+
cfg?: number; // CFG scale used
22+
syncPriority?: number; // Priority for cross-device sync (higher = sync first)
23+
lastModified?: Date; // Last time the image metadata was modified
1624
}
25+
26+
// Tag definition for user-created collections
27+
export interface ImageTag {
28+
id: string; // Unique tag ID
29+
name: string; // Display name
30+
color?: string; // Optional color for visual distinction
31+
createdAt: Date; // When the tag was created
32+
imageCount?: number; // Cached count of images with this tag
33+
}
1734

1835
// Used just for the image history
19-
export type MobiansImageMetadata = Pick<MobiansImage, 'UUID' | 'prompt' | 'promptSummary' | 'timestamp' | 'aspectRatio' | 'width' | 'height' | 'favorite' | 'loras'>;
36+
export type MobiansImageMetadata = Pick<MobiansImage,
37+
'UUID' | 'prompt' | 'promptSummary' | 'timestamp' | 'aspectRatio' |
38+
'width' | 'height' | 'favorite' | 'loras' | 'tags' | 'model' | 'seed' |
39+
'negativePrompt' | 'cfg' | 'syncPriority' | 'lastModified'
40+
>;

src/app/home/options/options.component.css

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,3 +562,136 @@
562562
text-align: center;
563563
}
564564
}
565+
566+
/* Bulk Selection Styles */
567+
.bulk-controls {
568+
padding: 0.5rem;
569+
background: rgba(0, 123, 255, 0.05);
570+
border-radius: 0.5rem;
571+
}
572+
573+
.bulk-actions {
574+
margin-left: auto;
575+
}
576+
577+
.history-item.selected .image-container {
578+
outline: 3px solid #007bff;
579+
outline-offset: 2px;
580+
}
581+
582+
.selection-checkbox {
583+
position: absolute;
584+
top: 8px;
585+
left: 8px;
586+
z-index: 10;
587+
cursor: pointer;
588+
font-size: 1.5em;
589+
color: white;
590+
text-shadow: 0 1px 3px rgba(0,0,0,0.5);
591+
}
592+
593+
.selection-checkbox i {
594+
background: rgba(0, 0, 0, 0.4);
595+
border-radius: 50%;
596+
padding: 4px;
597+
}
598+
599+
.selection-checkbox .bi-check-circle-fill {
600+
color: #28a745;
601+
background: white;
602+
}
603+
604+
/* Tag Section Styles */
605+
.tag-section {
606+
border-bottom: 1px solid rgba(0,0,0,0.1);
607+
padding-bottom: 0.5rem;
608+
}
609+
610+
.tag-manager-panel {
611+
background: rgba(0, 123, 255, 0.03);
612+
border: 1px solid rgba(0, 123, 255, 0.1);
613+
}
614+
615+
.tag-item {
616+
border: 1px solid rgba(0,0,0,0.1);
617+
}
618+
619+
/* Favorites tab button readability */
620+
.favorites-tab .favorites-control-btn,
621+
.favorites-tab .favorites-tag-btn {
622+
font-weight: 600;
623+
border-width: 2px;
624+
}
625+
626+
.favorites-tab .favorites-control-btn.btn-outline-secondary,
627+
.favorites-tab .favorites-control-btn.btn-outline-success,
628+
.favorites-tab .favorites-tag-btn.btn-outline-primary,
629+
.favorites-tab .favorites-tag-btn.btn-outline-secondary {
630+
background-color: rgba(255, 255, 255, 0.18);
631+
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
632+
}
633+
634+
.favorites-tab .favorites-control-btn.btn-outline-secondary,
635+
.favorites-tab .favorites-control-btn.btn-outline-success,
636+
.favorites-tab .favorites-tag-btn.btn-outline-primary {
637+
color: var(--theme-surface-text);
638+
}
639+
640+
/* Sync Indicator on Image Thumbnails */
641+
.sync-indicator {
642+
position: absolute;
643+
bottom: 5px;
644+
right: 5px;
645+
background: rgba(0, 0, 0, 0.6);
646+
color: #fff;
647+
border-radius: 50%;
648+
padding: 5px 7px;
649+
font-size: 1.35em;
650+
line-height: 1;
651+
display: inline-flex;
652+
align-items: center;
653+
justify-content: center;
654+
z-index: 10;
655+
}
656+
657+
.sync-indicator.synced {
658+
color: #4ECDC4;
659+
}
660+
661+
.sync-indicator.synced:not(.clickable) {
662+
pointer-events: none;
663+
}
664+
665+
.sync-indicator.clickable {
666+
cursor: pointer;
667+
transition: transform 0.2s, background-color 0.2s;
668+
}
669+
670+
.sync-indicator.clickable:hover {
671+
background: rgba(0, 123, 255, 0.8);
672+
transform: scale(1.15);
673+
}
674+
675+
.sync-indicator.synced.clickable:hover {
676+
background: rgba(220, 53, 69, 0.8);
677+
color: #fff;
678+
}
679+
680+
/* Mobile adjustments for new features */
681+
@media (max-width: 480px) {
682+
.bulk-controls {
683+
flex-direction: column;
684+
align-items: stretch;
685+
}
686+
687+
.bulk-actions {
688+
margin-left: 0;
689+
margin-top: 0.5rem;
690+
justify-content: center;
691+
}
692+
693+
.tag-section .btn {
694+
font-size: 0.8rem;
695+
padding: 0.25rem 0.5rem;
696+
}
697+
}

0 commit comments

Comments
 (0)