Skip to content

Improve styling of Step Recorder button - #111

Merged
feedthejim merged 1 commit into
mainfrom
make-nicer-record-button
Feb 19, 2021
Merged

feedthejim merged 1 commit into
mainfrom
make-nicer-record-button

Conversation

@trueadm

@trueadm trueadm commented Feb 19, 2021

Copy link
Copy Markdown
Collaborator

This makes the button a bit nicer and moves it to the bottom right of the screen. It switches to a red colour when enabled like the chrome dev tools record button does.

Screenshot 2021-02-19 at 14 21 42

@trueadm
trueadm requested a review from feedthejim February 19, 2021 14:22
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 19, 2021
@feedthejim
feedthejim merged commit 080481e into main Feb 19, 2021
@trueadm
trueadm deleted the make-nicer-record-button branch February 19, 2021 14:24
acywatson pushed a commit that referenced this pull request Apr 9, 2022
etrepum pushed a commit to etrepum/lexical that referenced this pull request Oct 31, 2026
…backslash before raw output, and keep all look-ahead text matches per line

## Description

- Emails: a reference that export writes inside an email (`[email protected]&meta#111;**“x”**`) cut `@lexical/mdast`'s link short at the reference, since micromark finds an email only in the text as written. The `@` of such an email now goes out as `@` too, and `@lexical/mdast` links the whole decoded address, as cmark-gfm does.
- Backslash before raw output: with `shouldPreserveNewLines`, a raw backslash that ends text right before a code span or other raw output starting with ASCII punctuation or a line ending escaped it, so `a\` then code `x` came back as plain text. It now goes out as `&meta#92;`, as it already did before a marker.
- Text matches: import kept the first match per line only for the link syntax, so any other text-match transformer searched what was left of a long line again after each match. It now keeps the match of every transformer whose pattern does not look behind (no `^`, word boundary or lookbehind outside a character class, no `g`, `y` or `v` flag). One helper now shifts a kept match, and copies its named groups.

## Test plan

Command: `pnpm exec vitest run --project unit packages/lexical-markdown/src/__tests__/unit/LexicalMarkdown.test.ts`

### Before

With this commit's tests and the previous sources:

```
     × exports formatting beside an email, which both importers read back 20ms
     × exports formatting beside the start of an email, which both importers read back 2ms
     × exports formatting beside an email before a URL, which both importers read back 2ms
     × exports formatting beside a URL that holds an email, which both importers read back 1ms
     × keeps an email that holds a reference whole for @lexical/mdast 2ms
     × spoils a URL for the reference to a backslash before a code span 1ms
     × searches a line once for a text match that it does not hold 42ms
AssertionError: expected 5459 to be less than 520
```

### After

```
 Test Files  1 passed (1)
      Tests  778 passed (778)
```

On 30,000 random lines with custom text-match transformers, import gives the same result with the kept matches as with a fresh search after each match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
etrepum pushed a commit to etrepum/lexical that referenced this pull request Oct 31, 2026
…er a raw backslash, and walk only delimiter runs at a cut

## Description

- When an email holds a reference, export writes each of its `@` as `&#64;` so that micromark readers link the whole address. With `shouldPreserveNewLines`, a raw backslash before the `@` (`x\@b.co`) then escaped the reference's `&`, and the reference came back as literal text. Such an `@` is now left as it is.
- After each match, import looks past the delimiter run cut at each edge to read its flanking as it was in the whole line. It walked the run of whatever character sat at the cut, so a look-ahead text-match transformer matching a long run of one character piece by piece walked the rest of the run at every match. It now walks only a run of a code-span or format-tag character, which is the only kind whose far side is read.
- A comment in `LINK.replace` says that its text-before-the-opener branch serves custom callers, since import passes the label from its real opener.

## Test plan

Command: `pnpm exec vitest run --project unit packages/lexical-markdown/src/__tests__/unit/LexicalMarkdown.test.ts`

### Before

The new test with the export source of the previous commit:

```
     × writes no reference for an email's `@` after a raw backslash 18ms
AssertionError: expected 'x\&#64;b.c&meta#111;**“y”**' to be 'x\@b.c&meta#111;**“y”**' // Object.is equality
```

### After

```
 Test Files  1 passed (1)
      Tests  782 passed (782)
```

The run-walk change has no observable output; import was compared with the previous commit on 20,000 random lines with custom text-match transformers, with no differences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants