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
Path 1: Copy a code sample
- A code block is in the previewSwRS-MDOKFSTUDIO-CODE-017 some blocks never get a buttonSwRS-MDOKFSTUDIO-CODE-017 · 3 tests the pointer over the block, or its keyboard focus, shows the Copy code button at its top-right corner
- The Copy code button is shownSwRS-MDOKFSTUDIO-CODE-019 the button never claims a copy that did not happenSwRS-MDOKFSTUDIO-CODE-019 an oversized or non-string copy request is refusedSwRS-MDOKFSTUDIO-CODE-019 · 3 tests the click puts the code lines on the clipboard and the button reads Copied
- The code is on the clipboard and the button reads 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