chore(Feedback): remove bug type

Nobody was using the type as intended, so this is part 1 of me phasing
it out.
This commit is contained in:
taskylizard 2025-03-11 23:38:38 +00:00
parent 59aa4be68c
commit e3685783c8
No known key found for this signature in database
GPG key ID: 1820131ED1A24120
37 changed files with 2098 additions and 1991 deletions

View file

@ -30,7 +30,7 @@ export function base64DecodePlugin(md: MarkdownRenderer) {
md.renderer.rules.code_inline = function (tokens, idx, options, env, self) {
if (
!env.frontmatter.title ||
(env.frontmatter.title && !env.frontmatter.title === 'base64')
(env.frontmatter.title && env.frontmatter.title !== 'base64')
) {
return defaultRender(tokens, idx, options, env, self)
}

View file

@ -53,10 +53,10 @@ export const headersPlugin = (md: MarkdownRenderer) => {
return result
}
let defaultRender = md.renderer.rules.link_open;
let defaultRender = md.renderer.rules.link_open
md.renderer.rules.link_open = (tokens, idx, options, env, self) => {
const result = defaultRender(tokens, idx, options, env, self);
const result = defaultRender!!!!!!!!!!!(tokens, idx, options, env, self)
const meta = tokens[idx].meta
if (!meta || !meta.feedback) return result

View file

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { MarkdownRenderer } from 'vitepress'
const excluded = ['Beginners Guide']
@ -25,12 +26,9 @@ export function toggleStarredPlugin(md: MarkdownRenderer) {
if (contentToken) {
const content = contentToken.content
// Log the content for debugging purposes
console.log('Content Token:', content)
if (
!excluded.includes(env.frontmatter.title) &&
(content.includes(':star:') || content.includes(':glowing-star:')) // Directly check for emojis
(content.includes(':star:') || content.includes(':glowing-star:'))
) {
return `<li class="starred">`
}

View file

@ -1,8 +1,7 @@
<script setup lang="ts">
import type { FeedbackType } from '../../types/Feedback'
import { useRouter } from 'vitepress'
import { computed, reactive, ref } from 'vue'
import { feedbackOptions, getFeedbackOption } from '../../types/Feedback'
import { feedbackOptions, getFeedbackOption, type FeedbackType } from '../../types/Feedback'
const props = defineProps<{
heading?: string
@ -35,10 +34,6 @@ function getPrompt() {
}
const messages = {
bug: [
"We're sorry to hear that!",
'Please try to be as specific as possible and provide us with the steps to reproduce the bug.'
],
suggestion: [
"We're glad you want to share your ideas!",
'Nix the fluff and just tell us what you think!',
@ -138,27 +133,21 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
<template v-if="props.heading">
<button
@click="toggleCard()"
class="bg-$vp-c-default-soft hover:bg-$vp-c-default-soft/40 text-primary border-$vp-c-default-soft hover:border-primary ml-3 inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-1.5 text-sm font-medium transition-all duration-300 sm:h-6"
class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft hover:border-primary ml-3 inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6"
>
<span
:class="
isCardShown === false
? `i-lucide:heart-handshake`
: `i-lucide:circle-x`
"
:class="isCardShown === false ? `i-lucide:mail` : `i-lucide:mail-x`"
/>
</button>
</template>
<template v-else>
<button
class="bg-$vp-c-default-soft hover:bg-$vp-c-default-soft/40 text-primary px2 py1 border-$vp-c-default-soft hover:border-primary mt-2 select-none rounded border-2 border-solid font-bold transition-all duration-300"
class="bg-$vp-c-default-soft text-primary px2 py1 border-$vp-c-default-soft hover:border-primary mt-2 select-none rounded border-2 border-solid font-bold transition-all duration-300"
@click="toggleCard()"
>
<span
:class="
isCardShown === false
? `i-lucide:heart-handshake mr-2`
: `i-lucide:circle-x mr-2`
isCardShown === false ? `i-lucide:mail mr-2` : `i-lucide:mail-x mr-2`
"
/>
<span>Send Feedback</span>
@ -168,52 +157,34 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
<Transition name="fade" mode="out-in">
<div
v-if="isCardShown"
class="border-$vp-c-divider bg-$vp-c-bg-alt b-rd-4 m-[2rem 0] step mt-4 border-2 border-solid p-6"
class="border-$vp-c-divider bg-$vp-c-bg-alt b-rd-4 m-[2rem 0] mt-4 border-2 border-solid p-6"
>
<Transition name="fade" mode="out-in">
<div v-if="!feedback.type" class="step">
<div>
<div>
<p class="desc">{{ prompt }}</p>
<p class="heading">
{{ helpfulText }}
</p>
</div>
</div>
<div v-if="!feedback.type">
<p class="heading">
{{ helpfulText }}
</p>
<div class="flex flex-wrap gap-2">
<button
v-for="item in feedbackOptions"
:key="item.value"
class="btn"
class="bg-bg border-$vp-c-default-soft hover:border-primary mt-2 select-none rounded border-2 border-solid font-bold transition-all duration-250 rounded-lg text-[14px] font-500 leading-normal m-0 px-3 py-1.5 text-center align-middle whitespace-nowrap"
@click="handleSubmit(item.value)"
>
<span>{{ item.label }}</span>
</button>
</div>
</div>
<div v-else-if="feedback.type && !success" class="step">
<div v-else-if="feedback.type && !success">
<div>
<p class="desc">
{{ helpfulDescription }}
</p>
<div>
<span>{{ getFeedbackOption(feedback.type)?.label }}</span>
<button
style="margin-left: 0.5rem"
class="btn"
@click="feedback.type = undefined"
>
<span class="i-lucide:arrow-left-from-line">close</span>
</button>
</div>
<p class="desc">{{ helpfulDescription }} - {{ prompt }}</p>
<span>{{ getFeedbackOption(feedback.type)?.label }}</span>
</div>
<p class="heading">
{{ message }}
</p>
<p class="heading" v-text="message"></p>
<div v-if="feedback.type === 'suggestion'" class="mb-2 text-sm">
<details>
<summary>
<span class="i-lucide:shield-alert bg-cerise-400 mb-1 ml-1" />
<span class="ii-lucide-shield-x bg-cerise-400 mb-1 ml-1" />
Do not submit any of the following:
</summary>
<strong>🕹 Emulators</strong>
@ -260,7 +231,7 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
<textarea
v-model="feedback.message"
autofocus
class="input"
class="bg-$vp-c-bg-alt text-$vp-c-text-2 w-full h-[100px] border border-$vp-c-divider rounded px-3 py-1.5 border-$vp-c-divider bg-$vp-c-bg-alt b-rd-4 border-2 border-solid"
placeholder="What a lovely wiki!"
/>
<p class="desc mb-2">
@ -273,16 +244,24 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
Discord.
</a>
</p>
<button
type="submit"
class="btn btn-primary"
:disabled="isDisabled"
@click="handleSubmit()"
>
Send Feedback 📩
</button>
<div class="flex flex-row gap-2">
<button
class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6"
@click="feedback.type = undefined"
>
<span class="i-lucide:panel-left-close">close</span>
</button>
<button
type="submit"
class="border border-div rounded-lg transition-colors duration-250 inline-block text-14px font-500 leading-1.5 px-3 py-3 text-center align-middle whitespace-nowrap disabled:opacity-50 text-text-2 bg-swarm-100 dark:bg-swarm-700 border-swarm-800 dark:border-swarm-700 disabled:bg-swarm-100 dark:disabled:bg-swarm-900 hover:border-swarm-900 dark:hover:border-swarm-800 hover:bg-swarm-200 dark:hover:bg-swarm-800"
:disabled="isDisabled"
@click="handleSubmit()"
>
Send Feedback 📩
</button>
</div>
</div>
<div v-else class="step">
<div v-else>
<p class="heading">Thanks for your feedback!</p>
</div>
</Transition>
@ -291,10 +270,6 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
</template>
<style scoped lang="css">
.step > * + * {
margin-top: 1rem;
}
.btn {
border: 1px solid var(--vp-c-divider);
background-color: var(--vp-c-bg);
@ -337,16 +312,6 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
font-weight: 700;
}
.input {
background-color: var(--vp-c-bg-alt);
color: var(--vp-c-text-2);
width: 100%;
height: 100px;
border: 1px solid var(--vp-c-divider);
border-radius: 4px;
padding: 0.375rem 0.75rem;
}
.desc {
display: block;
line-height: 20px;

View file

@ -18,7 +18,7 @@ import z from 'zod'
export const FeedbackSchema = z.object({
message: z.string().min(5).max(1000),
type: z.enum(['bug', 'suggestion', 'appreciation', 'other']),
type: z.enum(['suggestion', 'appreciation', 'other']),
page: z.string().min(3).max(20),
// For heading based feedback
heading: z.string().min(3).max(20).optional()
@ -34,8 +34,6 @@ export const feedbackOptions: Option[] = [
label: '💡 I have a suggestion',
value: 'suggestion'
},
{ label: '🐛 I want to report a website bug', value: 'bug' },
{
label: '👍 I appreciate the work',
value: 'appreciation'

View file

@ -3,7 +3,7 @@ title: Internet Archive Breach
description: Internet Archive was hacked
date: 2024-10-09
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [April]
description: April 2023 updates.
date: 2023-04-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [April]
description: April 2024 updates
date: 2024-04-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [August]
description: September 2023 updates.
date: 2023-08-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [August]
description: August 2024 updates
date: 2024-08-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [December] 250k members!!
description: Thank you all for 250K members! ♡
date: 2023-12-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [December]
description: December 2024 updates.
date: 2024-12-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Public Discord Server
description: Our new space to chat in.
date: 2023-10-24
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [Feb]
description: Febuary 2024 updates.
date: 2024-02-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [Feb]
description: February 2025 updates.
date: 2025-02-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: We Removed FileCR as we Found Malware
description: Update on FileCR
date: 2023-08-14
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [Jan] & Happy New Year!
description: Happy New Year everyone! We've made a lot of progress this year.
date: 2024-01-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [January]
description: January 2025 updates.
date: 2025-01-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [July]
description: July 2023 updates.
date: 2023-07-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [July]
description: July 2024 updates.
date: 2024-07-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [June]
description: June 2023 updates.
date: 2023-06-01
next: false
aside: right
prev: false
footer: true
---

View file

@ -3,7 +3,7 @@ title: Monthly Updates [June]
description: June 2024 updates
date: 2024-06-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [March 2025]
description: March 2025 updates
date: 2025-03-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [March]
description: March 2024 Updates
date: 2024-03-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [May]
description: May 2023 updates.
date: 2023-05-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [May]
description: May 2024 updates
date: 2024-05-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: New Website
description: Our brand new site (which you're on currently)
date: 2023-11-12
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [November]
description: October 2023 updates.
date: 2023-11-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [November]
description: Nov 2024 updates
date: 2024-11-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [October]
description: October 2023 updates.
date: 2023-10-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [Oct 2024]
description: October 2024 updates
date: 2024-10-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: How-to Search FMHY
description: Various tools to help you query FMHY.
date: 2023-01-07
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [September]
description: September 2023 updates.
date: 2023-09-01
next: false
aside: right
prev: false
footer: true

View file

@ -3,7 +3,7 @@ title: Monthly Updates [Sept]
description: September 2024 updates
date: 2024-09-01
next: false
aside: right
prev: false
footer: true

View file

@ -26,18 +26,19 @@
"@fmhy/components": "^0.0.3",
"@headlessui/vue": "^1.7.23",
"@resvg/resvg-js": "^2.6.2",
"@vueuse/core": "^13.0.0",
"consola": "^3.2.3",
"feed": "^4.2.2",
"itty-fetcher": "^0.9.4",
"nitro-cors": "^0.7.1",
"nitropack": "^2.10.4",
"nitropack": "^2.11.6",
"nprogress": "^0.2.0",
"pathe": "^2.0.1",
"unocss": "65.4.0",
"vitepress": "^1.5.0",
"vue": "^3.5.12",
"unocss": "66.1.0-beta.3",
"vitepress": "^1.6.3",
"vue": "^3.5.13",
"x-satori": "^0.2.0",
"zod": "^3.23.8"
"zod": "^3.24.2"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
@ -49,21 +50,22 @@
"@iconify-json/mdi": "^1.2.1",
"@iconify-json/simple-icons": "^1.2.12",
"@iconify-json/twemoji": "^1.2.1",
"@iconify/utils": "^2.3.0",
"@taskylizard/biome-config": "^1.0.5",
"@types/node": "^20.16.12",
"@types/nprogress": "^0.2.3",
"nitro-cloudflare-dev": "^0.2.1",
"prettier": "^3.3.3",
"nitro-cloudflare-dev": "^0.2.2",
"prettier": "^3.5.3",
"prettier-plugin-pkgsort": "^0.2.1",
"prettier-plugin-tailwindcss": "^0.6.8",
"sass": "^1.80.1",
"stylelint": "^16.10.0",
"stylelint-config-standard-scss": "^13.1.0",
"typescript": "^5.6.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"sass": "^1.85.1",
"stylelint": "^16.15.0",
"stylelint-config-standard-scss": "^14.0.0",
"typescript": "^5.8.2",
"unplugin-auto-import": "^0.18.3",
"vite-plugin-optimize-exclude": "^0.0.1",
"vite-plugin-terminal": "^1.2.0",
"wrangler": "^3.99.0"
"wrangler": "^3.114.1"
},
"pnpm": {
"peerDependencyRules": {

3883
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,6 @@
{
"compilerOptions": {
"verbatimModuleSyntax": true,
"baseUrl": ".",
"module": "esnext",
"target": "esnext",
"lib": ["DOM", "ESNext"],