Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ai/chatgpt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [1.1.0] - 2026-11-10

### Added

- **Tutorial:** guided tours for every feature, started from the “?” button in the header.

### Fixed

- **Header buttons:** the settings, usage, download and help buttons now sit after ChatGPT's own buttons in the same row, with the same size and hover as the native ones.
- **Export:** finds the messages in the current ChatGPT layout and converts the new answer format (lists, tables, source chips, bold text) to Markdown.

## [1.0.0] - 2026-11-10

- Exporter built from the conversation view (Markdown, text, Word, PDF, JSON) and update checker.
Expand Down
1 change: 1 addition & 0 deletions ai/chatgpt/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Install a userscript manager, then the script, and open chatgpt.com. After the p
- **Settings** (sliders icon) in the header: turn modules on or off and open each module's own settings.
- **Usage** pill: your remaining reasoning messages. Hover for every limit, click for details.
- **Download** icon inside a conversation: exports it.
- A **?** button opens guided tours for each feature.
- Extra buttons next to the message box for big messages, prompts, batches, queue and recall.

Press Alt + Shift + P at any time to search every action.
2 changes: 1 addition & 1 deletion ai/chatgpt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nolly/ai-chatgpt",
"version": "1.0.0",
"version": "1.1.0",
"private": true,
"type": "module",
"license": "PolyForm-Strict-1.0.0",
Expand Down
14 changes: 8 additions & 6 deletions ai/chatgpt/src/header-tools.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { findHeaderSlot } from './locate'

const ORDER = ['settings', 'usage', 'export'] as const
const ORDER = ['settings', 'usage', 'export', 'help'] as const

export type ToolId = (typeof ORDER)[number]

Expand All @@ -13,11 +13,13 @@ export const placeTool = (button: HTMLElement, id: ToolId): boolean => {
const row = toolRow()
if (!row) return false
button.dataset['bcTool'] = id
if (button.parentElement !== row) row.prepend(button)
if (button.parentElement !== row) row.append(button)
const ours = ORDER.flatMap((name) => row.querySelector<HTMLElement>(`:scope > [data-bc-tool="${name}"]`) ?? [])
ours.forEach((element, index) => {
const expected = row.children[index] ?? null
if (expected !== element) row.insertBefore(element, expected)
})
let cursor: Element | null = [...row.children].filter((child) => !child.hasAttribute('data-bc-tool')).at(-1) ?? null
for (const element of ours) {
const wanted: Element | null = cursor ? cursor.nextElementSibling : row.firstElementChild
if (wanted !== element) row.insertBefore(element, wanted)
cursor = element
}
return true
}
4 changes: 4 additions & 0 deletions ai/chatgpt/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
PromptQueueFeature,
RecallFeature,
SelectionToolbarFeature,
TutorialFeature,
UpdatesFeature,
configurePlatform,
configureUi,
Expand All @@ -32,6 +33,7 @@ import { SLUG, URLS } from './repo'
import { session } from './runtime'
import { storage } from './storage'
import { threadOf } from './threads'
import { tutorialSource } from './tutorial-source'
import { installTheme } from './theme'

const onSend = (listener: () => void): (() => void) =>
Expand Down Expand Up @@ -60,6 +62,7 @@ whenReady(() => {
promptsUrl: URLS.prompts,
exporter: exportSource,
release: { name: 'Better ChatGPT', slug: SLUG, version: __VERSION__, metaUrl: URLS.meta, installUrl: URLS.install, releasesUrl: URLS.releases },
tutorial: tutorialSource,
codeBlockRoot: (pre) => pre.closest<HTMLElement>('[data-chatgpt-copy-code]') ?? pre.closest<HTMLElement>('[data-code-block]')
})

