Skip to content

Commit dc6564e

Browse files
philippgergerclaude
andcommitted
Merge branch 'feat/tools-measure-rulers'
Tools tab (measure, rulers/guides, eyedropper, grid-snap, screenshot), actionable inspector, E2E suite, and public-repo preparation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 parents ec50928 + 28e328d commit dc6564e

44 files changed

Lines changed: 2718 additions & 58 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Bug report
2+
description: Something in the extension isn't working as expected
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to file a bug! Please fill in as much as you can.
9+
For security issues, do **not** use this form — see [SECURITY.md](../blob/main/SECURITY.md).
10+
- type: textarea
11+
id: what-happened
12+
attributes:
13+
label: What happened?
14+
description: A clear description of the bug and what you expected instead.
15+
placeholder: When I toggle the column grid on <site>, the overlay…
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: repro
20+
attributes:
21+
label: Steps to reproduce
22+
description: Include the page/site if the bug is site-specific.
23+
placeholder: |
24+
1. Open …
25+
2. Press ⌘⇧Y …
26+
3. Toggle …
27+
validations:
28+
required: true
29+
- type: input
30+
id: browser
31+
attributes:
32+
label: Browser & version
33+
placeholder: Chrome 140 / Arc 1.x / Edge 140
34+
validations:
35+
required: true
36+
- type: input
37+
id: version
38+
attributes:
39+
label: Extension version
40+
placeholder: 0.1.0 (see chrome://extensions)
41+
validations:
42+
required: true
43+
- type: textarea
44+
id: console
45+
attributes:
46+
label: Console output
47+
description: Any relevant errors from the page console or the extension's service worker.
48+
render: shell

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security vulnerability
4+
url: https://github.com/philippgerger/avemo-dev-plugin/security/advisories/new
5+
about: Please report security issues privately, not as a public issue.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Feature request
2+
description: Suggest an overlay, tool, or improvement
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: What problem does this solve?
9+
description: What are you trying to do that the extension can't do today?
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: Proposed solution
16+
description: How might it look or behave? Screenshots/sketches welcome.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: alternatives
21+
attributes:
22+
label: Alternatives considered
23+
description: Other approaches or existing tools you've tried.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Thanks for contributing! Please fill this in so reviews go smoothly. -->
2+
3+
## Summary
4+
5+
<!-- What does this change and why? Link any related issue: Closes #123 -->
6+
7+
## Type of change
8+
9+
- [ ] Bug fix
10+
- [ ] New feature
11+
- [ ] Refactor / internal
12+
- [ ] Documentation
13+
- [ ] Build / CI
14+
15+
## Checklist
16+
17+
- [ ] `pnpm type-check` passes
18+
- [ ] `pnpm test` passes (added/updated tests where it made sense)
19+
- [ ] `pnpm build` succeeds
20+
- [ ] Verified in a real browser (if UI/overlay behavior changed)
21+
- [ ] Commits follow [Conventional Commits](https://www.conventionalcommits.org/)
22+
23+
## Screenshots / notes
24+
25+
<!-- Optional: before/after screenshots, or anything a reviewer should know. -->

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
# Cancel superseded runs on the same ref.
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build-and-test:
16+
name: Type-check, test & build
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up pnpm
22+
uses: pnpm/action-setup@v4
23+
24+
- name: Set up Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: pnpm
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Type-check
34+
run: pnpm type-check
35+
36+
- name: Unit tests
37+
run: pnpm test
38+
39+
- name: Build extension
40+
run: pnpm build:only
41+
42+
- name: Upload unpacked extension
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: avemo-dev-unpacked
46+
path: dist/
47+
if-no-files-found: error
48+
49+
e2e:
50+
name: End-to-end (Playwright)
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up pnpm
56+
uses: pnpm/action-setup@v4
57+
58+
- name: Set up Node
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: 20
62+
cache: pnpm
63+
64+
- name: Install dependencies
65+
run: pnpm install --frozen-lockfile
66+
67+
- name: Install Playwright Chromium
68+
run: pnpm exec playwright install --with-deps chromium
69+
70+
- name: Build extension
71+
run: pnpm build:only
72+
73+
- name: Run E2E smoke suite
74+
run: pnpm e2e
75+
76+
- name: Upload Playwright report
77+
if: ${{ !cancelled() }}
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: playwright-report
81+
path: playwright-report/
82+
if-no-files-found: ignore

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ dist
44
*.log
55
.vite
66
stats.html
7+
8+
# Playwright E2E artifacts
9+
test-results
10+
playwright-report
11+
.playwright
12+
13+
# Local Claude Code session data
14+
.claude

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented here. The format is based on
4+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres
5+
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
9+
### Added
10+
- Public repository: MIT license, contribution guide, issue/PR templates, and a
11+
continuous-integration workflow (type-check, unit tests, build).
12+
13+
## [0.1.0]
14+
15+
Initial development release.
16+
17+
### Added
18+
- **Column grid** overlay — configurable count, gutter, margin, max-width, and
19+
`stretch` / `center` alignment, with an optional responsive per-breakpoint mode.
20+
- **Baseline grid** and **row** overlays for verifying vertical rhythm.
21+
- **Element outlines** for containers, text nodes, or every element.
22+
- **Hover inspector** reading out box model, typography, colors, and size, with
23+
pin-on-click and copy classes / CSS / color actions.
24+
- **Tools tab** — pixel measure, rulers with draggable per-site guides, an
25+
eyedropper (with recent colors), grid-snap, and full-page screenshot capture.
26+
- **Floating glass panel** — draggable, minimizable, styled with the avemo OKLCH
27+
token system; toggled with `⌘⇧Y` / `Ctrl+Shift+Y` or the toolbar icon.
28+
- **Per-site persistence** of overlay config and panel state in `chrome.storage.local`.
29+
- Built-in presets (Avemo 12-col, 8pt/4pt baseline, Centered 1200 · 12) plus
30+
user-saved custom presets.
31+
- Full **Shadow DOM isolation** so page CSS and the extension's styles never mix.
32+
- Bundled **Inter** font, injected via an in-shadow `@font-face`.
33+
- **Vitest** unit suite and a **Playwright** end-to-end smoke suite that drives the
34+
built extension in a real Chromium context.
35+
36+
[Unreleased]: https://github.com/philippgerger/avemo-dev-plugin/compare/v0.1.0...HEAD
37+
[0.1.0]: https://github.com/philippgerger/avemo-dev-plugin/releases/tag/v0.1.0

CONTRIBUTING.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Contributing to Avemo Dev
2+
3+
Thanks for your interest in improving Avemo Dev! This document covers how to get
4+
a development build running, the project layout, and the conventions used here.
5+
6+
## Prerequisites
7+
8+
- [Node.js](https://nodejs.org/) 20 or newer
9+
- [pnpm](https://pnpm.io/) 9 or newer (`corepack enable` will provide it)
10+
- A Chromium-based browser (Chrome, Edge, Brave, Arc, …) for loading the extension
11+
12+
## Getting started
13+
14+
```bash
15+
pnpm install # install dependencies
16+
pnpm dev # start Vite in watch mode with HMR
17+
```
18+
19+
Then load the extension:
20+
21+
1. Open `chrome://extensions`.
22+
2. Enable **Developer mode** (top-right).
23+
3. Click **Load unpacked** and select the generated `dist/` folder.
24+
25+
CRXJS reloads the extension as you edit source files. For a production build,
26+
run `pnpm build` and load the same `dist/` folder.
27+
28+
## Useful scripts
29+
30+
| Command | What it does |
31+
| --- | --- |
32+
| `pnpm dev` | Vite dev server + HMR for the extension |
33+
| `pnpm build` | Type-check (`vue-tsc`) then produce the unpacked extension in `dist/` |
34+
| `pnpm type-check` | Type-check only, no build |
35+
| `pnpm test` | Run the Vitest unit suite once |
36+
| `pnpm test:watch` | Vitest in watch mode |
37+
| `pnpm e2e:install` | One-time: download the Chromium build Playwright drives |
38+
| `pnpm e2e` | Run the Playwright end-to-end suite against `dist/` (build first) |
39+
40+
## Project structure
41+
42+
```
43+
src/
44+
├─ background/ # MV3 service worker (toggles the panel on command/icon click)
45+
├─ content/ # content script: mounts the Shadow-DOM host
46+
│ ├─ overlay-root.ts # creates the shadow root, injects tokens + Inter
47+
│ ├─ overlay-manager.ts # watches the Pinia store, drives the plain-JS renderers
48+
│ └─ overlays/ # column/baseline/row grids, outlines, inspector, tools
49+
├─ ui/ # Vue panel + section/component tree
50+
├─ stores/ # Pinia store — the single config contract the UI drives
51+
├─ lib/ # framework-agnostic helpers (color, grid math, storage, …)
52+
└─ styles/ # panel.css — the avemo OKLCH token system (injected inline)
53+
```
54+
55+
Key architectural notes:
56+
57+
- **Shadow DOM isolation.** The panel and every overlay mount inside a shadow root
58+
so page CSS never leaks in, and the extension's styles never affect the page.
59+
- **Store-driven overlays.** `src/stores/settings.ts` is the source of truth;
60+
`overlay-manager.ts` watches it and calls the plain-JS renderers in
61+
`src/content/overlays/`. Overlays don't import Vue.
62+
- **Per-domain persistence.** Config is saved per host in `chrome.storage.local`
63+
and auto-restored on the next visit.
64+
65+
## Coding conventions
66+
67+
- **TypeScript strict mode** throughout — no `any` escape hatches without a reason.
68+
- Match the style, naming, and comment density of the surrounding code.
69+
- Keep overlay renderers framework-agnostic (no Vue imports under `content/overlays/`).
70+
- Prefer small, focused modules in `src/lib/` for reusable logic and add a unit test.
71+
72+
## Before opening a pull request
73+
74+
1. `pnpm type-check` passes.
75+
2. `pnpm test` passes (add/adjust tests for behavior changes).
76+
3. `pnpm build` succeeds.
77+
4. If you touched panel/overlay behavior, sanity-check it in a real browser and,
78+
where practical, extend the Playwright suite in `e2e/`.
79+
80+
### Commit messages
81+
82+
This project uses [Conventional Commits](https://www.conventionalcommits.org/):
83+
84+
```
85+
feat(inspector): add contrast ratio readout
86+
fix(panel): restore focus after closing a color field
87+
docs: clarify E2E setup
88+
```
89+
90+
## Reporting bugs & requesting features
91+
92+
Use the [issue templates](https://github.com/philippgerger/avemo-dev-plugin/issues/new/choose).
93+
For anything security-related, please read [SECURITY.md](./SECURITY.md) first.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Philipp Gerger
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)