Added global parseUTC() helper in base.html that appends 'Z' to
naive ISO dates from server. Applied to:
- Notification bell (base.html) — formatTimeAgo
- NordaGPT conversation sort (chat.html)
- B2B interest dates (classifieds/view.html)
- Admin forum moderation dates (admin/forum.html)
- Admin AI insights dates (admin/insights.html)
Same fix as conversations.js parseUTC, now available globally.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- "Dane kontaktowe" chip now says "TYLKO do firm które polecileś powyżej"
- Added prompt rule: follow-up contact requests = only previously recommended firms
- Each contact entry must include short reason WHY the firm was recommended
- Prevents AI from dumping all 15 matcher results when user asks for contacts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. When company_matcher returns [], keep full company list as fallback instead of leaving AI with zero data
2. Add explicit "no results" instruction in prompt to prevent hallucinated company names
3. Hide cost badge chip from non-admin users (IS_ADMIN gate)
4. Add 60s AbortController timeout on streaming fetch to prevent hung connections
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Badge now uses pill-shaped colored chips instead of tiny gray text:
- Blue chip: model name (Flash/Lite/Pro)
- Yellow chip: thinking level (szybki/analiza/głęboka analiza)
- Green chip: response time
- Green chip: cost
Much more readable than the previous 11px gray text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove CSS filter on AI avatar — show NordaGPT robot icon as-is
- Strategic keywords (partner, inwestow, PEJ, serwerowni) → complex
- Complex queries get thinking=high for deeper analysis and less hallucination
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- NordaGPT icon (nordagpt-icon.svg) as AI avatar instead of "AI" text
- User profile photo as avatar (falls back to initial letter)
- CRITICAL: added strict rule to never hallucinate company names
- Only mention companies that exist in the provided database
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace technical jargon (tokens, thinking mode, benchmarks) with
user-friendly language: number of questions per day/week/month,
page equivalents (~160 pages per query), how to write questions,
costs explanation, and future billing notice. Update dropdown
descriptions and limit exceeded messages.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace old Pro-only cost limits with unified system for all models:
- Per-user limits: $0.15/day, $0.50/week, $1.00/month (degressive)
- Global portal budget: $25/month (~100 PLN) tracked and displayed
- Two progress bars in chat header: personal daily + global portal usage
- Color-coded bars (green→yellow→red at 60%/90%)
- Limit exceeded banner with "request higher limits" button
- Backend endpoint logs requests for admin review
- Flash model recommended as default (economical)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pinned conversations show red pushpin. On hover, pin button fades
to gray to indicate "unpin" action. Unpinned items show red on
hover to indicate "pin" action.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The generic .conversation-item svg rule was overriding the pin icon
color with gray. Added specific selector with !important to ensure
the pushpin displays in dark navy (#1e3050).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Pin icon changed to classic pushpin in navy blue (matching theme)
- Conversation titles now show up to 2 lines instead of truncating
- Sidebar is resizable via drag handle (200-500px range)
- Sidebar is collapsible with toggle button (state persisted)
- Width preference saved to localStorage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Users can now pin favorite conversations (shown at top with section header)
and rename them with inline editing. Adds is_pinned, pinned_at, custom_name
columns to ai_chat_conversations table.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Users can now choose between Flash Lite (fastest, 1000 RPD), Flash
(thinking mode, 20 RPD) and Pro (premium). Default changed to Flash Lite.
Badge shows actual model used for full transparency.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- HIGH: Fix SQL injection in ZOPK knowledge service (3 functions) — replace f-strings with parameterized queries
- MEDIUM: Sanitize tsquery/LIKE input in SearchService to prevent injection
- MEDIUM: Add @login_required + @role_required(ADMIN) to /health/full endpoint
- MEDIUM: Add @role_required(ADMIN) to ZOPK knowledge search API
- MEDIUM: Add bleach HTML sanitization on write for announcements, events, board proceedings (stored XSS via |safe)
- MEDIUM: Remove partial API key from Gemini service logs
- MEDIUM: Remove @csrf.exempt from chat endpoints, add X-CSRFToken headers in JS
- MEDIUM: Add missing CSRF tokens to 3 POST forms (data_request, benefits_form, benefits_list)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ~170 manual `if not current_user.is_admin` checks with:
- @role_required(SystemRole.ADMIN) for user management, security, ZOPK
- @role_required(SystemRole.OFFICE_MANAGER) for content management
- current_user.can_access_admin_panel() for admin UI access
- current_user.can_moderate_forum() for forum moderation
- current_user.can_edit_company(id) for company permissions
Add @office_manager_required decorator shortcut.
Add SQL migration to sync existing users' role field.
Role hierarchy: UNAFFILIATED(10) < MEMBER(20) < EMPLOYEE(30) < MANAGER(40) < OFFICE_MANAGER(50) < ADMIN(100)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added CSS variable --header-height (109px for admin, 73px for regular users)
- Fixed chat container height calculation to account for admin bar
- Fixed mobile sidebar position
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes issue where chat input field was cut off at the bottom of the screen.
Added safe-area-inset-bottom support for iOS devices.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Zmiana nazwy: "Norda Biznes Hub" → "Norda Biznes Partner"
- Aktualizacja modelu AI: Gemini 2.0 Flash → Gemini 3 Flash
- Zachowano historyczne odniesienia w timeline i dokumentacji
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Flash is free and fast - best default for users
- Prevents accidental Pro usage and costs
- Users can still switch to Pro manually if needed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created nordagpt-icon.svg combining Norda compass + INPI circuit motif
- Navy blue background with green AI chip center
- Yellow north indicator (Norda brand color)
- Updated header icon from robot emoji to new SVG
- Updated empty state icon
- Changed example questions to be more relevant:
- 'Szukam partnera do projektu budowlanego'
- 'Kto w Izbie zajmuje się marketingiem?'
- 'Poleć firmę z dobrymi opiniami Google'
- 'Co nowego na forum?'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Show both models (Flash free, Pro premium) with visual distinction
- Add pricing section with costs and limits
- Update history timeline with today's changes
- Update benefits section with current features
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- costUsd was a string, causing 'toFixed is not a function' error
- Added parseFloat() for cost and parseInt() for latency
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GOOGLE_GEMINI_API_KEY_FREE: klucz Free tier dla Flash (darmowy)
- GOOGLE_GEMINI_API_KEY: klucz Paid tier dla Pro (płatny)
- GeminiService automatycznie wybiera klucz na podstawie modelu
- Flash pricing ustawiony na $0.00 (Free tier)
- UI pokazuje Flash jako "Darmowy"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
UI:
- Dropdown wyboru modelu: Flash (szybki, $0.05) vs Pro (analiza, $0.20)
- Wyświetlanie kosztu miesięcznego w headerze
- Badge odpowiedzi pokazuje: model, czas, koszt
Backend:
- Endpoint /api/chat/settings obsługuje model i monthly_cost
- NordaBizChatEngine przyjmuje parametr model
- Koszt zapisywany w tech_info odpowiedzi
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano style CSS dla forum-link (fiolet), news-link (zieleń), b2b-link (żółty)
- formatMessage() obsługuje teraz linki wewnętrzne (/forum/, /news/, /b2b/)
- Badge thinking pokazuje opis jakościowy (np. "dogłębna analiza z weryfikacją")
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed AI model from Gemini 2.5 Flash-Lite to Gemini 3 Flash Preview
- Added Gemini 3 models (3-flash, 3-pro) to GEMINI_MODELS config
- Updated GEMINI_PRICING with current 2026 prices
- Updated chat UI: badge, model info modal, specs, timeline
- Benefits: 7x better reasoning, thinking mode, 78% SWE-bench
Cost estimate: ~$40/month at 1000x current usage (Tier 1)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano stałą globalną COMPANY_COUNT_MARKETING w app.py
- Dodano do context_processor jako COMPANY_COUNT
- Zaktualizowano szablony: index.html, chat.html, landing.html, release_notes
- Jedno miejsce do zmiany gdy Izba zaktualizuje cel
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Landing page i chat timeline - cel marketingowy 150 podmiotów
zamiast dynamicznej liczby z bazy (111).
Zmieniono również terminologię:
- "firm członkowskich" → "podmiotów gospodarczych"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano person_id i profile URL do kontekstu osób w chatbocie
- Zaktualizowano system prompt: OBOWIĄZKOWE linki dla firm i osób
- Dodano CSS dla linków do osób (zielony badge)
- Rozszerzono JavaScript o wykrywanie linków /osoba/
Kolory badge:
- 🏢 Firmy: pomarańczowy (#c2410c)
- 👤 Osoby: zielony (#047857)
- 🔗 Zewnętrzne: niebieski (#1d4ed8)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano overflow: hidden na html i body
- Ukrycie footer na stronie chatu (display: none)
- max-height na main dla pewności
- height: 100% na container
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nadpisanie .container dla chatu (100% szerokości)
- Main z flex i overflow: hidden
- chat-main z height: 100% i max-height: 100%
- scrollToBottom z requestAnimationFrame dla pewności
- Struktura jak w ChatGPT/Claude
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Użycie scrollIntoView({ block: 'end' }) na ostatniej wiadomości
- Lepsze zachowanie - scroll do widocznego elementu
- Smooth scroll dla lepszego UX
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano flex-shrink: 0 do .chat-header i .chat-input-area
- Dodano overflow: hidden do .chat-main
- Dodano min-height: 0 do .chat-messages (kluczowe dla flexbox overflow)
- Teraz header i input zawsze widoczne, tylko wiadomości się scrollują
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Linki do firm (nordabiznes.pl/company/): pomarańczowe badge'y
- Linki zewnętrzne (www, social, maps): niebieskie badge'y
- JavaScript wykrywa typ linku po URL i dodaje klasę CSS
- Hover effect z cieniem i lekkim uniesieniem
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Linki jako zaokrąglone badge'y z kolorowym tłem
- 4 kolory w rotacji: pomarańczowy, zielony, żółty, różowy
- Delikatny hover effect (ciemniejsze tło)
- Padding i border-radius dla lepszej widoczności
- Białe tło dla linków w wiadomościach użytkownika
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Backend (nordabiz_chat.py):
- Dodano instrukcję w system prompt wymagającą linków markdown
- Nazwy firm: [Firma](URL) - klikalne linki do profilu
- Nazwy osób: **Imię Nazwisko** (link do firmy)
Frontend (chat.html):
- Nowe style dla linków w wiadomościach
- Fioletowy kolor (#7c3aed) dla linków AI
- Hover effect z podkreśleniem
- Oddzielne style dla linków w wiadomościach użytkownika
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Przycisk ▶️ w headerze chatu obok badge'a modelu
- Modal z 40-sekundowym tutorialem wideo z polskim narratorem
- Poster (miniaturka) wideo
- Sekcja "Szybkie wskazówki" pod odtwarzaczem
- Responsywny design dla mobile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowy model ExternalContact z pełnymi danymi kontaktowymi, social media, related_links (JSONB)
- Migracja SQL 020_external_contacts.sql z full-text search
- Routes: /kontakty (lista), /kontakty/dodaj, /kontakty/<id>, /kontakty/<id>/edytuj
- Szablony: lista z filtrami, karta szczegółów, formularz CRUD
- Nawigacja: link "Kontakty zewnętrzne" w dropdown Społeczność
- Poprawka: aktualizacja liczby firm z 80 na 111
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>