refactor(community): rename Community Connections → Community Ecology
Some checks failed
Test / vitest (push) Successful in 11m42s
Test / playwright (push) Failing after 9m27s
Test / visual (push) Failing after 9m53s
Test / Notify on failure (push) Successful in 2s

Simplify the feature to pure discovery (filter by topic, see matching
members, copy Slack handle). Drop the connection request/confirm flow
entirely — Connection model, 7 API endpoints, useConnections composable,
and TagInput component deleted.

- Rename communityConnections → communityEcology in schema, API, pages
- Delete legacy fields: offering, lookingFor, peerSupport
- New /ecology page, /api/ecology/suggestions, community-ecology.patch
- Nav: "Connections" → "Ecology", remove pending-count badge
- Fix auth/member.get.js missing craftTags + communityEcology
- Add community_ecology_updated activity log type
- Expose slackHandle conditionally when offerPeerSupport is true
- Add migration script at scripts/migrate-to-ecology.js (run before deploy)
This commit is contained in:
Jennie Robinson Faber 2026-04-09 09:07:15 +01:00
parent 9577929e0d
commit 0b3896d984
33 changed files with 1002 additions and 2635 deletions

View file

@ -34,13 +34,8 @@
:to="item.path"
:class="{ active: isActive(item.path) }"
@click="handleNavigate"
>{{ item.label }}</NuxtLink
>
{{ item.label }}
<span
v-if="item.path === '/connections' && pendingCount > 0"
class="nav-badge"
>{{ pendingCount }}</span>
</NuxtLink>
</li>
</ul>
</template>
@ -134,21 +129,7 @@ const emit = defineEmits(["navigate"]);
const route = useRoute();
const { isAuthenticated, logout } = useAuth();
const { getPendingCount } = useConnections();
const isDev = import.meta.dev;
const pendingCount = ref(0);
// Fetch pending connection count for authenticated users
onMounted(async () => {
if (isAuthenticated.value) {
try {
const data = await getPendingCount();
pendingCount.value = data.count || 0;
} catch {
// Silently ignore badge is non-critical
}
}
});
const handleNavigate = () => {
if (props.isMobile) {
@ -192,7 +173,7 @@ const youItems = [
const exploreItems = [
{ label: "Events", path: "/events" },
{ label: "Members", path: "/members" },
{ label: "Connections", path: "/connections" },
{ label: "Ecology", path: "/ecology" },
{ label: "Wiki", path: "https://wiki.ghostguild.org" },
{ label: "About", path: "/about" },
];
@ -298,19 +279,4 @@ const exploreItems = [
.sidebar-meta a {
color: var(--candle-dim);
}
.nav-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 16px;
height: 16px;
padding: 0 4px;
margin-left: 6px;
font-size: 10px;
line-height: 1;
color: var(--bg);
background: var(--candle);
border-radius: 0;
}
</style>

View file

@ -1,104 +0,0 @@
<template>
<div class="tags" @click="focusInput">
<span v-for="(tag, i) in modelValue" :key="tag" class="tag">
{{ tag }}
<span class="rm" @click.stop="removeTag(i)">&times;</span>
</span>
<input
ref="input"
v-model="newTag"
@keydown.enter.prevent="addTag"
@keydown.backspace="handleBackspace"
:placeholder="modelValue?.length ? '' : placeholder"
/>
</div>
</template>
<script setup>
const props = defineProps({
modelValue: { type: Array, default: () => [] },
placeholder: { type: String, default: "Add tag..." },
});
const emit = defineEmits(["update:modelValue"]);
const input = ref(null);
const newTag = ref("");
const focusInput = () => {
input.value?.focus();
};
const addTag = () => {
const tag = newTag.value.trim();
if (tag && !props.modelValue.includes(tag)) {
emit("update:modelValue", [...props.modelValue, tag]);
}
newTag.value = "";
};
const removeTag = (index) => {
const tags = [...props.modelValue];
tags.splice(index, 1);
emit("update:modelValue", tags);
};
const handleBackspace = () => {
if (!newTag.value && props.modelValue.length) {
removeTag(props.modelValue.length - 1);
}
};
</script>
<style scoped>
.tags {
border: 1px dashed var(--border);
padding: 3px 5px;
display: flex;
flex-wrap: wrap;
gap: 3px;
background: var(--input-bg);
min-height: 30px;
align-items: center;
cursor: text;
}
.tags:focus-within {
border-color: var(--candle);
border-style: solid;
}
.tag {
display: inline-flex;
align-items: center;
gap: 3px;
padding: 1px 6px;
border: 1px dashed var(--border-d);
font-size: 11px;
color: var(--text);
background: var(--surface);
}
.rm {
color: var(--text-faint);
cursor: pointer;
font-size: 12px;
line-height: 1;
}
.rm:hover {
color: var(--ember);
}
.tags input {
border: none;
background: transparent;
padding: 1px 4px;
font-size: 11px;
font-family: "Commit Mono", monospace;
color: var(--text);
flex: 1;
min-width: 80px;
outline: none;
}
</style>