Skip to content

Phase 7: Evaluate Editor migration strategy

Overview

Assess and potentially migrate custom editor support in internal/surveyext/surveyext.go (~242 lines).

Current Custom Features

The GLabEditor has specialized behavior:

  • Custom prompt: "(e) or Enter to launch nano, (s) or Esc to skip"
  • BlankAllowed flag for optional editing
  • Custom key handling (e=edit, s=skip, Esc=skip)
  • Respects GIT_EDITOR, VISUAL, EDITOR env vars
  • Cross-platform (Windows=notepad, Unix=nano)
  • UTF-8 BOM handling for Windows

Files Using Editor

  1. internal/cmdutils/cmdutils.go:155
  2. internal/utils/manip.go:29

Decision Points

Options: A. Migrate to huh editor (if feature-complete) B. Contribute missing features to huh upstream C. Keep surveyext temporarily alongside huh D. Build custom editor on huh primitives

Questions:

  • How critical is the custom editor behavior?
  • Can huh provide equivalent functionality?
  • Is editor usage frequent enough to justify custom implementation?
  • Would upstream huh accept our features?

Recommendation

  1. Assess huh's editor capabilities
  2. Test if huh.NewText() with external editor mode works
  3. If insufficient, evaluate:
    • Contribution upstream feasibility
    • Cost/benefit of custom implementation
    • Option to keep surveyext only for editor

Complexity: 8/10 Effort: 3-5 days (investigation + implementation)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information