Expand Down Expand Up @@ -98,6 +101,7 @@ whenReady(() => {
.register((context) => new ExporterFeature(context))
.register((context) => new UpdatesFeature(context))
.register((context) => new UsageFeature(context))
.register((context) => new TutorialFeature(context))
.register((context) => new DiagnosticsFeature(context))
.start()
})
14 changes: 7 additions & 7 deletions ai/chatgpt/src/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const SELECTORS = {
composerForm: 'form:has(fieldset)',
editable: '[contenteditable="true"], textarea',
codeSurface: '[data-code-block], .cm-editor',
attach: '[data-composer-navigation-target="add-context"]',
modeToggle: 'button[aria-pressed]',
headerSlot: '[data-app-shell-header-obstacle="true"]',
sidebar: 'aside'
composerForm: 'form:has(fieldset)',
editable: '[contenteditable="true"], textarea',
codeSurface: '[data-code-block], .cm-editor',
attach: '[data-composer-navigation-target="add-context"]',
modeToggle: 'button[aria-pressed]',
headerSlot: '[data-app-shell-main-titlebar="true"] [data-app-shell-header-obstacle="true"]',
sidebar: 'aside'
} as const

export const STOP_LABEL = /\b(stop|arr[eê]t\w*|stopp\w*|detener|parar)\b/i
Expand Down
128 changes: 128 additions & 0 deletions ai/chatgpt/src/tours.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import { loadPromptShortcut, loadShortcut, tour } from '@nolly/ai'
import type { Tour } from '@nolly/ai'
import { composerKit } from './kit'

const { click, closed, escape, find, info, inside, point, press, wait } = tour

const dialog = (name: string): string => `better-chatgpt-${name}`
const tool = (name: string) => find(`[data-bc-tool="${name}"]`)

const gettingStarted: Tour = {
id: 'start',
title: 'Getting started',
summary: 'The header buttons and where everything lives.',
steps: [
info('Welcome to Better ChatGPT', 'This tour shows where everything is. You can exit any time and restart it from the “?” button in the header.'),
point('Settings', 'Turn modules on or off and open each module’s own settings.', tool('settings')),
point('Usage', 'Shows what you have left of the limit you chose. Hover for every limit and when it resets, click for details.', tool('usage')),
point('Export', 'Appears inside a conversation. Exports it as Markdown, Word, PDF, plain text or JSON.', tool('export')),
point('Message box buttons', 'These buttons sit next to the message box. This one configures how Enter works: Enter adds a new line and a shortcut sends.', find('.bp-config-button')),
point('Big messages', 'Paste very long text here. It is only split when it is too big for one message.', find('.bp-cb-big')),
point('Prompt library', 'Insert saved and community prompts. The shortcut works from anywhere.', find('.bp-cb-prompts')),
point('Batch runner', 'Send the same kind of message for a whole list of items.', find('.bp-cb-batch')),
press('Command palette', 'Every action in Better ChatGPT is searchable. Try opening it now.', () => loadShortcut()),
press('Close it again', 'Press Escape to close the palette.', escape),
info('That’s it', 'Open “?” any time to run a focused tour on one feature.')
]
}

const usage: Tour = {
id: 'usage',
title: 'Usage and limits',
summary: 'What you have left, and when it comes back.',
steps: [
point('The usage pill', 'It shows the limit you picked. It turns yellow when only a couple are left and red at zero.', tool('usage')),
click('Open the details', 'Click it to see every limit with its reset time, your plan and the rolling window.', tool('usage')),
wait('Close the dialog', 'Use Close when you are done.', closed(dialog('usage-dialog'))),
info('Choose what it shows', 'Open Settings, then Usage Status, then “Badge Shows” to switch the pill to another limit.')
]
}

const longMessages: Tour = {
id: 'long',
title: 'Writing long messages',
summary: 'The size meter, big-message box and automatic splitting.',
steps: [
point('The message box', 'While you type, a small chip above it shows characters and estimated tokens against the limit.', () => composerKit.findComposer()),
point('Size meter', 'It turns yellow near the limit and red above it, with a Split button. It only appears once there is text in the box.', find('.bp-draft-meter')),
click('Open the big message box', 'Click to open it. You can paste any amount of text.', find('.bp-cb-big')),
point('Paste here', 'Paste or write the message. The line under it says whether it fits in one message.', inside(dialog('bigtext-dialog'), 'textarea')),
point('Too big?', 'If it is too big, you get a preview of the parts and a choice: send them in order, or attach as a file.', inside(dialog('bigtext-dialog'), '.bp-split-summary')),
wait('Close the box', 'Use Cancel when you are done.', closed(dialog('bigtext-dialog')))
]
}

