chore: remove internal docs and update .gitignore

- Remove github-response-spaces-in-device-name.md (internal use)
- Remove UI-Contact-Management-MVP-v2.md (internal planning)
- Add both files to .gitignore to prevent future commits

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2025-12-31 17:01:41 +01:00
parent d7bd759edb
commit 98081d25e0
3 changed files with 2 additions and 225 deletions

2
.gitignore vendored
View File

@@ -105,6 +105,8 @@ docs/Mesh Core Lista Zakupowa (repeater Dachowy).pdf
docs/contact-management-next-step.md
docs/response-to-xahgmah.md
docs/UI-Contact-Management-MVP-v1.md
docs/UI-Contact-Management-MVP-v2.md
docs/TEST-PLAN-Contact-Management-v2.md
technotes/API-Diagnostic-Commands-private.md
docs/github-discussion-*.md
docs/github-response-spaces-in-device-name.md

View File

@@ -1,134 +0,0 @@
## Prompt dla Claude Code: Contact Management v2 (Existing Contacts + Delete + Counter)
Pracujesz w repo `mc-webui`. Mamy już działający moduł UI **Contact Management (MVP v1)**: toggle `manual_add_contacts` + lista `pending_contacts` + approve. Teraz robimy etap v2: zarządzanie istniejącymi kontaktami.
### Cel (v2)
Rozbuduj moduł **Contact Management** o:
1. Panel **Existing Contacts**
* wyświetla listę kontaktów, które są już na urządzeniu (CLI/REP/ROOM — wszystkie)
* umożliwia **usuwanie** wybranego kontaktu
* pokazuje licznik kontaktów `X / 350` (limit MeshCore)
* ma podstawowe filtrowanie i wyszukiwanie (lekko, bez frameworków)
2. UX:
* mobile-first (przyciski dotykowe, brak gęstych tabel)
* szybkie odświeżanie listy, spinner/placeholder
* potwierdzenie usunięcia (modal lub confirm), bo to operacja destrukcyjna
### Wymagania techniczne / integracja
* Frontend: Flask templates + Bootstrap5 + vanilla JS.
* Backend: mc-webui komunikuje się z meshcore-bridge przez HTTP (nie przez lokalny meshcli).
* Mamy już wzorzec: mc-webui ma endpointy `/api/...` i JS robi fetch do mc-webui, a mc-webui proxyuje do bridge.
### Dane i API
1. **Pobranie listy kontaktów**
* Dodaj w mc-webui endpoint:
* `GET /api/contacts/list`
* On powinien pobierać listę kontaktów z bridgea przez mechanizm CLI:
* albo istniejący endpoint w mc-webui (jeśli jest), który wykonuje `meshcli contacts` i zwraca JSON,
* albo dodaj nowy “proxy” do `/cli` z komendą `contacts` i następnie sparsuj output.
* Zależy mi na JSON po stronie mc-webui w formacie:
```json
{
"success": true,
"count": 123,
"limit": 350,
"contacts": [
{
"name": "BBKr",
"public_key_prefix": "efa30de66fce",
"type_label": "CLI|REP|ROOM|UNKNOWN",
"path_or_mode": "Flood|<path_hex>|",
"raw_line": "..."
}
]
}
```
* Parser:
* ma być odporny na emoji i spacje w nazwach
* nie zakładaj stałej liczby spacji — użyj regex / split z głową
* `raw_line` zachowaj do debugowania
2. **Usuwanie kontaktu**
* Dodaj w mc-webui endpoint:
* `POST /api/contacts/delete` body: `{ "name": "...", "public_key_prefix": "..." }`
* Na backendzie wywołaj komendę meshcli, która usuwa kontakt.
* Najpierw sprawdź w `meshcli -h` / dokumentacji projektu jak brzmi komenda (np. `del_contact` / `rm_contact` / `remove_contact` / `contact_del` — NIE zakładaj nazwy).
* Jeśli usuwanie po nazwie jest niepewne (kolizje), użyj najbezpieczniejszego selektora dostępnego w CLI (prefiks klucza jeśli wspierany).
* Po sukcesie: zwróć `{success:true}` i na froncie odśwież listę.
3. **Licznik 350**
* `count = len(contacts)` po parsowaniu.
* `limit = 350` stała w UI (do ewentualnej zmiany później).
* UI ma pokazywać badge:
* OK: zielony/neutralny
* ostrzegawczy gdy `count >= 300`
* alarm gdy `count >= 340`
(prosta logika, bez przesady)
### UI: Contact Management v2
W istniejącym widoku `Contact Management` dodaj pod sekcją pending nową sekcję:
**Existing Contacts**
* Toolbar:
* Search input (client-side filter po `name` i `public_key_prefix`)
* Filter dropdown: All / CLI / REP / ROOM / Unknown
* Refresh button
* Lista (list-group/cards):
* name (bold)
* type_label badge (CLI/REP/ROOM)
* public_key_prefix + copy
* optional: “path_or_mode” (jeśli masz z outputu)
* Delete button (danger, ikonka kosza)
* Delete flow:
* confirm (Bootstrap modal albo `confirm()`; prefer modal)
* po delete: toast + refresh
### Ograniczenia / bezpieczeństwo
* Nie zmieniaj bridgea jeśli nie musisz. Preferuj: mc-webui proxy do istniejącego `/cli` w bridge.
* Nie dodawaj WebSocketów. Refresh ręczny wystarczy.
* Wszystkie komentarze i nazwy w kodzie: po angielsku.
### Test plan
Dodaj do README sekcję “Contact Management v2”:
* jak odświeżyć listę kontaktów
* jak filtrować
* jak usunąć kontakt
* jak sprawdzić w logach, że komenda delete poszła do bridge
### Post-task checklist
1. Update README.md
2. Jeśli projekt ma plik notatek/technotes, dopisz krótką notkę o parsowaniu outputu `contacts`
3. Conventional commit: `feat: contact management v2 (existing contacts + delete + counter)`
---
### Drobna wskazówka
Output `meshcli contacts` wygląda zwykle jak tabela (kolumny: name / type / pubkey_prefix / path lub “Flood”). Parser ma być “best effort”: nie musisz perfekcyjnie odtwarzać wszystkich pól, ale **name + pubkey_prefix + type** muszą być wiarygodne.

