Markdown OKF-Schema Studio

Use case StRS-MDOKFSTUDIO-CODE-004

A reader copies the exact code of a block

Readers need to reuse code samples without selecting text by hand, even in Restricted Mode.

Use case diagram

How it is split

This use case (StRS) is reached by one path (the coloured line). A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests.

path 1: Copy a code sample other outcomeone dot = one scenario checked: nominal boundary refusal
SwRS-MDOKFSTUDIO-CODE-017: A Copy code button appears on a hovered or focused code blockSwRS-MDOKFSTUDIO-CODE-0173 teststhe pointer over the block, or itskeyboard focus, shows the Copycode button at its top-rightcornerSwRS-MDOKFSTUDIO-CODE-019: The copy button copies the raw code and confirms itSwRS-MDOKFSTUDIO-CODE-0193 teststhe click puts the code lines onthe clipboard and the button readsCopiedSwRS-MDOKFSTUDIO-CODE-017: A Copy code button appears on a hovered or focused code blockSwRS-MDOKFSTUDIO-CODE-0173 testssome blocks never get abuttonSwRS-MDOKFSTUDIO-CODE-019: The copy button copies the raw code and confirms itSwRS-MDOKFSTUDIO-CODE-0193 teststhe button never claims a copy that did not happenSwRS-MDOKFSTUDIO-CODE-019: The copy button copies the raw code and confirms itSwRS-MDOKFSTUDIO-CODE-0193 testsan oversized or non-string copy request is refusedA code block is in the previewA code block is in thepreviewThe Copy code button is shownThe Copy code button isshownThe code is on the clipboard and the button reads CopiedThe code is on theclipboard and the buttonreads Copied

This map has 218 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 2 behaviours on the map are tested one by one, with 22 scenarios.

Behaviours of this use case

SwRS-MDOKFSTUDIO-CODE-017A Copy code button appears on a hovered or focused code block 3 testsSwRS-MDOKFSTUDIO-CODE-019The copy button copies the raw code and confirms it 3 tests
SwRS-MDOKFSTUDIO-CODE-018Hide the copy button below 30 px of visible block superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-020Confirm a copy with a Copied state for 1.5 seconds superseded superseded by SwRS-MDOKFSTUDIO-CODE-019 Markdown file
SwRS-MDOKFSTUDIO-CODE-021Keep focus and editors untouched by the copy button superseded superseded by SwRS-MDOKFSTUDIO-CODE-019 Markdown file
SwRS-MDOKFSTUDIO-CODE-022Offer no copy button for edited blocks, editors, diagram sources and blocks outside the content superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-023Hide the copy button on a click inside the block until the pointer moves superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-024Hide the copy button when a content patch updates the page superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-025Allow copying in read-only previews superseded superseded by SwRS-MDOKFSTUDIO-TRUST-005 Markdown file
SwRS-MDOKFSTUDIO-CODE-026An invalid or oversized copy request is refused superseded superseded by SwRS-MDOKFSTUDIO-CODE-019 Markdown file
SwRS-MDOKFSTUDIO-CODE-027Drop a copy request from a stale page superseded superseded by SwRS-MDOKFSTUDIO-TRUST-065 Markdown file
SwRS-MDOKFSTUDIO-CODE-029Hide the copy button when the pointer leaves the block superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-032Hide the copy button when scrolling stops outside the block superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-033Reposition the copy button on window resize superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-034Keep the copy button clear of the sticky band and toolbar superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-CODE-035Reset the Copied state when another block is hovered superseded superseded by SwRS-MDOKFSTUDIO-CODE-017 Markdown file
SwRS-MDOKFSTUDIO-TRUST-006A preview with restricted reads keeps every viewing action superseded superseded by SwRS-MDOKFSTUDIO-TRUST-005 Markdown file