Shows the working directory, git branch, model, and how much of the model's context window is used, as a coloured bar.
page-destroyer main | Opus 5 | ████████░░░░ 63% 630k/1M
- Green under 50 percent, yellow from 50, red from 80.
Generated with AI.
This guide describes a pattern for testing components that use React Suspense. Real-world Suspense boundaries resolve based on data fetches, lazy imports, or module loads. To test them deterministically we need to pause the suspended state, assert what the UI looks like while suspended, then resolve on demand and assert what it looks like after.
Do not let the suspended promise resolve on its own. Instead:
Generated by AI
Purpose: This document is a comprehensive reference for developers and AI assistants implementing CSS anchor-positioned popovers with arrows that automatically flip direction when using
position-try-fallbacks. It covers the core technique, theposition-areaproperty (including the critical span keywords), and complete working examples.
| // A simple script to clear all notifications in Slack. | |
| // 1. Open Slack on the web (not in the app as you cannot open the dev tools console) | |
| // 2. Copy paste into your console | |
| (async () => { | |
| function goToNotifications() { | |
| const button = document.querySelector('[data-qa="tab_rail_activity_button"]'); | |
| if (!(button instanceof HTMLElement)) { | |
| throw Error('Count not find activities button'); | |
| } | |
| button.click(); |
| // This file polyfills DOMRect | |
| // DOMRect is currently not polyfilled by jsdom | |
| (() => { | |
| if (typeof window === 'undefined') { | |
| return; | |
| } | |
| if (window.DOMRect) { | |
| return; | |
| } |
| /* data-transfer-item-list.spec.ts */ | |
| import invariant from 'tiny-invariant'; | |
| test('add(data, format) should add a string item', done => { | |
| const list = new DataTransferItemList(); | |
| list.add('Hello world', 'text/plain'); | |
| const item: DataTransferItem = list[0]; |
| // This file polyfills DragEvent for jsdom | |
| // https://github.com/jsdom/jsdom/issues/2913 | |
| // This file is in JS rather than TS, as our jsdom setup files currently need to be in JS | |
| // Good news: DragEvents are almost the same as MouseEvents | |
| (() => { | |
| if (typeof window === 'undefined') { | |
| return; | |
| } |
| function add(a: number, b: number): number { | |
| return a + b; | |
| } | |
| type MyParameters<TFunc extends (...args: any[]) => unknown> = TFunc extends ( | |
| ...args: infer TArgs | |
| ) => unknown | |
| ? TArgs | |
| : unknown; |
| // This file polyfills `Element.prototype.scrollBy` | |
| // scrollBy(x-coord, y-coord) | |
| // scrollBy(options) | |
| (() => { | |
| if (typeof Element === 'undefined') { | |
| return; | |
| } | |
| if (typeof Element.prototype.scrollBy !== 'undefined') { | |
| return; | |
| } |
| const interactions: number[][] = []; | |
| function sum(values: number[]) { | |
| return values.reduce((acc, current) => acc + current, 0); | |
| } | |
| function average(values: number[]): number { | |
| if (!values.length) { | |
| return 0; | |
| } |