Github Red Dot

Highlight the pull request file you are reading and mark it viewed with ⏎ enter.

acme / widgetsDemo

Show the file at the reading line

Pull request #42 · 6 files changed

Press ⏎ to mark selected file as viewed

src/auth/session.ts+4−1

@@ -8,6 +8,9 @@ export function readSession()

export function readSession() {

− return null

+ const raw = sessionStorage.getItem("sid")

+ if (!raw) return null

+ return JSON.parse(raw) as Session

}

src/api/client.ts+3−2

@@ -21,7 +21,8 @@ async function request(path: string)

async function request(path: string) {

− const response = await fetch(path)

+ const response = await fetch(path, {

+ headers: { accept: "application/json" }

+ })

if (!response.ok) throw new Error(response.statusText)

− return response.text()

return response.json()

}

src/review/scroll.ts+5−0

@@ -1,4 +1,9 @@ export function onScroll(event: Event)

export function onScroll(event: Event) {

+ if (!(event.currentTarget instanceof HTMLElement)) return

+ const offset = event.currentTarget.scrollTop

+ const line = offset + 400

+ const next = files.find((file) => file.contains(line))

+ mark(next)

}

src/store/viewed.ts+4−1

@@ -14,5 +14,8 @@ export function markViewed(path: string)

export function markViewed(path: string) {

− viewed.add(path)

+ if (viewed.has(path)) return

+ viewed.add(path)

+ if (viewed.size === files.length) {

+ toast("All files viewed")

}

}

README.md+3−1

@@ -1,3 +1,5 @@

# widgets

−Review files from the top.

+The red mark follows the file you are reading.

+Press Enter to mark that file viewed.

+GitHub’s own Viewed checkbox stays in sync.

Light theme. The header says to press Enter to mark the file viewed.

Lightscreenshots/light/demo.png

Dark theme. The header says to press Enter to mark the file viewed.

Darkscreenshots/dark/demo.png

No more reaching for the “Viewed” checkbox

Tired of drawing triangles with your mouse while reviewing a pull request? This extension is right for you.

Viewedobsolete

Press Enter to mark that file viewed

The header on the page says “Press ⏎ to mark selected file as viewed.”Enter marks the file you are reading.

Enter already means “yes, and onward.” It does the same here: it confirms the file you are reading and moves you along.

The red dot mark moves with you

On Files changed, a red mark sits on the file you are reading. Scroll, or mark a file viewed, and it stays with you.

Good to know

created by Kacper Książek