+
Skip to content

Delete all group related functions #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ VITE_IMGPROXY_URL=https://imgproxy.coracle.social
VITE_DUFFLEPUD_URL=https://dufflepud.onrender.com
VITE_PLATFORM_ZAP_SPLIT=0
VITE_PLATFORM_PUBKEY=8ec86ac9e10979998652068ee6b00223b8e3265aabb3fe28fb6b3b6e294adc96
VITE_FORCE_GROUP=
VITE_PLATFORM_RELAYS=
VITE_ENABLE_ZAPS=true
VITE_APP_NAME=Coracle
Expand Down
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run check
npm run format && npm run check

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Coracle is intended to be fully white-labeled by groups of various kinds. The fo
- `VITE_DUFFLEPUD_URL` is a [Dufflepud](https://github.com/coracle-social/dufflepud) instance url, which helps Coracle with things like link previews and image uploads.
- `VITE_PLATFORM_ZAP_SPLIT` is a decimal between 0 and 1 defining the default zap split percent.
- `VITE_PLATFORM_PUBKEY` is the pubkey of the platform owner. This gets zapped when using the platform zap split.
- `VITE_FORCE_GROUP` is an optional `kind:34550` or `kind:35834` address. If provided, the home page of Coracle will be the home page for the group, and most views will be filtered down to the group's scope. For user privacy, `VITE_PLATFORM_RELAYS` should also be set when using `VITE_FORCE_GROUP`.
- `VITE_PLATFORM_RELAYS` is an optional comma-separated list of relay urls to use for feeds. If provided, most UI components related to relay selection will be hidden from the user.
- `VITE_ENABLE_ZAPS` can be set to `false` to disable zaps.
- `VITE_APP_NAME` is the app's name.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"check:fmt": "prettier --check $(git diff head --name-only --diff-filter d | grep -E '(js|ts|svelte)$' | xargs)",
"check:errors": "run-s check:ts check:es",
"check": "run-p check:errors check:fmt",
"format": "prettier --write $(git diff head --name-only --diff-filter d | grep -E '(js|ts|svelte)$' | xargs)",
"format": "git diff head --name-only --diff-filter d | grep -E '(js|ts|svelte)$' | xargs -r prettier --write",
"watch": "find src -type f | entr -r"
},
"dependencies": {
Expand Down Expand Up @@ -99,4 +99,4 @@
"vite-plugin-pwa": "^0.20.5",
"vitest": "^2.1.3"
}
}
}
5 changes: 1 addition & 4 deletions src/app/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import {ready} from "src/engine"
import * as engine from "src/engine"
import * as domain from "src/domain"
import {loadAppData, slowConnections, loadUserData} from "src/app/state"
import {slowConnections, loadUserData} from "src/app/state"
import {themeVariables, appName} from "src/partials/state"
import Toast from "src/partials/Toast.svelte"
import Menu from "src/app/Menu.svelte"
Expand Down Expand Up @@ -195,7 +195,6 @@
requireSigner: true,
serializers: {
pubkey: asPerson,
group: asNaddr("group"),
type: asString("type"),
},
})
Expand Down Expand Up @@ -432,8 +431,6 @@
// before loading app data
await lib.sleep(350)

loadAppData()