const prompts: Tour = {
id: 'prompts',
title: 'Prompts and placeholders',
summary: 'Saved prompts, community prompts and the fill-in form.',
steps: [
click('Open the prompt library', 'Click the book button, or use the shortcut.', find('.bp-cb-prompts')),
point('Search', 'Type to search your prompts and community prompts from GitHub. Enter inserts the highlighted one.', inside(dialog('prompt-picker'), '.bp-palette-input')),
point('Community prompts', 'Prompts marked “Community” come from the shared library. Press Save to copy one into your own list.', inside(dialog('prompt-picker'), '.bp-palette-list')),
info('Placeholders', 'Prompts can contain blanks like {{topic}} or {{item}}. When you insert one, a form asks what to put in each blank.'),
press('Close the picker', 'Press Escape to close it.', escape),
press('The shortcut', 'You can also open the library without the mouse.', () => loadPromptShortcut()),
press('Close again', 'Press Escape.', escape)
]
}

const batch: Tour = {
id: 'batch',
title: 'Batch Runner',
summary: 'Send one message per list item, automatically.',
steps: [
info('What it does', 'Imagine researching ten companies. Instead of ten copy-pastes, you write the message once and paste the list.'),
click('Open the Batch Runner', 'Click the layers button.', find('.bp-cb-batch')),
point('Step 1: the message', 'Write it once and put {{item}} where each list entry goes. The example buttons fill everything in for you.', inside(dialog('batch-dialog'), '[data-tour="batch-template"]')),
point('Step 2: the list', 'One entry per line. Each line becomes one message.', inside(dialog('batch-dialog'), '[data-tour="batch-items"]')),
point('Step 3: review', 'The first messages are previewed before anything is sent, so you confirm before starting.', inside(dialog('batch-dialog'), '[data-tour="batch-review"]')),
info('While it runs', 'A card appears in the corner with Pause and Cancel. If you reload the page, it offers to resume.'),
wait('Close the dialog', 'Use Cancel to leave without starting.', closed(dialog('batch-dialog')))
]
}

const codeBlocks: Tour = {
id: 'code',
title: 'Code blocks',
summary: 'Language badges, folding, wrapping and copying.',
steps: [
point('Enhanced code', 'When an answer finishes, its code blocks are replaced with these. Ask for some code if you do not see one.', find('.bp-code')),
point('Toolbar', 'Wrap long lines, toggle line numbers, fold long code, copy, or download as a file.', find('.bp-code-actions')),
info('Selecting and copying', 'You can select part of a block and copy it. Indentation and line breaks are kept exactly.')
]
}

const exporting: Tour = {
id: 'export',
title: 'Exporting a conversation',
summary: 'Markdown, Word, PDF, plain text and JSON.',
steps: [
click('Open the exporter', 'Click the download button inside a conversation.', tool('export')),
point('Pick a format', 'Markdown, plain text, Word and PDF are generated right here. JSON lists each message with its role.', inside(dialog('export-dialog'), '.bp-stack')),
wait('Close the dialog', 'Use Close when you are done.', closed(dialog('export-dialog')))
]
}

const selection: Tour = {
id: 'selection',
title: 'Selection toolbar',
summary: 'Ask about any text you highlight.',
steps: [
wait('Select some text', 'Highlight a sentence in any answer.', () => document.querySelector('.bp-sel[data-visible="true"]') !== null, 'Select a few words in an answer.'),
point('Quick actions', 'Ask, Explain, Summarize, Fact-check or Quote. Hold Shift while clicking to send immediately.', find('.bp-sel[data-visible="true"]'))
]
}

