Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Add comment count indicator to file viewer comments icon

Anand Baburajan53f10adc0ebf
diff --git a/web/apps/photos/src/styles/photoswipe.css b/web/apps/photos/src/styles/photoswipe.css
index 2d999ec06d..f0014a483e 100644
--- a/web/apps/photos/src/styles/photoswipe.css
+++ b/web/apps/photos/src/styles/photoswipe.css
@@ -550,6 +550,32 @@ body:has(
fill: white;
}
+/* Comment button with count indicator */
+.pswp-ente .pswp__action-button--comment {
+ position: relative;
+}
+
+.pswp-ente .pswp__comment-count {
+ position: absolute;
+ top: -6px;
+ right: -6px;
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ background-color: #fff;
+ color: #000;
+ font-family: "Inter Variable", sans-serif;
+ font-size: 12px;
+ font-weight: 600;
+ line-height: 24px;
+ text-align: center;
+ display: none;
+}
+
+.pswp-ente .pswp__comment-count:not(:empty) {
+ display: block;
+}
+
/* Reduce padding on mobile */
@media (width < 450px) {
.pswp-ente .pswp__bottom-right-controls {
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index e9d0b08cb3..70770af045 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -1919,8 +1919,9 @@ const bottomRightControlsHTML = () => `
<button class="pswp__action-button" aria-label="Like">
<svg viewBox="0 0 30 26" fill="none">${heartSVGPath} /></svg>
</button>
- <button class="pswp__action-button" aria-label="Comment">
+ <button class="pswp__action-button pswp__action-button--comment" aria-label="Comment">
<svg viewBox="0 0 28 28" fill="none">${commentSVGPath} /></svg>
+ <span class="pswp__comment-count">42</span>
</button>
</div>
`;