Files
MC-SurvivalWiki-Tips/tips/2026-06-16-004-editor-diff-view-before-publishing-edits.md
T

15 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Tip #4 — Diff-View before publishing edits
**Date:** 2026-06-16
**Category:** editor
**Source:** MC-Survival Wiki Daily Tip (backfilled from state.json)
## Diff-View before publishing edits
A diff view shows the editor exactly what changed in a recipe or tab before they save — old value strikethrough, new value highlighted, ideally inline rather than in a separate screen. It solves the problem that editors break things and do not realize it until a user reports it, by which point the bad version is already live. Player trust is the signal: a wiki that silently mutates content becomes untrusted fast, and even a cheap field-level diff (just 'name: Foo → Foo2') is enough to catch most accidental edits. It should never block saves — a confirmation modal is the right level of friction, not a hard gate.
## Implementation tips
1. Before save, fetch the current version, run a simple line-diff (jsdiff), show '' / '+' inline.
2. Don't block saves — just a confirmation modal: 'You changed 14 lines. Publish anyway?'
3. Cheap version: just show the changed field names with old→new values, not a full diff.