mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 08:52:25 +00:00
Update profile watch history to match main features
- Shorten npubs in history view cards. - Add Refresh, Privacy Banner, and Info to Profile Modal Watch History. - Wire up Profile Modal Watch History controls.
This commit is contained in:
1 parent
b8c3f639b5
commit
ddcbc0f004
3 files changed
+41
-1
No files matched your search
@@ -786,8 +786,41 @@
|
||||
>
|
||||
Republish now
|
||||
</button>
|
||||
<button
|
||||
id="profileHistoryRefresh"
|
||||
type="button"
|
||||
class="btn-ghost focus-ring inline-flex items-center gap-2"
|
||||
data-size="sm"
|
||||
>
|
||||
Refresh
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
id="profileHistoryPrivacyBanner"
|
||||
class="card hidden border border-status-info-border bg-status-info-surface px-4 py-3 text-sm text-status-info-on"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
>
|
||||
<p id="profileHistoryPrivacyMessage" class="mb-2"></p>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<button
|
||||
id="profileHistoryPrivacyDismiss"
|
||||
type="button"
|
||||
class="btn-ghost focus-ring text-xs"
|
||||
>
|
||||
Dismiss
|
||||
</button>
|
||||
<button
|
||||
id="profileHistoryPrivacyToggle"
|
||||
type="button"
|
||||
class="btn-ghost focus-ring text-xs hidden"
|
||||
>
|
||||
Change settings
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p id="profileHistoryInfo" class="text-xs text-muted"></p>
|
||||
<div
|
||||
id="profileHistorySessionWarning"
|
||||
class="hidden pill"
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@ import {
|
||||
getModerationOverrideActionLabels,
|
||||
} from "./ui/moderationUiHelpers.js";
|
||||
import { buildModerationBadgeText } from "./ui/moderationCopy.js";
|
||||
import { formatShortNpub } from "./utils/formatters.js";
|
||||
|
||||
export const WATCH_HISTORY_EMPTY_COPY =
|
||||
"Your watch history is empty. Watch some videos to populate this list.";
|
||||
@@ -1253,7 +1254,7 @@ export function buildHistoryCard({ item, video, profile }) {
|
||||
profile?.display_name || profile?.name || profile?.username || "Unknown";
|
||||
if ((!creatorLabel || creatorLabel === "Unknown") && video?.pubkey) {
|
||||
const encoded = app?.safeEncodeNpub?.(video.pubkey) || "";
|
||||
creatorLabel = encoded || video.pubkey.slice(0, 8).concat("…");
|
||||
creatorLabel = formatShortNpub(encoded) || encoded || video.pubkey.slice(0, 8).concat("…");
|
||||
}
|
||||
creatorNameButton.textContent = creatorLabel;
|
||||
|
||||
|
||||
@@ -1488,6 +1488,12 @@ export class ProfileModalController {
|
||||
errorBannerSelector: "#profileHistoryError",
|
||||
clearButtonSelector: "#profileHistoryClear",
|
||||
republishButtonSelector: "#profileHistoryRepublish",
|
||||
refreshButtonSelector: "#profileHistoryRefresh",
|
||||
privacyBannerSelector: "#profileHistoryPrivacyBanner",
|
||||
privacyMessageSelector: "#profileHistoryPrivacyMessage",
|
||||
privacyToggleSelector: "#profileHistoryPrivacyToggle",
|
||||
privacyDismissSelector: "#profileHistoryPrivacyDismiss",
|
||||
infoSelector: "#profileHistoryInfo",
|
||||
featureBannerSelector: "#profileHistoryFeatureBanner",
|
||||
sessionWarningSelector: "#profileHistorySessionWarning",
|
||||
emptyCopy: "You haven’t watched any videos yet.",
|
||||
|
||||
Reference in new issue
Block a user