View File

@@ -1,91 +0,0 @@
# GitHub Issue Response: Spaces in MC_DEVICE_NAME
**Issue:** User @remowashere reported that the application fails when `MC_DEVICE_NAME` contains spaces (e.g., "Remo WebUI"), resulting in "file not found" errors for `.msgs` files.
---
Hi @remowashere,
Thanks for reporting this issue! I've investigated the problem with spaces in `MC_DEVICE_NAME` and did some testing.
**Good news:** The current version of mc-webui (on both `dev` and `main` branches) handles spaces in device names correctly. I tested with `MC_DEVICE_NAME="MarWoj Test"` and the application successfully reads the `.msgs` file without any issues:
```
mc-webui | INFO - Loaded 1 messages from /root/.config/meshcore/MarWoj Test.msgs
```
The application uses Python's `pathlib.Path` for file operations, which properly handles spaces and special characters in filenames.
## Possible causes of your issue
1. **Outdated version** - You might be running an older version of the application
2. **meshcore-cli version** - Older versions of meshcore-cli might have had issues creating files with spaces
3. **Configuration issue** - The `MC_DEVICE_NAME` environment variable might not match the actual device name used by meshcore-cli
4. **File permissions** - The `.msgs` file might not have been created yet or lacks proper permissions
## Recommended steps
### 1. Update to the latest version
```bash
cd ~/mc-webui
git pull origin main
docker compose down
docker compose up -d --build
```
### 2. Verify your configuration
```bash
# Check your .env file
cat .env | grep MC_DEVICE_NAME
# List actual .msgs files
ls -la ~/.config/meshcore/*.msgs
```
**Important:** Make sure the value of `MC_DEVICE_NAME` in your `.env` file matches the device name configured in meshcore-cli. The `.msgs` file is created by meshcore-cli using the device name you configured on the device itself.
### 3. Check logs for more details
```bash
docker compose logs -f mc-webui | grep -i "messages file"
```
Look for log lines indicating which file path the application is trying to access and whether it exists.
### 4. Verify meshcore-cli version
The application requires meshcore-cli >= 1.3.12. The Docker container installs the latest version automatically, but if you're running an older version, please update.
## Additional troubleshooting
If you're still experiencing issues after updating, please share:
1. **Docker logs:**
```bash
docker compose logs --tail=100 mc-webui
docker compose logs --tail=100 meshcore-bridge
```
2. **Git version:**
```bash
git log -1 --oneline
```
3. **Environment configuration** (with sensitive data redacted):
```bash
cat .env
```
4. **Actual .msgs files on disk:**
```bash
ls -la ~/.config/meshcore/ | grep .msgs
```
This information will help me understand exactly what's happening in your environment.
Let me know if updating resolves the issue!
Best regards,
Marek