const palette: Tour = {
id: 'palette',
title: 'Command palette',
summary: 'Search and run any action from the keyboard.',
steps: [
press('Open it', 'Use your command palette shortcut.', () => loadShortcut()),
point('Type to search', 'Try “export”, “usage” or “split”. Arrow keys move, Enter runs.', inside(dialog('palette'), '.bp-palette-input')),
press('Close it', 'Press Escape.', escape)
]
}

export const TOURS: readonly Tour[] = [gettingStarted, usage, longMessages, prompts, batch, codeBlocks, exporting, selection, palette]
12 changes: 12 additions & 0 deletions ai/chatgpt/src/tutorial-source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { TutorialSource } from '@nolly/ai'
import { ICON_BUTTON_CLASS } from './header-style'
import { placeTool } from './header-tools'
import { TOURS } from './tours'

export const tutorialSource: TutorialSource = {
tours: TOURS,
place: (button) => {
if (button.className !== ICON_BUTTON_CLASS) button.className = ICON_BUTTON_CLASS
return placeTool(button, 'help')
}
}
1 change: 1 addition & 0 deletions ai/perplexity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ All notable changes to Better Perplexity are documented here. The format follows
- Internal: Code Block Pro now comes from the shared package.
- Internal: Batch Runner, Selection Toolbar and Max Width now come from the shared package.
- Internal: Exporter and Update checker now come from the shared package.
- Internal: Tutorial engine and styles now come from the shared package.
- Internal: one shared settings dialog; Batch Runner uses the shared prompt sender.
- Fixed: the batch runner was registered twice.

Expand Down
9 changes: 5 additions & 4 deletions ai/perplexity/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BatchRunnerFeature, CodeBlocksFeature, CommandPaletteFeature, DraftGuardFeature, EnterAsNewlineFeature, ExporterFeature, MaxWidthFeature, MessageSplitterFeature, PromptLibraryFeature, PromptQueueFeature, RecallFeature, SelectionToolbarFeature, UpdatesFeature, configurePlatform, configureUi, loadSplitterSettings } from '@nolly/ai'
import { BatchRunnerFeature, CodeBlocksFeature, CommandPaletteFeature, DraftGuardFeature, EnterAsNewlineFeature, ExporterFeature, MaxWidthFeature, MessageSplitterFeature, PromptLibraryFeature, PromptQueueFeature, RecallFeature, SelectionToolbarFeature, TutorialFeature, UpdatesFeature, configurePlatform, configureUi, loadSplitterSettings } from '@nolly/ai'
import { App } from './core/app'
import { composerKit, findComposer, writeComposer } from './core/composer'
import { sendPrompt } from './core/dispatch'
Expand All @@ -13,7 +13,7 @@ import { exportSource } from './export-source'
import { findComposerActions } from './locate'
import { GlobalSettingsModule } from './modules/global-settings'
import { ALWAYS_HIDDEN, LAYOUT_RULES, RIGHT_SIDEBAR } from './modules/max-width/rules'
import { TutorialModule } from './modules/tutorial'
import { tutorialSource } from './tutorial-source'
import { UsageStatusModule } from './modules/usage-status'
import { URLS } from './repo'

Expand All @@ -31,7 +31,8 @@ configurePlatform({
threadOf,
promptsUrl: URLS.prompts,
exporter: exportSource,
release: { name: 'Better Perplexity', slug: 'better-perplexity', version: __VERSION__, metaUrl: URLS.meta, installUrl: URLS.install, releasesUrl: URLS.releases }
release: { name: 'Better Perplexity', slug: 'better-perplexity', version: __VERSION__, metaUrl: URLS.meta, installUrl: URLS.install, releasesUrl: URLS.releases },
tutorial: tutorialSource
})
fetchSpy.install()

Expand All @@ -48,7 +49,7 @@ new App()
.register((context) => new ExporterFeature(context))
.register((context) => new UsageStatusModule(context))
.register((context) => new GlobalSettingsModule(context))
.register((context) => new TutorialModule(context))
.register((context) => new TutorialFeature(context))
.register((context) => new UpdatesFeature(context))
.register((context) => new PromptQueueFeature(context))
.register((context) => new RecallFeature(context))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
import { findComposer } from '../../core/composer'
import { loadPromptShortcut, loadShortcut, type Shortcut } from '@nolly/ai'
import type { Step } from './engine'
import { findComposer } from './core/composer'
import { loadPromptShortcut, loadShortcut, tour, type Tour } from '@nolly/ai'

export interface Tour {
id: string
title: string
summary: string
steps: readonly Step[]
}

const find = (selector: string) => (): HTMLElement | null => document.querySelector<HTMLElement>(selector)
const info = (title: string, body: string): Step => ({ title, body })
const point = (title: string, body: string, target: () => HTMLElement | null): Step => ({ title, body, target })
const click = (title: string, body: string, target: () => HTMLElement | null): Step => ({ title, body, target, kind: 'click' })
const press = (title: string, body: string, shortcut: () => Shortcut): Step => ({ title, body, kind: 'key', shortcut })
const wait = (title: string, body: string, until: () => boolean, hint?: string): Step => ({ title, body, kind: 'wait', until, hint })
const escape: () => Shortcut = () => ({ ctrl: false, alt: false, shift: false, meta: false, code: 'Escape' })
const closed = (id: string) => (): boolean => !document.getElementById(id)
const { click, closed, escape, find, info, inside, point, press, wait } = tour

const DIALOG = {
big: 'better-perplexity-bigtext-dialog',
Expand All @@ -26,7 +11,6 @@ const DIALOG = {
palette: 'better-perplexity-palette'
} as const

const inside = (id: string, selector: string) => find(`#${id} ${selector}`)

const gettingStarted: Tour = {
id: 'start',
Expand Down Expand Up @@ -136,10 +120,3 @@ const palette: Tour = {
}

export const TOURS: readonly Tour[] = [gettingStarted, longMessages, prompts, batch, codeBlocks, exporting, selection, palette]

export const FULL_TOUR: Tour = {
id: 'all',
title: 'Full tour',
summary: 'Everything above, in order.',
steps: TOURS.flatMap((tour) => tour.steps)
}
13 changes: 13 additions & 0 deletions ai/perplexity/src/tutorial-source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { TutorialSource } from '@nolly/ai'
import { TOURS } from './tours'

export const tutorialSource: TutorialSource = {
tours: TOURS,
place: (button) => {
const indicator = document.querySelector<HTMLElement>('.bp-usage-indicator')
if (!indicator) return false
const anchor = indicator.querySelector('.bp-export') ?? indicator.querySelector('.bp-gear')
if (button.parentElement !== indicator || (anchor && button.nextElementSibling !== anchor)) indicator.insertBefore(button, anchor)
return true
}
}
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions core/ai/src/features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ export { CodeBlocksFeature } from './code-blocks'
export { ExporterFeature } from './exporter'
export { UpdatesFeature } from './updates'
export type { ExportSource } from './exporter/source'
export { TutorialFeature } from './tutorial'
export type { Step } from './tutorial/engine'
export type { Tour, TutorialSource } from './tutorial/source'
export * as tour from './tutorial/steps'
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { createElement } from '@nolly/core'
import { markUi } from '../../core/dom'
import { createButton, ensureUiStyles, formatShortcut, matchesShortcut, type Shortcut } from '@nolly/ai'
import { markUi } from '../../ui/config'
import { createButton } from '../../ui/controls'
import { ensureUiStyles } from '../../ui/styles'
import { formatShortcut, matchesShortcut } from '../command-palette/shortcut'
import type { Shortcut } from '../command-palette/shortcut'
import { ensureTourStyles } from './styles'

export interface Step {
Expand Down
Loading
Loading