- Add filter dialog with tabs for event types, categories, persons, and date range
- Implement EVENT_CATEGORIES mapping for event categorization
- Add filter state management (event types, date range, person, category filters)
- Fix EventType normalization for dictionary lookups and comparisons
- Add _normalize_event_type() helper method for consistent EventType handling
- Update event collection to store all events and apply filters
- Add filter button to toolbar with active state indication
- Support multiple filter types that can be combined
- Fix event collection bug (events now stored in all_events before filtering)
- Add _person_matches_handle() helper method to eliminate code duplication
- Replace 3 instances of 'person and person.get_handle() == handle' pattern
- Fix remaining hardcoded font string to use FONT_FAMILY constant
- Improve code consistency and maintainability
Benefits:
- Reduced code duplication
- Centralized person handle comparison logic
- All font strings now use constants
- More readable and maintainable code
- Add comprehensive docstring for __init__ method
- Initialize _temp_surface in __init__ instead of lazy initialization
- Extract font constants (FONT_FAMILY, FONT_SIZE_NORMAL, FONT_SIZE_SMALL, FONT_SIZE_LARGE)
- Replace all hardcoded font strings with constants
- All methods now have docstrings (100% coverage)
Benefits:
- Better initialization clarity
- Centralized font configuration
- Complete documentation coverage
- More maintainable code
Phase 1 - Quick Wins:
- Extract date range calculation to _calculate_date_range() with caching
- Extract Y position calculation to _calculate_y_position()
- Add remaining constants (TOOLTIP_MAX_WIDTH, LABEL_BACKGROUND_PADDING, LABEL_BACKGROUND_RADIUS)
Phase 2 - Refactoring:
- Replace tuple indexing with TimelineEvent dataclass for type safety
- Break down collect_person_events into smaller methods:
* _collect_person_event_refs()
* _process_event_ref()
* _collect_person_events()
- Break down show_tooltip into helper methods:
* _format_person_tooltip()
* _format_single_event_tooltip()
* _get_or_create_tooltip_window()
- Break down draw_event_marker into helper methods:
* _draw_marker_shadow()
* _draw_marker_gradient()
- Break down on_draw into helper methods:
* _draw_background()
* _draw_no_events_message()
* _draw_timeline_axis()
* _draw_events()
Phase 3 - Enhancements:
- Add comprehensive type hints to all methods
- Improve error handling with specific exceptions (AttributeError, KeyError, ValueError)
- Add logging module with appropriate log levels
- Improve all docstrings with parameter and return documentation
- Reuse tooltip window instead of recreating each time
- Improve cache management with hash-based keys instead of context comparison
Code Quality Improvements:
- Type safety: TimelineEvent dataclass replaces error-prone tuple indexing
- Maintainability: Methods are shorter and more focused (28 → 40+ methods)
- Performance: Better caching with hash-based keys
- Readability: Clear method names and comprehensive docstrings
- Debugging: Logging for error tracking
- IDE support: Type hints improve autocomplete and error detection
All linter errors resolved. Code compiles successfully.
- Remove expanded_event_index variable and all related logic
- Remove is_expanded parameters from methods
- Remove expanded field from event tuples (now 6 elements instead of 7)
- Remove EXPANDED_HEIGHT constant
- Remove expanded text display logic from draw_event_label
- Simplify event structure: (date_sort, date_obj, event, person, event_type, y_pos)
- Events now always show single-line text
- Clicking events only selects person (no expansion)
Result: Cleaner code, simpler behavior, reduced file size (49KB from 52KB)
- Allow clicking anywhere on event line to select person (like selecting event)
- Selected events always show single-line text (no multi-line expansion)
- Force is_expanded=False for selected events to prevent text switching
- Always collapse expanded events when selecting person
- Selection and expansion are now completely separate actions
- Move vertical connection line from timeline_x - 40 to x=5
- Position line clearly to the left of year labels (x=90-130)
- Horizontal lines connect vertical line to each event marker
- Improved visual hierarchy: vertical line → year labels → timeline → events
- Fix mouse coordinate transformation to account for zoom level
- Enable whole-line selection (click anywhere on event line to select person)
- Update tooltip to show date first, then event type
- Make connection lines more visible with increased opacity and width
- Improved click detection using scaled coordinates
- Expanded clickable area to include both marker and label regions
- Added 12 different event types (Baptism, Education, Occupation, etc.)
- Fixed missing event references by storing and reusing original events
- Made event generation deterministic with random seed
- Updated gen_person to return both XML and tuple format for event reuse
- All event references now properly defined and validated
- Demo family now includes 240+ additional events for comprehensive testing
- Implement detect_label_overlaps() to prevent text label overlaps
- Automatically adjust Y positions while maintaining chronological order
- Enhanced tooltips to show all events for a person, not just hovered event
- Added person selection on event marker click
- Implement draw_person_connections() to visually connect selected person's events
- Selected person's events highlighted with blue color and connecting lines
- Click on marker selects person, click on label expands event details
- Fixed EventType objects not being hashable by extracting integer value
- Fixed UnboundLocalError by removing variable shadowing of translation function _
- Updated all tuple unpacking to use proper variable names instead of _
- All event types now properly supported with color/shape mapping
- Plugin fully compatible with Gramps 5.1
- Fix get_pixel_size() usage in draw_year_markers() method
- Replace incorrect get_extents() with get_pixel_size() for text measurement
- Verified compatibility with Gramps 5.1.7
- All required APIs and methods confirmed available
- Replace get_extents() with get_pixel_size() for correct text measurement
- Fixes ValueError: not enough values to unpack error
- get_pixel_size() returns (width, height) tuple directly in pixels
- Create interactive preview page showing timeline visualization
- Display demo family events (Smith family) with color-coded markers
- Responsive design with modern styling
- Shows birth (green), death (red), and marriage (blue) events
- Includes year markers and event details
- Implement build_tree() method required by NavigationView
- Calls goto_handle() with active family to rebuild display
- Fixes TypeError when loading MyTimeline view
- Add parentin references for fathers and mothers
- Add childof references for children
- Regenerate person XMLs with correct family relationships
- Fixes import errors about missing bidirectional references
- Add generate_demo_family.py script to generate demo data
- Add demo_family.gramps with large family tree:
* 2 parents (John and Mary Smith)
* 15 children
* 5 spouses
* ~20 grandchildren
* Multiple families with marriage events
* Birth and death events for all members
- Perfect for testing the MyTimeline plugin with real data