• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
dcm31

dcm31

moiPosterImproved

Tool to manage moi.md files for Val Town content
Public
Like
moiPosterImproved
Home
Code
6
backend
2
frontend
2
shared
2
README.md
moi.md
testfile_1745875710738.txt
Branches
12
Pull requests
8
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/1/2025
Viewing readonly version of fix-editor-input branch: v13
View latest version
README.md

MoiPoster Improved

A tool to create and manage moi.md files for Val Town vals.

Fix Editor Input Branch

This branch addresses critical usability issues with the editors in the MoiPoster tool:

  1. Input Focus Issues: Previously, when editing input fields in the moi.md editor, the input would sometimes lose focus and freeze up, making it difficult to type smoothly.

  2. Save Functionality Problems: After the initial input focus fix, there was an issue where saving would reset content to defaults or not save the latest changes.

Root Causes:

  1. The editor was trying to update the content in real-time with every keystroke
  2. Each update was triggering a re-render, which would cause the input to lose focus
  3. State synchronization issues between components caused saving problems
  4. Content wasn't properly transferred between components during save operations

Changes Made:

  1. MoiEditor.tsx:

    • Removed the isUserEditing state and automatic real-time updates
    • Added an explicit "Update Preview" button to apply changes when ready
    • Simplified the change handling logic to avoid excessive state updates
  2. QuickEditor.tsx:

    • Similar to MoiEditor, replaced real-time updates with an explicit update button
    • Simplified event handling to prevent focus issues
    • Separated content editing from preview updates
  3. MoiEditorModal.tsx:

    • Added local state to better manage content changes
    • Implemented content reference tracking to prevent loss of edits
    • Added safeguards to ensure latest content is always saved
    • Improved handling of editor type switching
    • Added sync points to ensure content is preserved during close/save operations
  4. App.tsx:

    • Added a reference-based approach to track the latest content reliably
    • Implemented more robust content change handling with proper state tracking
    • Fixed save functionality to use the most up-to-date content
    • Added console logs for debugging content flow

How to Test

  1. Open a val in the editor
  2. Try typing in any of the input fields - you should now be able to type smoothly without the cursor jumping or input freezing
  3. When you're ready to see your changes in the preview, click the "Update Preview" button
  4. Make several edits to different fields and save - all changes should be properly preserved
  5. Try editing, then directly clicking save without updating preview - changes should still be saved correctly

Original README Content

Tool to manage moi.md files for Val Town content.

Features:

  • Browse your vals
  • Create and edit moi.md files
  • Preview changes
  • Quickly update frontmatter
  • Save directly to your Val

What is moi.md?

The moi.md file is a special Markdown file that Val Town uses to display information about your val on the platform, especially for the build.moi page.

Usage:

  1. Add your Val Town API key
  2. Browse and select a val
  3. Create or edit the moi.md file
  4. Save your changes
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.