Skip to content

Commit a5761e4

Browse files
committed
Fix template state issue + Rebrainding
1 parent 71acf3c commit a5761e4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

config/app.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ const PORT = ":8000"
1010

1111
func GetAppHandler(isStatic bool) *app.Handler {
1212
handler := &app.Handler{
13-
Title: "Master Prompt Builder",
14-
Name: "Master prompt builder",
15-
Description: "Will help you with building agents",
13+
Title: "Prompt Composer",
14+
Name: "Prompt Composer",
15+
Description: "Will help you with building master prompts",
1616
Version: uuid.New().String(),
1717
}
1818

1919
styles := []string{"/bundle.css"}
2020

2121
if isStatic {
22-
handler.Resources = app.GitHubPages("agent-prompt-builder")
22+
handler.Resources = app.GitHubPages("prompt-composer")
2323
} else {
2424
var tmpStyles []string
2525
for _, style := range styles {

ui/views/template_editor.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import (
1313
type TemplateEditorComponent struct {
1414
app.Compo
1515
MasterPrompt domain.MasterPrompt
16+
currentText string // mutable during lifecycle, loaded OnMount
17+
}
18+
19+
func (t *TemplateEditorComponent) OnMount(ctx app.Context) {
20+
t.currentText = string(t.MasterPrompt.Template)
1621
}
1722

1823
func (t *TemplateEditorComponent) Render() app.UI {
@@ -63,7 +68,7 @@ func (t *TemplateEditorComponent) Render() app.UI {
6368
}),
6469
app.Textarea().Class("textarea textarea-bordered h-80 w-full").
6570
Placeholder("Enter your master prompt template here").
66-
Text(t.MasterPrompt.Template).
71+
Text(t.currentText).
6772
OnChange(onMasterPromptTemplateChanged).OnKeyUp(onMasterPromptTemplateChanged),
6873
},
6974
}

web/app.wasm

888 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)