-
Notifications
You must be signed in to change notification settings - Fork 158
Poweredits by CoPilot #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zaxlofful
wants to merge
20
commits into
j0be:master
Choose a base branch
from
zaxlofful:poweredits
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
72a15ea
Initial plan
Copilot a53cbba
Add retry mechanism and skip user interactions setting
Copilot e9c4c54
Update version to 1.4.12 and finalize retry mechanism and skip intera…
Copilot 1a16a95
Add customizable retry mechanism and improve skip interactions behavior
Copilot b5952ba
Merge pull request #1 from ZaxLofful/copilot/fix-024f1fea-9bef-474d-b…
zaxlofful c9113e0
copilot instras
795955f
Initial plan
Copilot 9c43fef
Reorganize settings UI: separate Advanced Settings section above proc…
Copilot 95846fb
Instructions updates
d59ce9d
Merge pull request #2 from ZaxLofful/copilot/fix-318b6ab4-9934-4491-9…
zaxlofful c71799b
Updats to styles
8d6d6c0
Change version
453392a
Fix up strings
93b5480
show 2
cf458cd
Visual Test
7db049d
Show retries
24b36c3
Latest features require update version
54b42e7
update version to 1.5.1
cdbc802
set the box to the right length
32970ca
get rid of empty lines
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| ## PowerDeleteSuite — Copilot instructions | ||
|
|
||
| Short, focused notes to help an AI agent be immediately productive editing this repo. | ||
|
|
||
| 1) Big picture (what this code does) | ||
| - Single-page client-side bookmarklet / userscript that runs on old.reddit.com user overview. | ||
| - Main app is the global `pd` object in `powerdeletesuite.js`. There is no backend — all actions use Reddit JSON endpoints. | ||
| - UI markup is pulled at runtime from the subreddit wiki (`/r/PowerDeleteSuite/wiki/centralform.json`) and CSS is fetched from a raw JSON stylesheet URL. | ||
|
|
||
| 2) Key files to read first | ||
| - `powerdeletesuite.js` — the entire app (init, settings, endpoints, UI binders, filters, deletion/edit flows). | ||
| - `bookmarklet.js` and `powerdeletesuite.user.js` — wrappers / distribution formats (bookmarklet and userscript headers). | ||
| - `README.md` — install & usage instructions and the bookmarklet snippet users copy. | ||
| - `stylesheet.json` — repository copy of stylesheet data referenced by the app. | ||
|
|
||
| 3) Architecture & runtime patterns (concrete) | ||
| - Global object `pd` holds version (pd.version), bookmarklet version (pd.bookmarkver), config, endpoints, and runtime state. | ||
| - Uses jQuery (`$`) and `$.ajax(...).then(success, failure)` style rather than fetch/async/await. | ||
| - Reddit integration: calls to endpoints like `/user/<user>/comments/.json`, `/user/<user>/submitted/.json`, and `/search.json`. | ||
| - Settings and simple persistence: `localStorage` keys (e.g., `pd_ver`) and DOM parsing to extract Reddit modhash (`#config`). | ||
|
|
||
| 4) Developer workflows / testing (how to verify changes) | ||
| - No build step. Edit `powerdeletesuite.js` directly. | ||
| - Typical dev checklist when changing behavior: | ||
| - bump `pd.version` (and optionally `pd.bookmarkver` if bookmarklet string changes) | ||
| - update the README bookmarklet snippet if you changed the hosted/URL behavior | ||
| - smoke test on `https://old.reddit.com/u/me/overview` and exercise: load comments, run filter, attempt an edit and a delete flow | ||
|
|
||
| 5) Conventions and fragile/important details (do not change lightly) | ||
| - Identity check: `pd.checks.location()` compares DOM username text to header link. If you change selectors, tests will break. | ||
| - `pd.setup.applyCentral()` and `pd.setup.applyStyles()` fetch remote wiki and stylesheet JSON — UI is wiki-driven. Be aware of CORS and network failures. | ||
| - `pd.editStrings` is the in-file list of candidate edit texts; changing it affects edit behavior. | ||
| - Modhash extraction uses `#config` innerHTML parsing — this is brittle; prefer keeping the same extraction if possible. | ||
|
|
||
| 6) Helpful code examples (copy/paste pointers) | ||
| - Where endpoints are defined: in `powerdeletesuite.js` -> `pd.setup.basicSettings()` (look for `pd.endpoints`). | ||
| - Where UI is filled from the wiki: `pd.setup.applyCentral()`. | ||
| - Where CSS is injected: `pd.setup.applyStyles()` — it expects JSON with `data.stylesheet`. | ||
|
|
||
| 7) Common failure modes to watch for | ||
| - Empty or changed Reddit DOM selectors (username, #config) — will make the script refuse to run. | ||
| - Remote wiki or stylesheet fetch failures — script alerts on failure; add robust fallbacks if needed. | ||
| - Running on the wrong reddit domain (new reddit) — script explicitly checks for `old.reddit.com` style overview path. | ||
|
|
||
| 8) Pull request checklist for code changes | ||
| - Update `pd.version` for user-facing changes; bump `pd.bookmarkver` only when bookmarklet install string in `README.md` must change. | ||
| - Mention in PR description how you tested on `old.reddit.com/u/me/overview` and what flows you exercised (comments, submissions, search, edit+delete order). | ||
|
|
||
| If anything above is unclear or you'd like me to add quick local launch scripts (or a tiny test runner that simulates Reddit JSON responses), tell me which part to expand and I will update this file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.