Skip to content

The Markdown editor is named and wired as though it could only ever serve the legal pages #41

Description

@thoda-dev

Roadmap

  • I read ROADMAP.md, including the "Deliberately out of scope" section

The problem

Nothing in the editor added by #38 is specific to a legal document. The toolbar is the set of Markdown marks that survive a round trip, the only extension on top of StarterKit is tables, and the stylesheet is plain prose: headings, lists, quotes, code, a scrolling table frame. Point it at any Markdown and it works.

Everything around it says otherwise. The component is LegalEditor.client.vue, its content class is legal-document and comes from a stylesheet of the same name, its toolbar tooltips live under admin.legal.editor.*, and several of its comments justify a decision by what a privacy policy happens to need. So the first other caller has to either inherit that vocabulary, which is then wrong in two places, or copy the component, which is worse.

This is not hypothetical: ROADMAP.md lists Rich text editing and markdown rendering for pastes under "Waiting on upstream". Whatever shape that eventually takes, it wants this component, and the rename is better done in a diff where nothing else moves than mixed into the one that adds a feature — a reviewer can check a rename by reading it, and cannot when it arrives wrapped around new behaviour.

Nothing is broken today. This is naming, and the cost of leaving it is paid later by whoever writes the second caller.

What you have in mind

  • LegalEditor.client.vueTextEditor.client.vue.
  • The legal-document class → rich-text, and assets/css/legal-document.cssrich-text.css. The class is shared with the published page, so LegalDocument.vue follows it.
  • The toolbar's 25 tooltips move from admin.legal.editor.* to a root editor.* block, next to common, since they are as cross-cutting as it is.
  • The comments that explain a choice by the content of a legal document get the same reasoning stated in terms of Markdown.

LegalDocument.vue and LegalTable.vue keep their names. They render the published legal page and are genuinely about that; only the class they carry becomes neutral.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions