Compare commits

...

17 Commits

Author SHA1 Message Date
b14afc66d5 bump version to 0.4.1 2025-02-16 13:55:46 -07:00
e95b67b6db fix linting 2025-02-15 12:28:56 -07:00
8e46c38008 yet another attempt at nostr-tools nip06 fix 2025-02-15 12:28:21 -07:00
62def44ebb Merge pull request 'feat(feed): Images in the home feed now take up the full width of the card and displays in lightbox when clicked' (#125) from feat/image-feed-view-improvements into master
Reviewed-on: #125
2025-02-15 12:51:59 -05:00
f53248cae1 docs(feed): versioning 0.4.0 2025-02-14 13:49:17 -07:00
f4155e557a Merge pull request 'feat(feed): Images in the home feed now take up the full width of the card and displays in lightbox when clicked' (#124) from jsnbuchanan/crowd-funder-for-time-pwa:fix/adding-nostr-tools-dependency into feat/image-feed-view-improvements
Reviewed-on: #124
2025-02-14 15:41:31 -05:00
130d7ecb01 Merge branch 'feat/image-feed-view-improvements' into fix/adding-nostr-tools-dependency 2025-02-14 15:38:19 -05:00
6fc416d759 chore: cleanup in prep for pull request 2025-02-14 13:39:07 -07:00
aa0156cdf2 docs(feed): documenting improvements to the image view in the home feed 2025-02-14 13:32:36 -07:00
e86cf3c9f2 deps: fixing issues around nostr-tools deps being removed that were necessary 2025-02-14 13:24:29 -07:00
f4c7805266 feat(feed): improving the image viewer, to be more conventional, and also allowing the viewer to download the image on mobile with ... control 2025-02-14 13:06:36 -07:00
0511bbc17b feat(feed): adding image viewer for expanding images found in the feed instead of displaying in a new tab and taking the viewer away from the application 2025-02-14 11:52:20 -07:00
be1146c7df fix(feed): long words or urls displayed in feed break the container layout 2025-02-14 11:46:17 -07:00
77ebd32956 deps: updating the nostr-tools version from 2.7.2 to 2.10.4 to fix a bug I was seeing locally 2025-02-14 09:59:47 -07:00
781afd8954 feat(feed): better image formatting, to take up the width of the feed container 2025-02-14 09:58:55 -07:00
53a06be734 deps: updated nostr-tools and import 2025-02-14 06:39:46 -07:00
cc14b9e0ce bump version to 0.3.57 2025-02-11 09:13:02 -07:00
6 changed files with 175 additions and 30 deletions

View File

@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.1] - 2025.02.16
### Fixed
- nostr build issue
- Linting
## [0.4.0] - 2025.02.14
### Changed
- Images in the home feed now take up the full width of the card.
- Clicking the image previously, would open the image in a new tab. Now, clicking the image opens the image in a lightbox view.
### Added
- Clicking an image also now displays an in-app lightbox view of the image.
- The lightbox view includes a download button for the image in mobile view.
## [0.3.57] - 2025.02.11
### Added
- Automatic user creation in onboarding meetings
## [0.3.55] - 2025.02.07
### Added
- End time for projects

15
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "TimeSafari",
"version": "0.3.56-beta",
"version": "0.4.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "TimeSafari",
"version": "0.3.56-beta",
"version": "0.4.1",
"dependencies": {
"@capacitor/android": "^6.1.2",
"@capacitor/cli": "^6.1.2",
@@ -54,7 +54,7 @@
"lru-cache": "^10.2.0",
"luxon": "^3.4.4",
"merkletreejs": "^0.3.11",
"nostr-tools": "^2.7.2",
"nostr-tools": "^2.10.4",
"notiwind": "^2.0.2",
"papaparse": "^5.4.1",
"pina": "^0.20.2204228",
@@ -18905,9 +18905,10 @@
}
},
"node_modules/nostr-tools": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-2.7.2.tgz",
"integrity": "sha512-Bq3Ug0SZFtgtL1+0wCnAe8AJtI7yx/00/a2nUug9SkhfOwlKS92Tef12iCK9FdwXw+oFZWMtRnSwcLayQso+xA==",
"version": "2.10.4",
"resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-2.10.4.tgz",
"integrity": "sha512-biU7sk+jxHgVASfobg2T5ttxOGGSt69wEVBC51sHHOEaKAAdzHBLV/I2l9Rf61UzClhliZwNouYhqIso4a3HYg==",
"license": "Unlicense",
"dependencies": {
"@noble/ciphers": "^0.5.1",
"@noble/curves": "1.2.0",
@@ -18917,7 +18918,7 @@
"@scure/bip39": "1.2.1"
},
"optionalDependencies": {
"nostr-wasm": "v0.1.0"
"nostr-wasm": "0.1.0"
},
"peerDependencies": {
"typescript": ">=5.0.0"

View File

@@ -1,6 +1,6 @@
{
"name": "TimeSafari",
"version": "0.3.56-beta",
"version": "0.4.1",
"scripts": {
"dev": "vite",
"serve": "vite preview",
@@ -58,7 +58,7 @@
"lru-cache": "^10.2.0",
"luxon": "^3.4.4",
"merkletreejs": "^0.3.11",
"nostr-tools": "^2.7.2",
"nostr-tools": "^2.10.4",
"notiwind": "^2.0.2",
"papaparse": "^5.4.1",
"pina": "^0.20.2204228",

View File

@@ -0,0 +1,94 @@
<template>
<Teleport to="body">
<Transition name="fade">
<div v-if="isOpen" class="fixed inset-0 z-50 flex flex-col bg-black/90">
<!-- Header bar - fixed height to prevent overlap -->
<div class="h-16 flex justify-between items-center px-4 bg-black">
<button
class="text-white text-2xl p-2 rounded-full hover:bg-white/10"
@click="close"
>
<fa icon="xmark" />
</button>
<!-- Mobile share button -->
<button
v-if="isMobile"
class="text-white text-xl p-2 rounded-full hover:bg-white/10"
@click="handleShare"
>
<fa icon="ellipsis" />
</button>
</div>
<!-- Image container - fill remaining space -->
<div class="flex-1 flex items-center justify-center p-2">
<div class="w-full h-full flex items-center justify-center">
<img
:src="imageUrl"
class="max-h-[calc(100vh-5rem)] w-full h-full object-contain"
@click.stop
alt="expanded shared content"
/>
</div>
</div>
</div>
</Transition>
</Teleport>
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-facing-decorator";
import { UAParser } from "ua-parser-js";
@Component({ emits: ["update:isOpen"] })
export default class ImageViewer extends Vue {
@Prop() imageUrl!: string;
@Prop() imageData!: Blob | null;
@Prop() isOpen!: boolean;
userAgent = new UAParser();
get isMobile() {
const os = this.userAgent.getOS().name;
return os === "iOS" || os === "Android";
}
close() {
this.$emit("update:isOpen", false);
}
async handleShare() {
const os = this.userAgent.getOS().name;
try {
if (os === "iOS" || os === "Android") {
if (navigator.share) {
// Always share the URL since it's more reliable across platforms
await navigator.share({
url: this.imageUrl,
});
} else {
// Fallback for browsers without share API
window.open(this.imageUrl, "_blank");
}
}
} catch (error) {
console.warn("Share failed, opening in new tab:", error);
window.open(this.imageUrl, "_blank");
}
}
}
</script>
<style scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>

View File

@@ -281,7 +281,7 @@
/>
</span>
</span>
<span class="col-span-10 justify-self-stretch">
<span class="col-span-10 justify-self-stretch overflow-hidden">
<!-- show giver and/or receiver profiles... which seemed like a good idea but actually adds clutter
<span
v-if="
@@ -315,7 +315,7 @@
/>
</span>
-->
<span class="pl-2">
<span class="pl-2 block break-words">
{{ giveDescription(record) }}
</span>
<a @click="onClickLoadClaim(record.jwtId)">
@@ -346,10 +346,18 @@
</router-link>
</span>
</div>
<div v-if="record.image" class="flex justify-center">
<a :href="record.image" target="_blank">
<img :src="record.image" class="h-48 mt-2 rounded-xl" />
</a>
<div v-if="record.image" class="w-full">
<div
class="cursor-pointer"
@click="openImageViewer(record.image)"
>
<img
:src="record.image"
class="w-full aspect-[3/2] object-cover rounded-xl mt-2"
alt="shared content"
@load="cacheImageData($event, record.image)"
/>
</div>
</div>
</li>
</ul>
@@ -368,6 +376,12 @@
</section>
<ChoiceButtonDialog ref="choiceButtonDialog" />
<ImageViewer
:image-url="selectedImage"
:image-data="selectedImageData"
v-model:is-open="isImageViewerOpen"
/>
</template>
<script lang="ts">
@@ -386,6 +400,7 @@ import QuickNav from "@/components/QuickNav.vue";
import TopMessage from "@/components/TopMessage.vue";
import UserNameDialog from "@/components/UserNameDialog.vue";
import ChoiceButtonDialog from "@/components/ChoiceButtonDialog.vue";
import ImageViewer from "@/components/ImageViewer.vue";
import {
AppString,
NotificationIface,
@@ -455,6 +470,7 @@ interface GiveRecordWithContactInfo extends GiveSummaryRecord {
QuickNav,
TopMessage,
UserNameDialog,
ImageViewer,
},
})
export default class HomeView extends Vue {
@@ -489,6 +505,10 @@ export default class HomeView extends Vue {
}> = [];
showShortcutBvc = false;
userAgentInfo = new UAParser(); // see https://docs.uaparser.js.org/v2/api/ua-parser-js/get-os.html
selectedImage = "";
selectedImageData: Blob | null = null;
isImageViewerOpen = false;
imageCache: Map<string, Blob | null> = new Map();
async mounted() {
try {
@@ -970,5 +990,21 @@ export default class HomeView extends Vue {
},
});
}
async cacheImageData(event: Event, imageUrl: string) {
try {
// For images that might fail CORS, just store the URL
// The Web Share API will handle sharing the URL appropriately
this.imageCache.set(imageUrl, null);
} catch (error) {
console.warn("Failed to cache image:", error);
}
}
async openImageViewer(imageUrl: string) {
this.selectedImageData = this.imageCache.get(imageUrl) ?? null;
this.selectedImage = imageUrl;
this.isImageViewerOpen = true;
}
}
</script>

View File

@@ -229,18 +229,10 @@
import "leaflet/dist/leaflet.css";
import { AxiosError, AxiosRequestHeaders } from "axios";
import { DateTime } from "luxon";
import { hexToBytes } from "@noble/hashes/utils";
import { finalizeEvent, serializeEvent } from "nostr-tools";
// these core imports could also be included as "import type ..."
import {
EventTemplate,
UnsignedEvent,
VerifiedEvent,
} from "nostr-tools/lib/types/core";
import {
accountFromExtendedKey,
extendedKeysFromSeedWords,
} from "nostr-tools/nip06";
import { finalizeEvent, serializeEvent } from "nostr-tools/pure";
import { EventTemplate, UnsignedEvent, VerifiedEvent } from "nostr-tools/core";
import * as nip06 from "nostr-tools/nip06";
import { Component, Vue } from "vue-facing-decorator";
import { LMap, LMarker, LTileLayer } from "@vue-leaflet/vue-leaflet";
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
@@ -668,15 +660,15 @@ export default class NewEditProjectView extends Vue {
// remove any trailing '
const finalDerNumNoApostrophe = finalDerNum?.replace(/'/g, "");
const accountNum = Number(finalDerNumNoApostrophe || 0);
const extPubPri = extendedKeysFromSeedWords(
const extPubPri = nip06.extendedKeysFromSeedWords(
account?.mnemonic as string,
"",
accountNum,
);
const publicExtendedKey: string = extPubPri?.publicExtendedKey;
const privateExtendedKey = extPubPri?.privateExtendedKey;
const privateKey = accountFromExtendedKey(privateExtendedKey).privateKey;
const privateBytes = hexToBytes(privateKey);
const privateBytes: Uint8Array =
nip06.accountFromExtendedKey(privateExtendedKey).privateKey;
// No real content is necessary, we just want something signed,
// so we might as well use nostr libs for nostr functions.
// Besides: someday we may create real content that we can relay.
@@ -710,7 +702,8 @@ export default class NewEditProjectView extends Vue {
const endorserPartnerUrl = partnerServer + "/api/partner/link";
const timeSafariUrl = window.location.origin + "/claim/" + jwtId;
const content = this.fullClaim.name + " - see " + timeSafariUrl;
const publicKeyHex = accountFromExtendedKey(publicExtendedKey).publicKey;
const publicKeyHex =
nip06.accountFromExtendedKey(publicExtendedKey).publicKey;
const unsignedPayload: UnsignedEvent = {
// why doesn't "...signedPayload" work?
kind: signedPayload.kind,