Fix some display bugs, own notes showing up in no-reply feeds

This commit is contained in:
Jon Staab 2023-12-14 09:43:09 -08:00
parent d55814f1e9
commit 5d2096409d
10 changed files with 38 additions and 35 deletions

View File

@ -11,6 +11,7 @@
- [x] Add group marketplace
- [x] Support cross-posting
- [x] Limit number of replies shown on feed
- [x] Search results sorted by relevance weighted by WoT
# 0.3.14

View File

@ -195,19 +195,25 @@ body,
padding: 1px 0.2em;
}
.card .card, .modal .card {
background-color: var(--cocoa-d);
}
.card .card.interactive:hover, .modal .card.interactive:hover {
background-color: var(--dark);
}
.card .card .card, .modal .card .card {
.bg-swap,
.bg-swap .bg-swap-alt,
.bg-swap .bg-swap .bg-swap {
background-color: var(--cocoa);
}
.card .card .card.interactive:hover, .modal .card .card.interactive:hover {
.bg-swap-hover:hover,
.bg-swap .bg-swap-alt.bg-swap-hover:hover,
.bg-swap .bg-swap .bg-swap.bg-swap-hover:hover {
background-color: var(--cocoa-d);
}
.bg-swap-alt,
.bg-swap .bg-swap,
.bg-swap .bg-swap .bg-swap-alt {
background-color: var(--dark);
}
.bg-swap-alt.bg-swap-hover:hover,
.bg-swap .bg-swap.bg-swap-hover:hover {
background-color: var(--dark-d);
}

View File

@ -350,11 +350,8 @@
const offset = scrollY
// I don't know why this timeout is necessary
setTimeout(() => {
document.body.setAttribute("style", "")
window.scrollTo(0, offset)
}, 100)
document.body.setAttribute("style", "")
window.scrollTo(0, offset)
scrollY = null
}
})

View File

@ -124,14 +124,14 @@
{#if isOpen || forceOpen}
<div
transition:slide|local
class="note-reply relative z-feature my-2 flex flex-col gap-1"
class="note-reply relative z-feature my-2 flex flex-col gap-1 bg-swap"
bind:this={container}
on:click|stopPropagation>
{#if showBorder}
<div class="absolute bottom-0 left-4 top-0 z-none -my-2 w-px bg-cocoa" />
<div class="absolute bottom-0 left-4 top-0 z-none -my-2 w-px bg-swap-alt" />
{/if}
<div class="z-feature overflow-hidden rounded">
<div class="bg-cocoa p-3 text-lightest" class:rounded-b={mentions.length === 0}>
<div class="p-3 text-lightest" class:rounded-b={mentions.length === 0}>
<Compose bind:this={compose} onSubmit={send} style="min-height: 4rem">
<div class="flex flex-col justify-start" slot="addon">
<button
@ -142,11 +142,11 @@
</div>
</Compose>
</div>
<div class="bg-cocoa p-2">
<div class="p-2">
<NoteImages bind:this={images} bind:compose includeInContent />
</div>
<div class="h-px bg-cocoa" />
<div class="flex gap-2 rounded-b bg-cocoa p-2 text-sm text-lightest">
<div class="h-px" />
<div class="flex gap-2 rounded-b p-2 text-sm text-lightest">
<div class="inline-block border-r border-solid border-mid py-2 pl-1 pr-3">
<div class="flex cursor-pointer items-center gap-3">
<ImageInput multi hostLimit={3} on:change={e => images.addImage(e.detail)}>

View File

@ -296,7 +296,7 @@
<NoteImages bind:this={images} bind:compose includeInContent={type !== "listing"} />
<div class="flex gap-2">
<Anchor button tag="button" type="submit" class="flex-grow">Send</Anchor>
<ImageInput circle={false} multi hostLimit={3} on:change={e => images.addImage(e.detail)} />
<ImageInput circle={false} multi hostLimit={3} on:change={e => images?.addImage(e.detail)} />
</div>
<small
class="flex cursor-pointer items-center justify-end gap-4"

View File

@ -121,7 +121,7 @@
}
if (isHex(entity)) {
router.at("people").of(entity).open()
router.at("people").of(entity).replaceModal()
stopScanner()
} else if (entity.includes("@")) {
let profile = await nip05.queryProfile(entity)
@ -129,13 +129,13 @@
if (profile) {
const {pubkey, relays} = profile
router.at("people").of(pubkey, {relays}).open()
router.at("people").of(pubkey, {relays}).replaceModal()
stopScanner()
}
} else {
tryFunc(() => {
nip19.decode(entity)
router.at(entity).open()
router.at(entity).replaceModal()
stopScanner()
})
}

View File

@ -69,7 +69,7 @@ export const compressFiles = (files, opts) =>
export const eventsToMeta = (events: Event[]) => {
const tagsByHash = groupBy(
tags => tags.type("ox").values().first(),
Tags.from(events)
events.map(e => Tags.from(e))
)
// Merge all nip94 tags together so we can supply as much imeta as possible

View File

@ -276,15 +276,14 @@ export class FeedLoader {
})
const [subs, events] = this.remoteCursor.take(n)
const notes = this.discardEvents(events)
this.addSubs(subs)
let ok = notes
let ok = this.discardEvents(events)
// Skip anything out of order or missing context
if (this.opts.shouldDefer) {
ok = doPipe(notes.concat(this.deferred.splice(0)), [this.deferOrphans, this.deferAncient])
ok = doPipe(ok.concat(this.deferred.splice(0)), [this.deferOrphans, this.deferAncient])
}
// If we have nothing load something from the cache to keep the user happy
@ -293,7 +292,7 @@ export class FeedLoader {
this.addSubs(subs)
ok = events
ok = this.discardEvents(events)
}
this.addToFeed(ok)

View File

@ -39,8 +39,8 @@
on:click={onClick}
class={cx(
$$props.class,
"card rounded bg-cocoa p-3 text-lightest",
{"interactive cursor-pointer transition-all": interactive},
"bg-swap rounded bg-cocoa p-3 text-lightest",
{"bg-swap-hover cursor-pointer transition-all": interactive},
)}>
<slot />
</div>

View File

@ -107,9 +107,9 @@
{/if}
</div>
{/if}
<div class="absolute mt-12 h-full w-full bg-cocoa" />
<div class="absolute mt-12 h-full w-full bg-swap" />
<div
class="relative h-full w-full cursor-auto overflow-hidden rounded-t-2xl border-t border-solid border-mid bg-cocoa pb-10 pt-2"
class="relative h-full w-full cursor-auto overflow-hidden rounded-t-2xl bg-swap pb-10 pt-2"
on:click|stopPropagation>
<div class="m-auto flex max-w-2xl flex-col gap-4 p-2">
<slot />