Skip to content

Refactor: proper repo structure and pagination#2

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-repo-structure-and-ui
Draft

Refactor: proper repo structure and pagination#2
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-repo-structure-and-ui

Conversation

Copy link

Copilot AI commented Mar 3, 2026

Single monolithic index.php with no pagination (past pastes beyond 20 were invisible). Reorganized into a maintainable multi-file structure and wired up paginated paste listing, while preserving the original UI look and feel.

Structure

index.php is now a ~110-line router/data-fetcher. Logic lives in purpose-scoped files:

config/config.php       # DB credentials & constants
src/db.php              # PDO factory + schema init
src/helpers.php         # slug/token gen, fetch_pastes(), count_pastes()
src/actions.php         # POST handlers (create, delete, comment, raw)
views/layout_head.php   # <head> + header
views/layout_foot.php   # footer + global JS
views/home.php          # create form
views/paste_view.php    # paste + comments + delete
views/sidebar.php       # paginated paste list

Pagination

New count_pastes() + fetch_pastes($pdo, $page, $perPage) helpers back a paginated sidebar — PASTES_PER_PAGE = 15 (configurable in config/config.php). Uses ?p=N query param with Prev/Next controls and a Showing X of Y counter.

UI

The original UI design is preserved — same bg-slate-50 body, flat header, grid grid-cols-1 lg:grid-cols-3 layout, rounded-lg shadow-sm border white cards, and original indigo/green/red button colours. The only visible change to the sidebar is the addition of the pagination Prev/Next controls.

Docs

Added README.md covering installation, full configuration reference table, usage, and security notes.

Pastebin UI


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

… add pagination, redesign UI

Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor repository structure and update frontend responsiveness Refactor: proper repo structure, pagination, and responsive UI Mar 3, 2026
@druvx13
Copy link
Owner

druvx13 commented Mar 3, 2026

@copilot you didn't have to change the front ui, revert it back! you may format the texts, add new things and do anything that complements the UI but not change the whole UI that it differs completely from it's predecessor, in colour, layout, etc etc.

…yout, original card/button styles; keep pagination

Co-authored-by: druvx13 <131332414+druvx13@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 3, 2026

@copilot you didn't have to change the front ui, revert it back! you may format the texts, add new things and do anything that complements the UI but not change the whole UI that i...

Done — reverted in 06e3abf. The views now use the same layout and colours as the original: bg-slate-50 body, flat header with subtitle, grid grid-cols-1 lg:grid-cols-3 card layout, rounded-lg shadow-sm border white cards, and the original indigo/green/red buttons. The only visible addition to the sidebar is the pagination Prev/Next controls and "Showing X of Y" count.

UI screenshot

Copilot AI changed the title Refactor: proper repo structure, pagination, and responsive UI Refactor: proper repo structure and pagination Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants