Commit Graph

42 Commits

Author SHA1 Message Date
fahed
db2617f37d Support both link columns and plain foreign key columns
All checks were successful
Deploy HiHala Dashboard / deploy (push) Successful in 6s
Production NocoDB uses DistrictId/MuseumId columns instead of
nc_epk____ link columns. Code now checks both column names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:03:07 +03:00
fahed
a720b4a0aa Retrigger build with updated NocoDB token
All checks were successful
Deploy HiHala Dashboard / deploy (push) Successful in 7s
2026-03-09 17:47:31 +03:00
fahed
d98fd2cd36 Retrigger CI/CD build
All checks were successful
Deploy HiHala Dashboard / deploy (push) Successful in 7s
2026-03-09 17:41:16 +03:00
fahed
7c1a8fa31a Add NocoDB env vars to CI/CD build step
All checks were successful
Deploy HiHala Dashboard / deploy (push) Successful in 7s
Vite inlines env vars at build time, so they must be available
during the build step via Gitea secrets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:39:43 +03:00
fahed
6cf0bf626b Simplify CI/CD to deploy static frontend only
All checks were successful
Deploy HiHala Dashboard / deploy (push) Successful in 6s
Remove server deployment, dependency install, and systemd restart.
The app connects directly to NocoDB from the browser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:36:46 +03:00
fahed
b7ad978e29 Migrate from Create React App to Vite
All checks were successful
Deploy HiHala Dashboard / deploy (push) Successful in 7s
CRA (react-scripts 5.0.1) is abandoned and incompatible with TypeScript 5.x.
Vite provides faster builds, active maintenance, and native TS5 support.

- Replace react-scripts with vite + @vitejs/plugin-react
- Move index.html to root with script module entry point
- Replace setupProxy.js with vite.config.ts proxy config
- Rename env vars from REACT_APP_ to VITE_ prefix
- Update tsconfig for bundler module resolution
- Add nginx setup script for deployment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:24:11 +03:00
fahed
42cb524cd8 Final NocoDB config update - DailyStats table recreated with correct structure
Some checks failed
Deploy HiHala Dashboard / deploy (push) Failing after 4s
2026-03-09 16:43:07 +03:00
fahed
a1394d4901 Update NocoDB config for Cloudron - fix DailyStats table ID 2026-03-09 16:29:20 +03:00
fahed
3068463995 Update NocoDB config for Cloudron deployment 2026-03-09 16:04:24 +03:00
fahed
97a208734e updates 2026-02-18 14:13:45 +03:00
fahed
0caef0b89a removed /server/node_modules 2026-02-16 11:00:54 +03:00
fahed
9bb4ecb0dd last changes 2026-02-16 10:59:55 +03:00
fahed
e92f11241d feat: add linear regression trendline to revenue charts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:56:49 +03:00
fahed
a71a741f76 feat: add start script to launch NocoDB and React together
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:30:15 +03:00
fahed
d1c500a677 Complete TypeScript migration
- Convert all shared components to TypeScript (.jsx → .tsx)
  - Carousel, ChartCard, EmptyState, FilterControls, StatCard, ToggleSwitch
- Add proper TypeScript interfaces for all component props
- Delete unused dataService.legacy.ts (archived Google Sheets code)
- Build passes successfully
2026-02-04 13:59:56 +03:00
fahed
868f46fc6e chore: migrate to TypeScript
- Convert all .js files to .tsx/.ts
- Add types for data structures (MuseumRecord, Metrics, etc.)
- Add type declarations for react-chartjs-2
- Configure tsconfig with relaxed strictness for gradual adoption
- All components now use TypeScript
2026-02-04 13:45:50 +03:00
fahed
e98bebd60b fix: match refresh button size to other nav buttons 2026-02-04 11:53:18 +03:00
fahed
7e72d6c02d fix: properly detect offline mode when using cached data 2026-02-04 11:49:25 +03:00
fahed
9044ab7da3 feat: VAT toggle + offline mode
- Rename Revenue to GrossRevenue, add NetRevenue (excl. VAT)
- Add VAT toggle (Incl/Excl) on Dashboard and Comparison pages
- Add offline mode with localStorage caching (24h validity)
- Add refresh button and offline indicator in nav
- Remove Google Sheets fallback (archived to dataService.legacy.js)
- Add AR/EN translations for new UI elements
2026-02-04 11:47:42 +03:00
fahed
afe276541f Fix chart data labels RTL alignment issue
- Force LTR direction on chart canvas elements via CSS
- Add locale: 'en-US' to chart options for consistent number formatting
- Add textDirection: 'ltr' to datalabels and tooltip configs
- Fixes background/text misalignment in Arabic RTL mode
2026-02-03 16:40:30 +03:00
fahed
0c7987493e Improve language toggle button design
- Add globe icon to language toggle
- Style with border, proper padding, and hover effects
- Match overall nav design language
- Use Inter font for Arabic mode to show 'EN' consistently
2026-02-03 16:32:31 +03:00
fahed
fa43cf8dd1 Fix chart height - override flex with explicit 380px
- Add .exportable-chart.chart-container rule with flex:none and height:380px
- This overrides the flex:1 that was preventing height from being applied
- Also fixed .chart-section .chart-container to 380px
2026-02-03 16:21:22 +03:00
fahed
1d7389cd43 Improve chart UX: taller charts, controls below header
- Increase chart height from 280px to 380px (more square-like)
- Move controls below chart title (column layout)
- Spread two control groups left/right with space-between
- Make controls more compact (smaller padding, font-size)
2026-02-03 15:53:14 +03:00
fahed
60eda25fe3 Position download button in corner + better Arabic font
- Move export button outside header-actions to enable absolute positioning
- Button now positioned at top-right (LTR) / top-left (RTL)
- Switch from Tajawal to IBM Plex Sans Arabic (slicker, more technical)
- Add RTL-specific font-family in CSS
2026-02-03 15:49:31 +03:00
fahed
12f548fc78 Fix chart export buttons and improve controls UX
- Add missing CSS for .chart-header-with-export layout
- Add .chart-header-actions for horizontal controls alignment
- Make .chart-export-btn.visible always show (was opacity: 0)
- Controls now display in clean horizontal row: title → toggles → tabs → download
2026-02-03 15:43:11 +03:00
fahed
00724aac3d Improve desktop UI readability
Typography improvements:
- Base font size increased to 15px
- Better text color contrast (darker text-secondary/muted)
- Stat card values: 2rem with font-weight 700
- Page titles: 1.75rem with font-weight 700
- Table font: 0.9375rem with better padding
- Toggle switches: larger buttons (0.8125rem, 6px 14px padding)
- Metric selector buttons: 0.8125rem with better padding
- Filter controls: larger labels and inputs
- Period banner: 1.75rem year display
- Metric cards: larger values (1.25rem)
- Nav links: 0.9375rem font size

Visual improvements:
- Subtle box shadows on stat/metric cards
- Better border contrast
- Improved spacing throughout
2026-02-03 15:39:03 +03:00
fahed
eb477158cb Restore translations + fix CSS for new components
- Restored Arabic/English translations from overhaul
- Restored LanguageContext for language switching
- Restored updated components with i18n support
- Kept original CSS from f17e19f (working desktop styling)
- Added missing CSS for new components:
  - .page-title-with-actions
  - .toggle-with-label
  - .period-display-banner

Desktop and Arabic translations both working.
2026-02-03 15:32:52 +03:00
fahed
b2fcb16d12 Restore working state from f17e19f (before mobile overhaul)
Reverting all my changes that broke the desktop layout.
Starting fresh for mobile improvements.
2026-02-03 15:29:03 +03:00
fahed
222d583847 Enhance Carousel with real-time drag feedback
- Track touch position and show live drag offset while swiping
- Add rubber band effect at edges (25% resistance)
- Disable CSS transition during drag for instant response
- Improve accessibility with role/aria attributes
2026-02-03 15:19:33 +03:00
fahed
7ed7af314c Add mobile UX enhancements (scoped to @media queries)
Mobile-only improvements:
- Better touch targets (44px min for accessibility)
- Smoother carousel transitions
- Touch feedback animations
- Bottom nav active indicator
- Chart title padding for toggle overlap
- Period banner stacks vertically on mobile
- Table scroll hint gradient
- Small screen (≤375px) optimizations

All changes inside @media blocks, desktop unaffected
2026-02-03 15:19:01 +03:00
fahed
97afb8b3a7 Fix missing CSS for page-title-with-actions and period-display-banner
Added CSS rules that were missing after restoring from older commit:
- .page-title-with-actions (flex layout for title + toggle)
- .toggle-with-label (Labels On/Off toggle styling)
- .period-display-banner (Comparison page period display)
2026-02-03 15:18:26 +03:00
fahed
480885a8e6 Mobile UX enhancements (desktop unchanged)
- Added mobile-only CSS improvements at end of file
- Enhanced touch targets (min 44px for accessibility)
- Improved carousel with real-time drag feedback and rubber band effect
- Better visual feedback on touch interactions
- Bottom nav active indicator
- Improved stat/chart cards spacing on mobile
- Period banner stacks vertically on mobile
- Table scroll hint with fade gradient
- Extra small screen (≤375px) optimizations
- All changes scoped to @media (max-width: 768px)
2026-02-03 15:13:34 +03:00
fahed
0e5d285680 feat: Complete mobile UX/UI overhaul
Major improvements:
- New CSS design system with custom properties (tokens)
- Consistent spacing scale (4px base)
- Touch-friendly sizing (44px min targets)
- Improved Carousel with better touch handling and rubber-band effect
- Enhanced FilterControls (auto-collapse on mobile)
- Better stat card styling with change indicators
- Refined chart cards and toggle switches
- Smoother transitions and micro-interactions
- Better RTL support
- Print styles
- Responsive breakpoints for tablet (1024px), mobile (768px), and small mobile (375px)
- Cleaner typography hierarchy
- Subtle shadows and depth

