Ghost: Koenig: Release Candidate version

Created on 10 May 2018  ยท  6Comments  ยท  Source: TryGhost/Ghost

This issue captures the tasks that we'll be working on for the third 6-week Koenig sprint. All work will take place on master and will be available in the weekly releases behind a labs flag for anyone wanting to help test. We will aim to announce "RC" status early July.

part of #9311 (Feature: Full Koenig editor)

I want to help test! How do I get started?

See the instructions here.

Sprint tasks

๐Ÿƒ = "in progress"
๐Ÿšข = "ready for next release" (releases are every Tuesday)

High Priority

Embed card

  • [ ] supported sources popup / help page

Mid priority

General editing

  • [ ] word and line delete doesn't work as expected (macOS)
  • [ ] selecting all text in link then typing to replace it only applies the link to the first typed character
  • [ ] word count / reading time display

Text expansions

  • [ ] text expansions do not work reliably if they wrap a soft break atom (inserted via Shift+Enter
  • [ ] --- divider text expansion between two image cards will select the next image card and add a trailing - to the caption

Embed card

  • [ ] ๐Ÿƒ lookup URL and create embed when pasting in blank section

Code card

  • [ ] language input/selection

    • [ ] expand text expansion to support language as per MD spec

Markdown card

  • [ ] stay in edit mode until any image uploads finish

    • or show upload progress placeholder in rendered mode

Image card

  • [ ] paste URL whilst selected = set src attribute
  • [ ] /image {url} support

Copy/paste

  • [ ] pasting text whilst some text is selected adds two undos to the undo stack, 1 that removes the selected text and a second that inserts the pasted text

Low priority

General editing

  • [ ] context menu could "hang" out from the left/right hard edges of the editor
  • [ ] mouseout of link hover tooltip could be refined so it's harder to accidentally lose the tooltip
  • [ ] ๐Ÿƒ use the '/' menu to make the card dropdown appear > choose a card with left-right arrows > mouseover on any of the non-selected cards > issue: two card types are 'hovered'
  • [ ] triple-click select causes toolbar to jump, it shows in the double-click select position before jumping to the final selection position
  • [ ] selecting a card whilst the (+) menu is open can place the (+) icon next to the card
  • [ ] after editing (or cancelling an edit of) a link the formatting toolbar doesn't re-appear until moving the mouse
  • [ ] changing the first section to a blockquote doesn't play well with the placeholder
    screen shot 2018-05-23 at 16 09 21

Embed card

  • [ ] embed size toolbar

Code card

  • [ ] add info message to use a Gist embed or similar over a certain number of lines

Image card

  • [ ] double click should place the focus in the Caption input field
  • [ ] show insert position indicator when drag & dropping images

Copy/paste

  • [ ] copy + paste on start of a blockquote (>) removes the blockquote

Stretch goals ๐Ÿ’ช

Embed card

  • [ ] opengraph embed fallback

X-Browser Issues

  • [ ] Firefox Up/Down arrow keys jump to top/bottom of doc when hitting a section boundary
  • [ ] Safari scrolls to the bottom when interacting with the link toolbar
  • [ ] Edge throws error when clicking outside of a card in edit mode

    • Unable to get property 'find' of undefined or null reference

  • [ ] Edge throws error when pasting images

    • Array.from: argument is not an Object

    • Unable to get property 'isBlank' of undefined or null reference

  • [ ] Edge does not stick MD card toolbar correctly
  • [ ] Safari shows double cursors at times
  • [ ] Safari has icon wiggle when hovering the toolbar
    safari-icon-wiggle

Known issues

These are issues that are related to underlying mobiledoc-kit or browser behaviour rather than our implementation. They are currently lower priority due to the cost/benefit for fixing but will likely be picked up in later cycles.

mobiledoc-kit

  • [ ] OS/browser spell checking underlines flicker whilst typing (https://github.com/bustle/mobiledoc-kit/issues/621)
  • [ ] undo causes the whole editor canvas to re-draw resulting in cards being torn down and recreated which can cause a lot of content height jumping with embed cards that reload their content
  • [ ] indentation doesn't work on lists
  • [ ] emoji's do not play nicely with the cursor. With ๐Ÿคท๐Ÿปโ€โ™‚๏ธ for example you need to press Left 6 times to move the cursor from one side to the other and Backspace will cycle through various forms of the emoji until it's finally deleted and doesn't always play nicely with the undo stack

    • Dropbox Paper converts all emoji's into an "atom" type element

    • Medium has similar struggles except it also doesn't render correctly

    • mobiledoc-kit issue

  • [ ] Edge Up and Down keys only allow movement within the current section

    • possibly a general contenteditable problem or something in mobiledoc-kit, same behaviour is visible on mobiledoc-kit demo

    • mobiledoc-kit issue

  • [ ] Grammarly causes high CPU usage

    • Grammarly is currently disabled in Koenig for this reason

Browser behaviour

  • [ ] text gets deselected when the link input field appears

    • NOTE: this is due to standard browser behaviour; as soon as the input field has focus it removes any other selection. Medium and Dropbox Paper have the same issue. Workaround could be to temporarily highlight the selected text some other way whilst the input is open but it could be tricky/brittle

  • [x] text selection indicator is too tall

    • browsers do not offer any control over this so we'll need to live with it for now

Completed tasks

General editing

  • [x] keep cursor on screen whilst typing
  • [x] clicking below the editor does not place the cursor at the bottom of the doc
  • [x] triple-click to select a paragraph then applying formatting can also affect the next paragraph
  • [x] double soft-tap via trackpad to select text does not always show the toolbar immediately
  • [x] clicking outside of the editor canvas does not exit card edit mode

    • (this behaviour was added as a quick workaround for cards losing edit mode when interacting with external elements such as the Unsplash popup)

  • [x] switching to a _heading_ should remove additional formatting (bold, italic etc. - not links)
  • [x] turning on 'Quote' or a heading should not deselect text (reversibility)
  • [x] empty HTML cards output undefined in the rendered output
  • [x] error is thrown from the plus menu mousemove handler when drag-selecting text
    image
  • [x] ~characters can be lost in the new->edit transition~ (unable to reproduce)
  • [x] opening the / menu then deleting the / doesn't close the menu
  • [x] difficult to remove blockquote and especially heading formatting from the first section using the keyboard
  • [x] using the keyboard to exit the top of a doc that has a card as the first section will leave the card selected
  • [x] using Escape to exit edit mode of a container card with a trailing card does not correctly select the card
  • [x] long URLs can cause the editor to become very wide (directly in the editor or through MD rendered mode)
  • [x] deselect cards when clicking outside of the editor
  • [x] PSM's meta/twitter/facebook previews currently expect a single markdown card as the first card and will throw an error if that's not present
  • [x] Enter in title when first section is a list throws an error
  • [x] Backspace to delete a list jumps cursor to bottom and creates empty paragraph
  • [x] save the post while an empty markdown card is in edit mode > navigate away from the editor > reopen the post for editing > an empty markdown card is left in the editor
  • [x] Up when cursor is at the beginning of a list item of a list section at the top of a post moves cursor to the title
  • [x] Backspace can start deleting whole words instead of individual characters

    • one reliable reproduction case is having Alt+Space mapped to Dash. The browser losing focus whilst the Alt key is pressed causes mobiledoc-kit to get stuck thinking the key is pressed so every Backspace is treated as Alt+Backspace

    • mobiledoc-kit issue + PR

  • [x] Enter on a blank list item should split the list the same way Backspace does
  • [x] links within markdown content should not be clickable (prevents accidentally leaving the editor)
  • [x] if mouse is used to select text and button is released outside the editor canvas at the bottom the selection is lost
  • [x] Enter behaviour is not always consistent when a card is selected depending on where the caret was placed with the mouse.
  • [x] lazy double click on cards should execute on mouse up (not mouse down)
  • [x] keyboard cursor movement should be disabled when the (+) menu is open or the cursor movement should close the menu

Text expansions (markdown formatting)

  • [x] > can not be used at the beginning of an existing paragraph to convert it to a block quote
  • [x] heading text expansions should be possible for existing text by adding #s at the beginning of the paragraph followed by a space

    • [x] if existing text is already a heading then the heading type (eg, h3->h1) should be changed

  • [x] -- within text should expand to ndash (โ€“)
  • [x] --- within text should expand to mdash (โ€”)
  • [x] super/sub-script is allowed (it can be added via copy/paste) but there is no markdown or keyboard shortcut for it

    • superscript expansion = 19^th^ (19th)

    • subscript expansion = H~2~O (H2O)

    • expansions will work similarly to inline code and strikethrough where Backspace at the end of the format will undo the expansion

  • [x] typing -, * or 1. at the beginning of a paragraph with text in it should convert it to the corresponding list
  • [x] typing -, * or 1. at the beginning of a list item of the alternate type should toggle the type of list

Embed card

  • [x] embed card

    • [x] text field in "blank"/edit state

    • [x] oembed URL lookup and API request to fetch embed HTML

    • [x] loading spinner

    • [x] error handling

    • [x] caption support

  • [x] add embed card entries to (+) and /-menus
  • [x] /embed {url} support
  • [x] FB video embed doesn't render in the editor if one already exists
  • [x] auto-focus in the URL field after a new Embed card is added

Code card

  • [x] CodeMirror based text input
  • [x] triple-backtick expansion
  • [x] remove from card menu

Image card

  • [x] create image cards for dropped images
  • [x] create image cards for pasted images

    • browser support for this varies (tested on macOS):



      • Chrome: will only paste the first image file


      • Firefox: won't paste any image files


      • Safari: will paste all image files



  • [x] hide size buttons until an image is uploaded
  • [x] caption placeholder should be removed if the focus is put in it
  • [x] place dropped images in the cursor position
  • [x] support drag-n-drop to upload image in empty state
  • [x] replace image if an image is dropped on an existing image card

Copy/paste

  • [x] investigate + fix undo stack problem with cards

    • our cursorDidChange is somehow causing the edit stack to break when a card gets selected after a paste that creates cards. A workaround is in place to avoid immediate breakage when the last section pasted is a card by inserting a blank paragraph at the end, however the undo stack still breaks as soon as a card gets selected

  • [x] pasting inside a container card (eg, markdown) will trigger our paste handler and insert content twice, once inside the container and once outside the container
  • [x] parse plaintext pastes with our markdown renderer before passing off to our HTML paste handling then mobiledoc-kit's default paste behaviour
  • [x] standardise HTML on paste

    • <b> -> <strong>

    • <i> -> <em>

  • [x] convert <img>'s to image cards
  • [x] convert <hr>'s to divider cards
  • [x] convert <pre><code> to code cards
  • [x] convert <br>'s to soft-break atoms
  • [x] convert unknown HTML into a HTML card this isn't particularly feasible with mobiledoc-kit as it stands. We should investigate specific instances where we want to create an HTML card to see if we can cater for those
  • [x] copy/pasting top-level <p> tags bunches text

    • this is a result of us wrapping any rich-text pastes in <div>...</div> before passing to mobiledoc-kit's parsers

    • mobiledoc-kit issue + PR

General design

  • [x] Night Shift support
  • [x] toolbar โ–ผ is mis-aligned in Night Shift
    screen shot 2018-06-12 at 16 32 32

x-Browser support

  • [x] Firefox/Safari don't allow text in image captions or the embed input to be selected or the caret to be moved within the caption input using arrow keys

    • setting contenteditable="false" on the editor element allows arrow keys to work in both browsers and Safari allows full text input and selection

    • user-select: none styling on the input fields is the remaining issue in FF

  • [x] Safari throws IndexSizeError: The index is not in the allowed range. from the _scrollCursorIntoView method when typing with an image card selected
  • [x] Firefox Up/Down arrow keys whilst an image card is selected can add "ArrowUp/Down" to the caption
admin client editor

Most helpful comment

1.24.0 has been released and includes a couple of new Koenig features:

  • โœจ Drag & drop image files onto the editor to create image cards + upload
  • โœจ ^superscript^ and ~subscript~ text expansion support
    sup-sub

All 6 comments

1.23.1 has just been released with the next iteration of the Koenig beta

  • โœจ Create image cards when pasting image files. Browser support for this varies due to differing security implementations:

    • Chrome: only the 1st image will be pasted if multiple images are pasted

    • Safari: all images will be pasted

    • Firefox: no support

    • Edge: not tested (please let us know if you try it)

  • โœจ Keep cursor on screen when typing or moving via keyboard
  • โœจ Allow > expansion to convert existing text to blockquotes
  • ๐ŸŽจ Ease removal of formatting on first section
  • ๐ŸŽจ Exit edit mode of a card when clicking outside the card
  • ๐Ÿ› Fixed creation of unnecessary undo states
  • ๐Ÿ› Fixed pasting content into a container card (HTML, markdown, code)

Self-hosters can upgrade via ghost update (1.8.0 of Ghost-CLI was released earlier, it's worth updating that too whilst you're there :smile:)

Ghost(pro) blogs will be updated in the next few days.

Please reply to the beta announcement post on our forum if you run into any issues, thanks! ๐Ÿ˜„

1.24.0 has been released and includes a couple of new Koenig features:

  • โœจ Drag & drop image files onto the editor to create image cards + upload
  • โœจ ^superscript^ and ~subscript~ text expansion support
    sup-sub

1.24.3 has been released with new Koenig features, bug fixes, and improvements:

  • โœจ Embed card
  • โœจ Night Shift support
  • ๐Ÿ› Fixed scroll jump when card is selected
  • ๐Ÿ› Disable Grammarly to fix high CPU usage

1.24.4 has been released with a number of Koenig updates:

  • โœจ Ships with Casper 2.3.3 which adds support for the Embed card
  • ๐Ÿ› Bugs arising from embed scripts should be reduced by a new in-editor rendering mechanism. Please let us know on the forum if you run into issues

1.24.5 has been released containing new Koenig features and bug fixes:

  • โœจ Toggle list types using MD list syntax

    • type -, *, 1, or 1. followed by a space at the beginning of any list item to change the type of list

  • โœจ Toggle existing paragraphs into lists using MD list syntax

    • type -, *, 1, or 1. followed by a space at the beginning of a paragraph to convert it to a list item

  • ๐ŸŽจ Split list when pressing Enter on a blank list item
  • ๐Ÿ› Fixed placement of dropped images
  • ๐Ÿ› Fixed backspace deleting words
  • ๐Ÿ› Fixed collapsed paragraphs when pasting rich-text (eg, copy/paste content from a website)
  • ๐Ÿ› Fixed cursor jumping to title when pressing Up/Left on list items

The RC phase of Koenig development has drawn to a close, we're now pushing for final release.

On the Koenig final issue you can see the tasks that have been prioritised for the initial release. We'll be picking up any other unfinished tasks from this issue after the final release and will move them to new issues as appropriate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevinansfield picture kevinansfield  ยท  3Comments

kirrg001 picture kirrg001  ยท  3Comments

jaguart picture jaguart  ยท  3Comments

rishabhgrg picture rishabhgrg  ยท  3Comments

fueko picture fueko  ยท  3Comments