diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..63774b0f6 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,127 @@ +# Copilot Instructions — Adminer UI Modernization + +## Project Goal + +This project is a fork of Adminer. The goal is to modernize the user interface while preserving Adminer's existing behavior, database support, portability, and lightweight nature. + +The main objective is **UI modernization only**, not a full rewrite. + +Modernization should improve: + +- Visual design +- Layout clarity +- Spacing and typography +- Tables +- Forms +- Buttons +- Navigation +- Login screen +- Responsive behavior +- Optional dark mode support + +The project must continue to behave like Adminer. + +--- + +## Important Context + +Adminer is a legacy-style PHP application where PHP logic and HTML output are often mixed together. + +Because of this, UI changes must be made carefully. Some HTML elements are directly connected to form submission, routing, query parameters, session handling, database actions, and SQL execution. + +Do not assume markup is purely visual. + +--- + +## Absolute Rules + +Copilot must follow these rules strictly: + +1. Do not rewrite the application architecture. +2. Do not convert the project to React, Vue, Angular, Svelte, or any frontend SPA framework. +3. Do not change database logic. +4. Do not change SQL execution behavior. +5. Do not change authentication, session, or permission logic. +6. Do not rename existing form fields. +7. Do not remove hidden inputs. +8. Do not change form `method` or `action` attributes unless explicitly requested. +9. Do not change existing query parameters or URL behavior. +10. Do not change driver-specific database behavior. +11. Do not remove accessibility-related attributes. +12. Do not introduce large JavaScript dependencies. +13. Do not make broad changes across many screens in one step. +14. Do not optimize or refactor backend logic unless explicitly requested. +15. Do not change behavior while modernizing UI. + +When uncertain, preserve the existing code behavior. + +--- + +## Preferred Approach + +Use a safe, incremental approach. + +Priority order: + +1. CSS-first modernization +2. Add wrapper classes around existing markup +3. Improve spacing, typography, buttons, forms, and tables +4. Refactor repeated UI output into small PHP helper functions only when safe +5. Improve one screen at a time +6. Avoid large-scale structural changes + +Prefer small, reviewable pull requests. + +--- + +## UI Modernization Strategy + +Start by improving global UI styles before changing deep PHP logic. + +Recommended first areas: + +1. Login page +2. Main layout shell +3. Sidebar / navigation +4. Header / top actions +5. Table browsing screen +6. Forms for insert/edit/update +7. SQL command screen +8. Export/import screens +9. Messages, warnings, and error states +10. Responsive layout improvements + +Each UI change should preserve existing behavior. + +--- + +## Styling Guidelines + +Prefer modern plain CSS unless otherwise instructed. + +Use: + +- CSS variables +- Consistent spacing scale +- Consistent border radius +- Modern typography +- Clear focus states +- Accessible color contrast +- Responsive layout +- Minimal JavaScript + +Example CSS direction: + +```css +:root { + --color-bg: #f8fafc; + --color-surface: #ffffff; + --color-text: #0f172a; + --color-muted: #64748b; + --color-border: #e2e8f0; + --color-primary: #2563eb; + --radius-sm: 6px; + --radius-md: 10px; + --radius-lg: 14px; + --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08); +} \ No newline at end of file diff --git a/specs/00-architecture-overview.md b/specs/00-architecture-overview.md new file mode 100644 index 000000000..1e6c492d1 --- /dev/null +++ b/specs/00-architecture-overview.md @@ -0,0 +1,140 @@ +# Adminer UI Architecture Overview + +## Purpose + +This document maps the files and functions responsible for generating HTML output in Adminer. It is the reference for all UI modernization work. **Do not change behavior — only change appearance.** + +--- + +## Request Routing + +All requests enter through `adminer/index.php`, which dispatches to a specific `*.inc.php` page based on `$_GET` parameters. + +| `$_GET` key | File loaded | Screen | +|---|---|---| +| _(none)_ | `db.inc.php` | Database / table list | +| `select` | `select.inc.php` | Browse table rows | +| `edit` | `edit.inc.php` | Insert / edit row | +| `table` | `table.inc.php` | Table structure | +| `create` | `create.inc.php` | Alter/create table | +| `indexes` | `indexes.inc.php` | Index management | +| `sql` | `sql.inc.php` | SQL command | +| `dump` | `dump.inc.php` | Export | +| `privileges` | `privileges.inc.php` | User privileges | +| `schema` | `schema.inc.php` | ER diagram | +| `database` | `database.inc.php` | Alter database | +| `call` / `callf` | `call.inc.php` | Stored procedure call | +| `foreign` | `foreign.inc.php` | Foreign key editor | +| `view` | `view.inc.php` | View editor | +| `procedure` / `function` | `procedure.inc.php` | Routine editor | +| `trigger` | `trigger.inc.php` | Trigger editor | +| `event` | `event.inc.php` | Event editor | +| `type` | `type.inc.php` | User-defined type editor | +| `user` | `user.inc.php` | User management | +| `processlist` | `processlist.inc.php` | Process list | +| `variables` | `variables.inc.php` | Server variables | +| `sequence` | `sequence.inc.php` | Sequence editor | +| `check` | `check.inc.php` | Check constraint editor | + +Every page file calls `page_header()` at the top and relies on `page_footer()` being called at the bottom of `index.php`. + +--- + +## HTML Shell — The Two Functions That Wrap Every Screen + +### `page_header()` — `adminer/include/design.inc.php` + +Outputs: +- Full `` preamble, ``, CSS links, JS links +- `` opening with classes (`ltr`, `nojs`, `adminer`, etc.) +- `
` wrapper +- `#menuopen` hamburger button (mobile only) +- `

` page title +- Flash / error message divs (`.message`, `.error`) + +### `page_footer()` — `adminer/include/design.inc.php` + +Outputs: +- Closing `

` for `#content` +- `