--- name: triage-list description: Make a triage list. That is 100 or more candidates (articles to read, ideas to write about, topics, sources) plus a one-file web app for a phone that shows them one at a time, to keep (swipe right) or bin (swipe left). Use when someone has too much to choose from and wants to sort it quickly, or asks for a swipe app, a "Tinder for articles" or a list triage tool. --- # Triage list You help someone cut a long list down fast. You make two things, and you keep them apart: 1. **The list**: at least 100 candidates, as plain text. 2. **The app**: one HTML file. It shows the candidates one at a time on a phone. The person swipes right to keep one and left to bin it. The app does not contain the list. The person pastes a list into it, so the same app works again next week with a new list. If the person asks for only one of the two, make only that one. For the app alone you need no subject: write it at once, and ask nothing. ## Before you start For the list you need to know three things. If the person has told you, start. If not, ask for what is missing in one short message, then wait. - **The subject.** For example "trial by ordeal in medieval law". - **The purpose.** What will the kept items be used for? For example "sources for a 1,500-word essay". - **The kind of item.** Articles and books to read, ideas to write about, questions, examples ... ## Part 1: the list Write at least 110 items, because some will turn out to be the same. **Format.** Plain text inside a code block, one item on each line, the parts separated by ` | `: ``` title | note ``` - **title**: what the person judges. For a publication: `Author (year). Title`. For an idea: the idea in 12 words or fewer. - **note**: one sentence of 20 words or fewer. It says why this item could matter for the person's purpose. It is not a summary of the item. - **No link**, unless you opened the page in this conversation with a search tool, or the person gave you the address. Only then add it as a third part: `title | note | link`. A DOI or a web address written from memory is very often wrong, even when the publication is real. The app puts a search button on every item that has no link. - No numbers, bullets, headings or empty lines inside the block, and no `|` inside a title or a note. **Spread.** A good triage list is wide: binning is easy and keeping means something. Cover the subject from several sides, for example the standard works, recent work, opposing views, neighbouring fields, methods and primary sources. Do not list one item twice in different words. **Honesty about sources.** This matters more than the number. - If you can search the web or a library in this conversation, search, and list only what you found. - If you cannot search, say so in one sentence before the list: the items come from memory, and each one must be checked before it is used. No line has a link. List only publications you are confident exist. Never make up a title, an author, a year, a DOI or a web address to fill the list. - When you are not sure that a publication exists, do not list it as a publication. Turn it into something to search for, such as `Search: ordeals and the Fourth Lateran Council (1215)`. - If you run out of honest items before 110, say how many you have, and fill the rest with search ideas, not with invented publications. **Length.** A long answer can be cut off. Write 60 items, stop at the end of a line, close the code block, and write: `Say "more" for the next part.` Go on with the next 60 when asked. After the last part, say how many items there are, and write: `Say "app" when you want the app.` ## Part 2: the app Write one complete HTML file in a single code block. Leave nothing out and write no "..." placeholders: the person will save exactly what you write. The first line is ``, and the head has ``. Keep the file under 400 lines. **Rules for the file** 1. Everything is in the one file: HTML, CSS and JavaScript. No libraries, no fonts, no images, nothing loaded from the internet. It must work when the saved file is opened in a browser, and with no network. 2. It is made for a phone first: a viewport meta tag, no sideways scrolling at 360 px wide, text of at least 16 px, buttons at least 48 px high. It must work on a laptop too. 3. Put list text on the page with `textContent`, never with `innerHTML`. 4. It must also work in locked-down places: inside a chat's preview panel, and from a `data:` address on an iPhone or iPad. There `localStorage` can fail, `confirm()` and `alert()` do nothing, and the clipboard and downloads can be blocked. So never use `confirm()`, `alert()` or `prompt()`. Put every use of storage, the clipboard and downloads inside try/catch. When one of them fails, the app goes on. **Screen 1: paste the list.** A text box ("Your list, one item on each line") and a Start button. Read each line as `title | note | link`; the note and the link are optional. Skip empty lines, remove a bullet or a number from the start of a line, and drop an item whose title is already in the list. If the box is empty, say so and do not start. **Screen 2: one card at a time.** - The card shows the title in large type, the note under it, and a link that opens in a new tab. The link reads "Open the link" when the item has a link that starts with `http`. Otherwise it reads "Search for it" and goes to `https://scholar.google.com/scholar?q=` plus the title (use `encodeURIComponent`). - Above the card: a progress bar, the place ("Item 13 of 120"), and how many items are kept and binned so far. - There are three ways to decide, and all three are required: - **Drag** the card with a finger or the mouse (use pointer events). The card follows the finger and tilts, and a KEEP or BIN stamp fades in. Letting go more than about 100 px to the right keeps the item, to the left bins it; otherwise the card springs back. Set `touch-action: pan-y` on the card, so the page can still scroll up and down. - **Buttons** under the card, in this order: Bin, Undo, Keep. They are real `