|
| 1 | +# Contributing to Confitty |
| 2 | + |
| 3 | +Thanks for wanting to help. Here's what you need to know. |
| 4 | + |
| 5 | +<div align="center"> |
| 6 | + |
| 7 | +## 📁 Project Structure |
| 8 | + |
| 9 | +</div> |
| 10 | + |
| 11 | +```text |
| 12 | +src/ |
| 13 | +├── app/ |
| 14 | +│ └── app.component.ts # Root shell - layout, header, footer, about modal |
| 15 | +├── components/ |
| 16 | +│ ├── about-modal/ # About dialog (mascot, Ko-fi, GitHub) |
| 17 | +│ ├── category-navigation/ # Left sidebar with config categories |
| 18 | +│ ├── config-editor/ # Center panel - form switcher + preset selector |
| 19 | +│ ├── forms/ |
| 20 | +│ │ ├── fonts-form/ |
| 21 | +│ │ ├── cursor-form/ |
| 22 | +│ │ ├── scrollback-form/ |
| 23 | +│ │ ├── mouse-form/ |
| 24 | +│ │ ├── performance-form/ |
| 25 | +│ │ ├── bell-form/ |
| 26 | +│ │ ├── window-layout-form/ |
| 27 | +│ │ ├── tab-bar-form/ |
| 28 | +│ │ ├── colors-form/ |
| 29 | +│ │ ├── advanced-form/ |
| 30 | +│ │ └── os-specific-form/ |
| 31 | +│ ├── header/ # Top bar - search, import, export, mode toggle |
| 32 | +│ ├── live-preview/ # Right panel - terminal preview + config text view |
| 33 | +│ ├── preset-selector/ # Preset browser with category tabs |
| 34 | +│ ├── search-bar/ # Global search component |
| 35 | +│ └── shared/ # Shared UI components |
| 36 | +├── models/ |
| 37 | +│ ├── kitty-types.ts # TypeScript interfaces for Kitty config |
| 38 | +│ └── kitty-defaults.ts # Default values matching Kitty's defaults |
| 39 | +└── services/ |
| 40 | + ├── config-store.service.ts # Central state (Angular signals) |
| 41 | + ├── kitty-parser.service.ts # Parses .conf files into KittyConfigAST |
| 42 | + ├── kitty-generator.service.ts # Generates .conf text from KittyConfigAST |
| 43 | + ├── color-themes.service.ts # Quick-apply color themes |
| 44 | + ├── presets.service.ts # Full config presets |
| 45 | + ├── font-presets.service.ts # Font database with metadata |
| 46 | + ├── search.service.ts # Global search index and result routing |
| 47 | + └── theme.service.ts # Theme management |
| 48 | +``` |
| 49 | + |
| 50 | +<div align="center"> |
| 51 | + |
| 52 | +## 🚀 Getting Started |
| 53 | + |
| 54 | +</div> |
| 55 | + |
| 56 | +```bash |
| 57 | +git clone https://github.com/xcutiboo/Confitty.git |
| 58 | +cd Confitty |
| 59 | +bun install |
| 60 | +bun start |
| 61 | +``` |
| 62 | + |
| 63 | +The app runs at `http://localhost:4200` with hot reload. |
| 64 | + |
| 65 | +<div align="center"> |
| 66 | + |
| 67 | +## 📝 Coding Conventions |
| 68 | + |
| 69 | +</div> |
| 70 | + |
| 71 | +This is an Angular 21 project using standalone components and signals. |
| 72 | + |
| 73 | +### Components |
| 74 | + |
| 75 | +- **Standalone only** — no NgModule |
| 76 | +- **Inline templates** — no separate `.html` files |
| 77 | +- **Angular signals** — use `signal()`, `computed()`, `effect()` for state, not RxJS |
| 78 | +- **New control flow** — use `@if`, `@for`, `@switch`, not `*ngIf` / `*ngFor` |
| 79 | + |
| 80 | +### TypeScript |
| 81 | + |
| 82 | +- **Strict mode** — don't use `any` unless absolutely necessary |
| 83 | +- **Central types** — all Kitty config types live in `kitty-types.ts` |
| 84 | +- **Dependency injection** — use `inject()`, not constructor injection |
| 85 | + |
| 86 | +### Styling |
| 87 | + |
| 88 | +- **Tailwind only** — no separate CSS files for components |
| 89 | +- **Color palette** — use `kitty-*` colors from `tailwind.config.js` |
| 90 | +- **Branding** — pink (`pink-*`) colors reserved for Confitty accents |
| 91 | + |
| 92 | +### Naming |
| 93 | + |
| 94 | +| Type | Convention | Example | |
| 95 | +| ---- | ---------- | ------- | |
| 96 | +| Components | kebab-case folder, PascalCase class | `fonts-form/FontsFormComponent` | |
| 97 | +| Services | camelCase with `Service` suffix | `configStoreService` | |
| 98 | +| Files | kebab-case | `kitty-types.ts` | |
| 99 | + |
| 100 | +<div align="center"> |
| 101 | + |
| 102 | +## ➕ Adding a New Config Option |
| 103 | + |
| 104 | +</div> |
| 105 | + |
| 106 | +When Kitty adds a new config setting: |
| 107 | + |
| 108 | +1. **Add the type** — add the property to the right interface in `kitty-types.ts` |
| 109 | +2. **Add the default** — add the default value in `kitty-defaults.ts` (check [Kitty docs](https://sw.kovidgoyal.net/kitty/conf/)) |
| 110 | +3. **Add the parser** — handle the new key in `kitty-parser.service.ts` |
| 111 | +4. **Add the form field** — add UI control in the relevant form component |
| 112 | +5. **Verify the generator** — check `kitty-generator.service.ts` for special formatting needs |
| 113 | + |
| 114 | +**Note:** The generator only outputs settings that differ from defaults. Make sure your default value matches Kitty's actual default. |
| 115 | + |
| 116 | +<div align="center"> |
| 117 | + |
| 118 | +## 🎨 Adding a New Preset |
| 119 | + |
| 120 | +</div> |
| 121 | + |
| 122 | +Presets live in `src/services/presets.service.ts`: |
| 123 | + |
| 124 | +```ts |
| 125 | +{ |
| 126 | + id: 'my-preset', // unique, kebab-case |
| 127 | + name: 'My Preset', |
| 128 | + description: 'One sentence about what this is for.', |
| 129 | + category: 'theme', // 'theme' | 'performance' | 'minimal' | 'feature-rich' | 'gaming' |
| 130 | + author: 'author name', // optional |
| 131 | + tags: ['tag1', 'tag2'], // optional, for display only |
| 132 | + config: { |
| 133 | + // flat key-value pairs matching kitty config keys |
| 134 | + // only include what differs from default |
| 135 | + foreground: '#f8f8f2', |
| 136 | + background: '#282a36', |
| 137 | + // ... |
| 138 | + } |
| 139 | +} |
| 140 | +``` |
| 141 | + |
| 142 | +For color themes, also add to `src/services/color-themes.service.ts` with the 16-color palette so it appears in the Colors form quick-apply buttons. |
| 143 | + |
| 144 | +<div align="center"> |
| 145 | + |
| 146 | +## 🔀 Pull Requests |
| 147 | + |
| 148 | +</div> |
| 149 | + |
| 150 | +- One logical change per PR — no unrelated fixes bundled together |
| 151 | +- Test in the browser before opening — including live preview and export |
| 152 | +- Ensure `bun run build` passes with no errors |
| 153 | +- For color themes, verify hex values against official theme sources |
| 154 | +- Use imperative commit messages: "Add Rosé Pine theme", "Fix opacity slider" |
| 155 | + |
| 156 | +<div align="center"> |
| 157 | + |
| 158 | +## 🐛 Reporting Issues |
| 159 | + |
| 160 | +</div> |
| 161 | + |
| 162 | +Open an issue on GitHub with: |
| 163 | + |
| 164 | +- What you expected to happen |
| 165 | +- What actually happened |
| 166 | +- Your browser and OS |
| 167 | +- Sample `.conf` file if it's a config export issue |
0 commit comments