Skip to content

Commit 7917c3a

Browse files
committed
fix: addressing coderabbitai's suggestions
1 parent f4ac8c5 commit 7917c3a

14 files changed

Lines changed: 1242 additions & 87 deletions

File tree

.github/ISSUE_TEMPLATE/good_first_issue.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ body:
3737
description: Helpful resources for completing this task
3838
value: |
3939
- [Contribution Guide - Start Here!](https://github.com/AOSSIE-Org/SupportUsButton/blob/main/CONTRIBUTING.md)
40-
- [Discord Channel](https://discord.gg/hjUhu33uAn)
40+
- [Discord Channel #support-us-button](https://discord.gg/vK2NfgG)
4141
validations:
4242
required: false
4343

@@ -56,7 +56,7 @@ body:
5656
options:
5757
- label: I have joined the [Discord server](https://discord.gg/vK2NfgG) and will post updates there
5858
required: true
59-
- label: I have read the [Contribution Guide](https://github.com/AOSSIE-Org/Template-Repo/blob/main/CONTRIBUTING.md)
59+
- label: I have read the [Contribution Guide](https://github.com/AOSSIE-Org/SupportUsButton/blob/main/CONTRIBUTING.md)
6060
required: true
6161
- label: I understand this issue is assigned on a first-come, first-served basis
6262
required: true

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,31 @@ on:
66
pull_request:
77
branches: [main, develop]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build-and-test:
1115
name: Type-Check, Test & Build
1216
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
1319

1420
steps:
1521
- name: Checkout Code
16-
uses: actions/checkout@v4
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
1725

1826
- name: Setup Node.js
19-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
2028
with:
2129
node-version: 20
2230
cache: "npm"
2331

2432
- name: Install Dependencies
25-
run: npm ci
33+
run: npm install
2634

2735
- name: Type Check
2836
run: npm run type-check

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Welcome, AI Agent! This document contains essential instructions, code style sta
1414
- **Dev Preview:** Vite 8 (`demo/App.tsx`)
1515

1616
### Key Build & Test Commands:
17+
1718
- **Type-Check:** `npx tsc --noEmit`
1819
- **Build Package:** `npm run build`
1920
- **Develop Demo:** `npm run dev:demo`
@@ -34,7 +35,7 @@ Welcome, AI Agent! This document contains essential instructions, code style sta
3435

3536
## 📁 Repository Structure
3637

37-
```
38+
```text
3839
SupportUsButton/
3940
├── brand/ # Brand assets (logo.svg, favicon.svg, Brand.md)
4041
├── demo/ # Interactive Vite Dev Preview app (App.tsx)

BestPracticesChecklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This document tracks compliance with the **AOSSIE Best Practices Guidelines** fo
2525
- [x] **Contrast Fail-Safes**: Dynamic relative luminance contrast calculation (`isDarkColor`) for logo and button visibility on light/dark host themes.
2626
- [x] **Automated Testing & CI**: Unit testing and GitHub Actions workflow configured for PR validation.
2727
- [x] **Micro-Animations**: GPU-accelerated CSS keyframe transitions (`animate-sub-fade-in`, `animate-sub-scale-in`).
28-
- [x] **Zero Dependencies**: Lightweight bundle footprint (<0.5 KB added overhead) using native Web APIs.
28+
- [x] **Zero Third-Party UI Dependencies**: Ultra-lightweight package architecture (only standard `tslib` helper; zero external UI framework dependencies) producing ~12 KB minified JS output (`dist/index.esm.js`) and ~4 KB minified CSS (`dist/style.css`).
2929
- [x] **Multi-Bundle Formats**: Exports ESM (`dist/index.esm.js`), CommonJS (`dist/index.cjs.js`), and UMD (`dist/index.umd.js`).
3030

3131
---

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ We welcome contributions from everyone. By participating in this project, you ag
1515

1616
**PRs without Discord updates will not be reviewed or may face delays.**
1717

18-
## 📋 Table of Contents
18+
## 📋 Table of Contents
1919

2020
- [How Can I Contribute?](#how-can-i-contribute)
2121
- [Coding with AI](#coding-with-ai)

MAINTAINERS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This document lists the maintainers of the **SupportUsButton** project.
44

5-
| Name | Github Username | Discord Username | Email Address |
5+
| Name | GitHub Username | Discord Username | Email Address |
66
| -------------------------------- | ------------------ | ------------------ | ---------------------------- |
77
| Bruno Woltzenlogel Paleo | @Zahnentferner | @b.wp | zahnentferner@gmail.com |
88
| Rahul Vyas | @rahul-vyas-dev | @rahulvyas_de | rahulvyas.5100@gmail.com |
@@ -12,6 +12,7 @@ This document lists the maintainers of the **SupportUsButton** project.
1212

1313
## 📩 Contacting Maintainers
1414

15-
For security reports, architectural questions, or governance inquiries, please reach out via:
16-
1. **AOSSIE Discord Channel**
17-
2. **GitHub Issues:** [github.com/AOSSIE-Org/SupportUsButton/issues](https://github.com/AOSSIE-Org/SupportUsButton/issues)
15+
* **Security Vulnerabilities**: For private security reports, please email [reach2saksham2004@gmail.com](mailto:reach2saksham2004@gmail.com) directly before public disclosure.
16+
* **Architectural Questions & Governance**:
17+
1. **AOSSIE Discord Channel**: [#support-us-button](https://discord.gg/vK2NfgG)
18+
2. **GitHub Issues**: [github.com/AOSSIE-Org/SupportUsButton/issues](https://github.com/AOSSIE-Org/SupportUsButton/issues)

brand/Brand.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ This document defines the official branding, logo assets, color palette, typogra
1212

1313
## 🖼️ Logo & Assets
1414

15-
All official brand assets are located inside the [`brand/`](file:///x:/Work/Dev/AOSSIE/SupportUsButton/brand/) directory.
15+
All official brand assets are located inside the [`brand/`](./) directory.
1616

17-
* **Primary Logo (SVG)**: [`brand/logo.svg`](file:///x:/Work/Dev/AOSSIE/SupportUsButton/brand/logo.svg)
18-
* **Favicon / Logomark (SVG)**: [`brand/favicon.svg`](file:///x:/Work/Dev/AOSSIE/SupportUsButton/brand/favicon.svg)
17+
* **Primary Logo (SVG)**: [`logo.svg`](./logo.svg)
18+
* **Favicon / Logomark (SVG)**: [`favicon.svg`](./favicon.svg)
1919

2020
### Usage Rules:
21+
2122
* Always maintain aspect ratios when displaying the SVG logo.
2223
* On dark backgrounds, use the primary logo or inverted contrast version (`brightness-0 invert`).
2324
* On light host backgrounds, use dark contrast text and borders (`brightness-0`).
@@ -44,6 +45,7 @@ The SupportUsButton brand palette balances modern dark UI elements with high-con
4445
SupportUsButton is designed with **automatic font-family inheritance** so that it matches the host website typography natively out-of-the-box.
4546

4647
### Font Family Specs:
48+
4749
* **Primary (Inherited)**: `font-family: inherit` (Default for `Theme="auto"`)
4850
* **Fallback Stack**: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`
4951
* **Heading Sizes**:

demo/App.tsx

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ import SupportUsButton from "../src/index";
33
import type { Theme, supportUsButtonProps } from "../src/types/index";
44
import "../src/styles/style.css";
55

6+
const DEMO_TEXT = {
7+
headerTitle: "SupportUsButton — Dev Preview",
8+
themeLabel: "Theme Prop:",
9+
hostBgLabel: "Host BG:",
10+
hostFontLabel: "Host Font:",
11+
bgLogoLabel: "BG Logo:",
12+
toggleLogoAction: "Toggle background logo visibility",
13+
options: {
14+
auto: "✨ Auto (Host Adapted)",
15+
inherit: "🏛️ Inherit (Host Theme)",
16+
light: "☀️ Light",
17+
dark: "🌙 Dark",
18+
},
19+
};
20+
621
const HOST_BG_MAP: Record<string, { bg: string; text: string; label: string }> = {
722
zinc: { bg: "#09090b", text: "#ffffff", label: "Dark Zinc (#09090b)" },
823
slate: { bg: "#0f172a", text: "#ffffff", label: "Slate Dark (#0f172a)" },
@@ -90,26 +105,33 @@ export function App() {
90105
<header className="sticky top-0 z-50 backdrop-blur-md bg-zinc-900/90 border-b border-zinc-800 p-4 flex flex-wrap items-center justify-between gap-4 max-w-7xl mx-auto rounded-b-xl shadow-lg">
91106
<div className="flex items-center gap-3">
92107
<img src="/aossie_logomark.svg" alt="AOSSIE Logo" className="h-8 w-auto brightness-0 invert" />
93-
<h1 className="text-xl font-bold tracking-tight text-white font-sans">SupportUsButton — Dev Preview</h1>
108+
<h1 className="text-xl font-bold tracking-tight text-white font-sans">{DEMO_TEXT.headerTitle}</h1>
94109
</div>
95110

96111
<div className="flex flex-wrap items-center gap-4 font-sans">
97112
<div className="flex items-center gap-2">
98-
<span className="text-sm font-medium text-gray-300">Theme Prop:</span>
113+
<label htmlFor="theme-select" className="text-sm font-medium text-gray-300">
114+
{DEMO_TEXT.themeLabel}
115+
</label>
99116
<select
117+
id="theme-select"
100118
value={theme}
101119
onChange={(e) => setTheme(e.target.value as Theme)}
102120
className="px-3 py-1.5 rounded-lg text-sm font-semibold bg-zinc-800 text-amber-400 border border-zinc-700 cursor-pointer focus:outline-none focus:ring-2 focus:ring-amber-500"
103121
>
104-
<option value="auto">✨ Auto (Host Adapted)</option>
105-
<option value="light">☀️ Light</option>
106-
<option value="dark">🌙 Dark</option>
122+
<option value="auto">{DEMO_TEXT.options.auto}</option>
123+
<option value="inherit">{DEMO_TEXT.options.inherit}</option>
124+
<option value="light">{DEMO_TEXT.options.light}</option>
125+
<option value="dark">{DEMO_TEXT.options.dark}</option>
107126
</select>
108127
</div>
109128

110129
<div className="flex items-center gap-2">
111-
<span className="text-sm font-medium text-gray-300">Host BG:</span>
130+
<label htmlFor="host-bg-select" className="text-sm font-medium text-gray-300">
131+
{DEMO_TEXT.hostBgLabel}
132+
</label>
112133
<select
134+
id="host-bg-select"
113135
value={customHostBgKey}
114136
onChange={(e) => setCustomHostBgKey(e.target.value)}
115137
className="px-3 py-1.5 rounded-lg text-sm font-semibold bg-zinc-800 text-blue-400 border border-zinc-700 cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500"
@@ -123,8 +145,11 @@ export function App() {
123145
</div>
124146

125147
<div className="flex items-center gap-2">
126-
<span className="text-sm font-medium text-gray-300">Host Font:</span>
148+
<label htmlFor="host-font-select" className="text-sm font-medium text-gray-300">
149+
{DEMO_TEXT.hostFontLabel}
150+
</label>
127151
<select
152+
id="host-font-select"
128153
value={customHostFontKey}
129154
onChange={(e) => setCustomHostFontKey(e.target.value)}
130155
className="px-3 py-1.5 rounded-lg text-sm font-semibold bg-zinc-800 text-emerald-400 border border-zinc-700 cursor-pointer focus:outline-none focus:ring-2 focus:ring-emerald-500"
@@ -138,8 +163,14 @@ export function App() {
138163
</div>
139164

140165
<div className="flex items-center gap-2">
141-
<span className="text-sm font-medium text-gray-300">BG Logo:</span>
166+
<label htmlFor="logo-toggle-button" className="text-sm font-medium text-gray-300">
167+
{DEMO_TEXT.bgLogoLabel}
168+
</label>
142169
<button
170+
id="logo-toggle-button"
171+
type="button"
172+
aria-label={DEMO_TEXT.toggleLogoAction}
173+
aria-pressed={showLogo}
143174
onClick={() => setShowLogo(!showLogo)}
144175
className={`px-4 py-1.5 rounded-lg text-sm font-semibold transition-all duration-200 border cursor-pointer active:scale-95 shadow-sm ${
145176
showLogo

0 commit comments

Comments
 (0)