if ($session) {
loadUserData()
}
Expand Down
6 changes: 2 additions & 4 deletions src/app/MenuDesktop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
: import.meta.env.VITE_APP_WORDMARK_LIGHT} />
</Anchor>
<MenuDesktopItem path="/notes" isActive={isFeedPage || isListPage}>Feeds</MenuDesktopItem>
{#if !env.FORCE_GROUP && env.PLATFORM_RELAYS.length === 0}
{#if env.PLATFORM_RELAYS.length === 0}
<MenuDesktopItem path="/settings/relays" isActive={$page?.path.startsWith("/settings/relays")}>
<div class="relative inline-block">
Relays
Expand Down Expand Up @@ -109,9 +109,7 @@
{/if}
</div>
</MenuDesktopItem>
<MenuDesktopItem modal path="/groups">
Groups
</MenuDesktopItem>
<MenuDesktopItem modal path="/groups">Groups</MenuDesktopItem>
<FlexColumn small class="absolute bottom-0 w-72">
<Anchor
class="staatliches px-8 text-tinted-400 hover:text-tinted-100"
Expand Down
2 changes: 1 addition & 1 deletion src/app/MenuMobile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<MenuMobileItem stopPropagation on:click={openSettings}>
<i class="fa fa-cog" /> Settings
</MenuMobileItem>
{#if !env.FORCE_GROUP && env.PLATFORM_RELAYS.length === 0}
{#if env.PLATFORM_RELAYS.length === 0}
<MenuMobileItem href="/settings/relays" on:click={closeMenu}>
<i class="fa fa-server" />
<div class="relative inline-block">
Expand Down
6 changes: 1 addition & 5 deletions src/app/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import PersonBadge from "src/app/shared/PersonBadge.svelte"
import {menuIsOpen, searchTerm} from "src/app/state"
import {router} from "src/app/util/router"
import {env, hasNewNotifications, hasNewMessages} from "src/engine"
import {hasNewNotifications, hasNewMessages} from "src/engine"

let innerWidth = 0
let searching = false
Expand Down Expand Up @@ -40,10 +40,6 @@
params.pubkey = props.pubkey
}

if (env.FORCE_GROUP) {
params.group = env.FORCE_GROUP
}

router.at("notes/create").qp(params).open()
}
</script>
Expand Down
13 changes: 0 additions & 13 deletions src/app/shared/EventInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import {secondsToDate, formatTimestamp, formatTimestampAsDate, getLocale} from "src/util/misc"
import Anchor from "src/partials/Anchor.svelte"
import Chip from "src/partials/Chip.svelte"
import GroupLink from "src/app/shared/GroupLink.svelte"
import PersonLink from "src/app/shared/PersonLink.svelte"
import EventActions from "src/app/shared/EventActions.svelte"
import NoteContentKind1 from "src/app/shared/NoteContentKind1.svelte"
Expand All @@ -27,7 +26,6 @@
const deleted = deriveIsDeletedByAddress(repository, event)

$: tags = Tags.fromEvent(event)
$: groupAddrs = tags.context().values().valueOf()
$: ({name, title, location} = fromPairs(event.tags))
$: end = parseInt(tags.get("end")?.value())
$: start = parseInt(tags.get("start")?.value())
Expand Down Expand Up @@ -69,17 +67,6 @@
Created by
<PersonLink pubkey={event.pubkey} />
</span>
{#if groupAddrs.length > 0}
<span>•</span>
<span>
Posted in
{#if groupAddrs.length === 1}
<GroupLink address={groupAddrs[0]} />
{:else}
{groupAddrs.length} groups
{/if}
</span>
{/if}
</div>
<div class="h-px bg-neutral-600" />
<div class="flex items-center gap-2 text-sm text-neutral-200">
Expand Down
4 changes: 0 additions & 4 deletions src/app/shared/Feed.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
export let feed: Feed
export let anchor = null
export let eager = false
export let contextAddress = null
export let skipNetwork = false
export let forcePlatform = true
export let shouldListen = false
export let showControls = false
export let hideSpinner = false
export let includeReposts = false
export let showGroup = false
export let onEvent = null

const splits = [["zap", env.PLATFORM_PUBKEY, "", "1"]]
Expand Down Expand Up @@ -102,8 +100,6 @@
<Note
filters={loader.getFilters() || [{ids: []}]}
depth={$shouldHideReplies ? 0 : 2}
{contextAddress}
{showGroup}
{anchor}
{note} />
</div>
Expand Down
14 changes: 3 additions & 11 deletions src/app/shared/FeedFormFilters.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
import FeedFormSectionPeople from "src/app/shared/FeedFormSectionPeople.svelte"
import FeedFormSectionRelays from "src/app/shared/FeedFormSectionRelays.svelte"
import FeedFormSectionTopics from "src/app/shared/FeedFormSectionTopics.svelte"
import FeedFormSectionContext from "src/app/shared/FeedFormSectionContext.svelte"
import FeedFormSectionMentions from "src/app/shared/FeedFormSectionMentions.svelte"
import FeedFormSectionKinds from "src/app/shared/FeedFormSectionKinds.svelte"
import FeedFormSectionCreatedAt from "src/app/shared/FeedFormSectionCreatedAt.svelte"
import FeedFormSectionList from "src/app/shared/FeedFormSectionList.svelte"
import FeedFormSectionDVM from "src/app/shared/FeedFormSectionDVM.svelte"
import FeedFormSaveAsList from "src/app/shared/FeedFormSaveAsList.svelte"
import {isTopicFeed, isPeopleFeed, isMentionFeed, isContextFeed} from "src/domain"
import {isTopicFeed, isPeopleFeed, isMentionFeed} from "src/domain"

export let feed
export let onChange
Expand All @@ -58,7 +57,6 @@
$: subFeeds = getFeedArgs(feed)
$: hasTopics = subFeeds.some(isTopicFeed)
$: hasMentions = subFeeds.some(isMentionFeed)
$: hasContext = subFeeds.some(isContextFeed)
$: hasPeople = subFeeds.some(isPeopleFeed)
$: hasRelays = subFeeds.some(isRelayFeed)
$: hasKinds = subFeeds.some(isKindFeed)
Expand All @@ -75,8 +73,7 @@
isAuthorFeed(subFeed) ||
isRelayFeed(subFeed) ||
isTopicFeed(subFeed) ||
isMentionFeed(subFeed) ||
isContextFeed(subFeed)}
isMentionFeed(subFeed)}
{#if canSave || !isGlobalFeed(subFeed)}
<Card class="relative">
<FlexColumn>
Expand All @@ -89,8 +86,6 @@
<FeedFormSectionTopics feed={subFeed} onChange={change} />
{:else if isMentionFeed(subFeed)}
<FeedFormSectionMentions feed={subFeed} onChange={change} />
{:else if isContextFeed(subFeed)}
<FeedFormSectionContext feed={subFeed} onChange={change} />
{:else if isKindFeed(subFeed)}
<FeedFormSectionKinds feed={subFeed} onChange={change} />
{:else if isCreatedAtFeed(subFeed)}
Expand Down Expand Up @@ -120,7 +115,7 @@
{/each}
{/key}

{#if !hasTopics || !hasMentions || !hasContext || !hasPeople || !hasRelays || !hasKinds || !hasCreatedAt || !hasDVM || !hasList}
{#if !hasTopics || !hasMentions || !hasPeople || !hasRelays || !hasKinds || !hasCreatedAt || !hasDVM || !hasList}
<div class="relative">
{#if menuIsOpen}
<Popover2 hideOnClick onClose={closeMenu} position="top">
Expand All @@ -131,9 +126,6 @@
{#if !hasMentions}
<MenuItem on:click={() => addFeed(makeTagFeed("#p"))}>Mentions</MenuItem>
{/if}
{#if !hasContext}
<MenuItem on:click={() => addFeed(makeTagFeed("#a"))}>Groups</MenuItem>
{/if}
{#if !hasPeople}
<MenuItem on:click={() => addFeed(makeAuthorFeed())}>Authors</MenuItem>
{/if}
Expand Down
12 changes: 2 additions & 10 deletions src/app/shared/FeedFormSaveAsList.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
<script lang="ts">
import {
NAMED_PEOPLE,
NAMED_COMMUNITIES,
NAMED_RELAYS,
NAMED_TOPICS,
getAddress,
} from "@welshman/util"
import {NAMED_PEOPLE, NAMED_RELAYS, NAMED_TOPICS, getAddress} from "@welshman/util"
import {tagPubkey} from "@welshman/app"
import {isAuthorFeed, isRelayFeed, makeListFeed} from "@welshman/feeds"
import Card from "src/partials/Card.svelte"
import Anchor from "src/partials/Anchor.svelte"
import Popover2 from "src/partials/Popover2.svelte"
import ListForm from "src/app/shared/ListForm.svelte"
import {makeUserList, isTopicFeed, isMentionFeed, isContextFeed} from "src/domain"
import {makeUserList, isTopicFeed, isMentionFeed} from "src/domain"

export let feed
export let onChange
Expand All @@ -36,8 +30,6 @@
return makeUserList({kind: NAMED_PEOPLE, tags: feed.slice(1).map(tagPubkey)})
} else if (isMentionFeed(feed)) {
return makeUserList({kind: NAMED_PEOPLE, tags: feed.slice(2).map(tagPubkey)})
} else if (isContextFeed(feed)) {
return makeUserList({kind: NAMED_COMMUNITIES, tags: feed.slice(2).map(a => ["a", a])})
} else if (isRelayFeed(feed)) {
return makeUserList({kind: NAMED_RELAYS, tags: feed.slice(1).map(url => ["r", url])})
} else if (isTopicFeed(feed)) {
Expand Down
28 changes: 0 additions & 28 deletions src/app/shared/FeedFormSectionContext.svelte

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/shared/GroupAbout.svelte

This file was deleted.

15 changes: 0 additions & 15 deletions src/app/shared/GroupActions.svelte

This file was deleted.

Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载