Commit graph

7 commits

Author SHA1 Message Date
Benedikt Willi
a9d52e49c8 Improve tab bar visual integration with modern browser-like styling
Enhanced tab widget design:
- Unified tab widget with integrated close button (no visual separation)
- Close button on the right with rounded right corners
- Tab button with rounded left corners for seamless integration
- Custom CSS styling for professional appearance
- Hover effects: close button highlights in warning color
- Tab highlights as suggested-action when active

Visual improvements:
- Tabs have rounded corners (4px radius)
- Proper borders matching theme colors
- Better padding and spacing
- Flat buttons by default except active tab
- Close button marked with ✕ instead of ×
- Better visual feedback on hover

UX improvements:
- Tooltips on all buttons (tab URL, close tab, new tab)
- Small square close button (32px) for easy clicking
- Active tab uses blue suggested-action styling
- Tabs show full URL on hover
- New tab uses about:startpage instead of example.com

CSS styling:
- Theme-aware colors using @view_bg_color, @borders, @warning_color
- Proper border-radius on tab and close button
- Visual separation between tab and close button
- Hover state for better feedback

All tests passing (15/15)
2026-01-09 14:34:48 +01:00
Benedikt Willi
3bad301bcc Refactor browser chrome to use libadwaita for modern GNOME UI
Benefits of libadwaita:
- Modern, polished UI following GNOME Human Interface Guidelines
- Professional HeaderBar with proper navigation button grouping
- Better visual hierarchy and spacing
- Consistent with modern GNOME applications
- Built on GTK 4, same foundation as before

Changes:
- Replace Gtk.ApplicationWindow with Adw.ApplicationWindow
- Use Gtk.HeaderBar for professional top bar with navigation buttons
- Improve address bar presentation (placeholder text, better sizing)
- Add CSS classes for consistent styling (linked, suggested-action, toolbar)
- Better tooltip support for navigation buttons
- Add visual frame around tabs bar
- Improved status bar styling with toolbar class
- Adw.init() called during window creation

UI Improvements:
- Navigation buttons (Back/Forward/Reload) now grouped with linked styling
- Go button highlighted with suggested-action styling
- Address bar uses placeholder text instead of default value
- Better spacing and margins throughout
- More professional appearance overall

All tests passing (23/23 in core modules)
2026-01-09 14:31:55 +01:00
Benedikt Willi
fab66d1528 Implement Jinja2 templates for startpage and error pages
Features:
- Add Jinja2 template engine for page rendering
- Create startpage with Bowser branding and version info
- Create error page templates for 404, 500, and network errors
- Support for about:startpage special URL
- Custom error message support in templates
- Graceful fallback rendering if template fails
- Browser now starts with startpage when no URL provided

Templates:
- assets/pages/startpage.html - Beautiful purple gradient intro page
- assets/pages/error_404.html - Pink gradient 404 error page
- assets/pages/error_500.html - Red gradient 500 error page
- assets/pages/error_network.html - Orange gradient network error page

Code:
- src/templates.py - Template rendering utilities with Jinja2
- Updated main.py to use startpage as default
- Updated Frame.load() to handle about: URLs and render errors with templates
- Added 7 comprehensive template tests

All 62 core tests passing (excluding GTK-dependent tests)
2026-01-09 14:24:01 +01:00
Benedikt Willi
283dae295c Implement HTTP redirect following
- Support for 301, 302, 303, 307, 308 redirects
- Automatic Location header following
- Relative URL resolution for redirects
- Max redirect limit (default 10) to prevent infinite loops
- 303 (See Other) automatically changes method to GET
- 4 new unit tests for redirect functionality
- All 73 tests passing
2026-01-09 14:11:46 +01:00
Benedikt Willi
ae6fcbfab4 Add comprehensive test suite with pytest
- Add tests for URL parsing, cookies, HTML/CSS parsing
- Add tests for browser/tab management and history
- Add tests for layout and rendering components
- Configure pytest with coverage reporting
- Add test documentation and runner commands
- All 54 tests passing
2026-01-09 13:37:21 +01:00
Benedikt Willi
f1e4957e70 Initial commit: Setup Bowser educational web browser
- Added README.md with project description, building instructions, and development milestones.
- Created the project structure with directories for source code, assets, and tests.
- Implemented a basic entry point in main.py with argument parsing and logging configuration.
- Developed preliminary browser orchestration in browser.py, including tab management and navigation.
- Established a GTK-based UI framework in chrome.py, integrating key UI components including the address bar and navigation buttons.
- Incorporated HTTP request handling in http.py, with enhanced logging of requests and responses.
- Added initial assets: logo and images for browser UI.
- Configured dependencies in pyproject.toml for development and runtime environments.
- Initialized version control with uv.lock for dependency management.
2026-01-09 13:31:48 +01:00
Benedikt Willi
b0e693e50c Initial bowser project scaffold 2026-01-09 12:20:46 +01:00