Skip to content

Commit 0bb0146

Browse files
committed
feat: add an issue report button
1 parent 0c728ba commit 0bb0146

4 files changed

Lines changed: 555 additions & 14 deletions

File tree

src/lib/editor/Mirror.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
125125
lspClient.connect({
126126
send(m) {
127-
const msg = JSON.parse(m);
128127
editor.project.lspWrite(m);
129128
},
130129
subscribe(h) {

src/lib/editor/ProjectEditor.svelte

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Mirror from '$lib/editor/Mirror.svelte';
33
import PreviewPicker from '$lib/editor/PreviewPicker.svelte';
44
import { onMount } from 'svelte';
5-
import { createEditorContext } from './MMSEditor.svelte';
5+
import { useEditorContext } from './MMSEditor.svelte';
66
import { Pane, Splitpanes } from 'svelte-splitpanes';
77
import * as v from 'valibot';
88
import DeepslateRendererOffloaded, {
@@ -12,8 +12,7 @@
1212
import { Icon } from '@steeze-ui/svelte-icon';
1313
import { Download } from '@steeze-ui/tabler-icons';
1414
15-
const editor = createEditorContext();
16-
15+
const editor = useEditorContext();
1716
const sizingSchema = v.object({
1817
picker: v.number(),
1918
center: v.number(),
@@ -64,7 +63,9 @@
6463
<aside
6564
class="flex h-full min-h-0 w-full flex-col gap-4 overflow-x-hidden bg-slate-100 px-2 py-1 font-mono text-sm text-ellipsis"
6665
>
67-
<button class="flex gap-2 items-center" onclick={() => editor.project.download()}><Icon src={Download} class="w-4"/> Export</button>
66+
<button class="flex items-center gap-2" onclick={() => editor.project.download()}
67+
><Icon src={Download} class="w-4" /> Export</button
68+
>
6869
<PreviewPicker />
6970
</aside>
7071
</Pane>
@@ -76,7 +77,7 @@
7677
}}
7778
>
7879
<Pane size={sizes.mirror}>
79-
<div class="min-h-0 max-h-full w-full overflow-x-hidden">
80+
<div class="max-h-full min-h-0 w-full overflow-x-hidden">
8081
<Mirror />
8182
</div>
8283
</Pane>

src/routes/+layout.svelte

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,41 @@
11
<script lang="ts">
2+
import { Icon } from '@steeze-ui/svelte-icon';
23
import '../app.css';
4+
import { BrandGithub, Bug } from '@steeze-ui/tabler-icons';
5+
import { createEditorContext } from '../lib/editor/MMSEditor.svelte';
36
47
let { children } = $props();
8+
const editor = createEditorContext();
9+
10+
let issueLink = $derived.by(() => {
11+
const out = new URL('https://github.com/minecraftmetascript/mms/issues/new');
12+
13+
out.searchParams.set(
14+
'body',
15+
`
16+
# MMS Editor Bug Report:
17+
18+
## Problem
19+
20+
*[add a short description of the issue you're having here]*
21+
22+
## Expected Behavior
23+
24+
*[add a short description of what you expected to happen here]*
25+
26+
<details>
27+
<summary>Issue Script</summary>
28+
\`\`\`
29+
${editor.project.source['wasm.mms']}
30+
\`\`\`
31+
</details>
32+
`.trim()
33+
);
34+
35+
return out.toString();
36+
});
37+
38+
$inspect(editor.project.source);
539
</script>
640

741
<main class="flex h-svh w-svw flex-col">
@@ -15,13 +49,24 @@
1549
<br />
1650
This tool is <strong>NOT</strong> production ready.
1751
</p>
18-
<a
19-
href="https://github.com/minecraftmetascript/mms"
20-
target="_blank"
21-
class="absolute top-2 right-2 font-mono text-sm uppercase hover:underline"
22-
>
23-
Github
24-
</a>
52+
<div class="absolute top-2 right-2 flex justify-end gap-4 text-sm">
53+
<a
54+
href={issueLink}
55+
target="_blank"
56+
class="flex items-center gap-1 font-mono text-sm whitespace-nowrap uppercase hover:underline"
57+
>
58+
<Icon src={Bug} class="h-4" />
59+
Report an Issue
60+
</a>
61+
<a
62+
href="https://github.com/minecraftmetascript/mms"
63+
target="_blank"
64+
class="flex items-center gap-1 font-mono text-sm uppercase hover:underline"
65+
>
66+
<Icon src={BrandGithub} class="h-4" />
67+
Github
68+
</a>
69+
</div>
2570
</header>
2671
{@render children?.()}
2772
</main>

0 commit comments

Comments
 (0)