Components updated:
- App.css: Complete rewrite with design tokens
- Carousel.jsx: Better touch gestures with velocity detection
- StatCard.jsx: Improved change indicator styling
- FilterControls.jsx: Auto-collapse on mobile
- EmptyState.jsx: Better accessibility
- ChartExport.js: Cleaned up unused imports
2026-02-03 15:02:29 +03:00
fahed
f17e19f3f8 Add PNG export to Capture Rate chart 2026-02-02 18:08:34 +03:00
fahed
b51edaeeb8 Add top padding to charts when labels shown
Prevents data labels from being clipped at top of chart container
2026-02-02 17:42:10 +03:00
fahed
22878d5a16 Add PNG export for charts
- Hover any chart to reveal download button
- Exports with white background and padding
- Works on Dashboard and Comparison pages
2026-02-02 17:39:11 +03:00
fahed
a2e7aa16cd Add Slides builder, data source selector, fix cross-year labels
Features:
- Slides page: build presentations with configurable charts per slide
- Export slides as HTML zip
- Data source dropdown (Museums active, Coffees/eCommerce placeholders)
- Renamed app to 'HiHala Data' with 'Museums' as subtitle

Fixes:
- Cross-year period labels now show 'Nov 25–Jan 26' instead of misleading year
- Period display boxes updated to use smart labels

UI:
- New nav link for Slides
- Mobile nav updated
- Data source select styled to match brand
2026-02-02 17:36:15 +03:00
fahed
75a11170f6 Add January 2026 sales data import scripts
- process_daily_sales.py: Parse XLS sales reports and extract museum-by-museum data
- january_2026_data.csv: Verified data for all 31 days, 4 museums (124 records)

Data imported to NocoDB DailyStats table:
- Qur'an Museum: 8,493 visits, 196,450 SAR
- Revelation Museum: 68,449 visits, 1,637,290 SAR
- Creation Story Museum: 32,926 visits, 697,225 SAR
- The Best Of Creation: 15,110 visits, 263,783 SAR
- Total: 124,978 visits, 2,794,748 SAR
2026-02-02 16:57:53 +03:00
fahed
61187b8a2e feat: update branding with official HiHala logo + 'Museums Data'
- Add official HiHala logo SVG (text portion from v1.5)
- Replace text-based nav brand with logo image + 'Museums Data'
- Update data source to default to NocoDB with Sheets fallback
- Move all credentials to environment variables (.env.local)
2026-02-02 14:08:17 +03:00
fahed
c0c36c7904 feat: URL state for shareable filter views
- Dashboard filters (year, district, museum, quarter) sync to URL
- Comparison filters (preset, dates, district, museum) sync to URL
- Users can now share links with specific filter configurations
- Reset filters also clears URL parameters
- Add useUrlState hook (unused but available for future use)
2026-02-02 13:58:34 +03:00
fahed
8a3b6a8d2e refactor: major architecture improvements
Security:
- Remove exposed NocoDB token from client code
- Add .env.example for environment variables

Shared Components:
- Carousel: touch/keyboard navigation, accessibility
- ChartCard: reusable chart container
- EmptyState: for no-data scenarios
- FilterControls: collapsible filter panel with reset button
- StatCard: metric display with change indicator
- ToggleSwitch: accessible radio-style toggle

Architecture:
- Create src/config/chartConfig.js for shared chart options
- Extract ChartJS registration to single location
- Reduce code duplication in Dashboard and Comparison

UX Improvements:
- Add empty state when filters return no data
- Add Reset Filters button to filter controls
- Add skeleton loader CSS utilities
- Improve focus states for accessibility
- Use shared components in Dashboard and Comparison
2026-02-02 13:50:23 +03:00
fahed
24fa601aec feat(dashboard): add data labels toggle, dual-axis capture rate chart, mobile bottom nav
- Global data labels toggle in header (works on Dashboard & Comparison pages)
- Labels show formatted values (K/M suffix, max 2 decimals) with white pill background
- Capture Rate chart now shows pilgrims as curved line on right Y-axis
- Revenue Trends toggle moved to top-right corner of chart container
- Mobile: bottom navigation bar with Dashboard, Compare, Labels toggle
- Mobile: top nav simplified to brand only, bottom nav is thumb-friendly
2026-02-02 13:39:56 +03:00