52 Commits

Author SHA1 Message Date
b9b9619425 Add cURL export functionality with custom icon and extensible architecture 2026-01-12 22:27:38 +01:00
d2c7c09312 FIX: Change style of stack switcher button (light theme) 2026-01-12 10:29:40 +01:00
465d91e679 Change style of stack switcher button 2026-01-11 22:37:10 +01:00
cbf4d73190 Change application ID from cz.vesp.roster to cz.bugsy.roster 2026-01-06 17:11:10 +01:00
4ecc7901b8 Fix variable indicators and add project caching 2026-01-06 01:45:36 +01:00
fc4898cfde Replace magic numbers with named constants 2026-01-05 11:56:23 +01:00
4006ed7c34 Replace print statements with proper logging 2026-01-05 11:46:15 +01:00
74acbcca7c Add input validation for project and request names 2026-01-05 11:38:58 +01:00
a8a372d83d Add type annotations to window.py 2026-01-05 11:31:59 +01:00
31c7b383b4 Fix toast notifications by adding AdwToastOverlay 2026-01-05 11:14:31 +01:00
1384e2c4fd Implement preprocessing scripts with request modification and variable access 2026-01-02 01:04:24 +01:00
032b487c4a Add roster API for scripts to set environment variables 2026-01-01 02:27:22 +01:00
43a9ea402c Track script changes and show modified flag when scripts are edited 2025-12-31 01:59:49 +01:00
4bb3872ebd Save and restore scripts with saved requests to projects 2025-12-31 01:46:43 +01:00
b923a4b83e Add Scripts feature with JavaScript postprocessing
Implements JavaScript-based postprocessing for HTTP responses using gjs.
Adds Scripts tab with preprocessing (disabled) and postprocessing (functional) sections.
2025-12-31 01:32:14 +01:00
a62c37f5f2 Replace send button text with play icon 2025-12-30 23:32:41 +01:00
4b43a509b0 Show environment selector when loading project request into empty tab 2025-12-30 15:59:51 +01:00
532e71172d Save substituted values to history instead of variable templates 2025-12-30 14:38:25 +01:00
89f50d1304 Implement environment variable substitution in requests 2025-12-30 12:54:26 +01:00
dfe2a9a360 Add environment management for projects with variable support 2025-12-30 12:37:13 +01:00
e8f8efbd09 Add history deletion features - clear all in preferences and delete individual items 2025-12-24 20:21:47 +01:00
0c139d2a3b Fix history expander button functionality - set both min and max content heights 2025-12-24 13:13:04 +01:00
bfe3463b52 Refactor to use AdwToolbarView like Epiphany
- Replace manual GtkBox layout with AdwToolbarView
- Add AdwHeaderBar and AdwTabBar as separate top bars
- Remove all custom CSS for header bar height matching
- AdwToolbarView automatically ensures consistent bar styling

This follows the proper libadwaita pattern used by GNOME Web.
2025-12-24 03:55:13 +01:00
7cf03a2f8b Add style classes to distinguish header bars
- Add "sidebar-header" and "main-header" style classes
- Target each header bar specifically in CSS
- Make tab bar ultra-compact to fit within header height
- Reduce tab padding and remove all internal margins
2025-12-24 03:48:50 +01:00
5334902d7a Fix CSS error and history loading
- Remove invalid max-height CSS property (GTK doesn't support it)
- Fix loading from history: update widget instead of calling removed method
- Update tab page title when loading from history
2025-12-24 03:45:51 +01:00
74250c36b7 Fix header bar height matching properly
- Revert show-title=False on main header (was hiding tabs)
- Use CSS to force both header bars to exact same height (46px)
- Remove vertical padding from header bars
- Keep tab bar compact to fit within fixed height
2025-12-24 03:40:45 +01:00
9c17f452bf Fix critical bugs from second round of testing
1. Fixed infinite loop when closing last tab:
   - Return False instead of True when page already removed (prevents double-processing)
   - Remove from tracking BEFORE calling close_page_finish to prevent re-trigger
   - Properly schedule new tab creation only once

2. Fixed modified flag not clearing after save:
   - Update widget.original_request in _mark_tab_as_saved
   - Update widget.modified = False
   - Manually call _on_tab_modified_changed to clear indicator
   - Update tab page title when saving

3. Fixed header bar height and left spacing:
   - Added CSS to reduce headerbar min-height to 38px
   - Set headerbar padding-left to 0px to eliminate left gap
   - Made tabs more compact (min-height: 26px, reduced padding)
   - Reduced tabbar padding and margins

All critical issues from testing resolved!
2025-12-24 03:07:11 +01:00
ad0e1886cc Fix all reported issues from testing
1. Modified indicator (*) now shows:
   - Added GObject signal 'modified-changed' to RequestTabWidget
   - Connect to signal in window.py to update tab page indicator
   - Indicator shows dot-symbolic icon when modified

2. History panel now visible and populated:
   - Restored history panel in main-window.ui with vertical paned layout
   - Added _load_history() call back to __init__
   - History entries now display in bottom panel

3. Saving requests now works:
   - Fixed on_save_request_clicked to get request from widget.get_request()
   - Removed dependency on obsolete _build_request_from_ui method

4. Loading saved requests fixed:
   - Updated _on_load_request to properly update widget and tab page
   - Correctly sets widget.original_request and widget.modified
   - Updates tab page title when loading into empty tab
   - Properly handles copy vs. linked request logic

All issues from user testing are now resolved!
2025-12-24 02:20:55 +01:00
89d43b66b5 Complete window.py cleanup - remove 400 lines of obsolete code
Removed obsolete UI methods now handled by RequestTabWidget:
- _setup_method_dropdown, _setup_request_tabs, _setup_response_tabs
- _build_request_from_ui, _load_request_to_ui
- _display_response, _display_error
- _extract_content_type, _get_language_from_content_type, _format_response_body
- on_add_header_clicked, _add_header_row, _on_header_remove
- _setup_sourceview_theme, _setup_request_body_theme
- _update_tab_indicator (now handled internally by widgets)

Added new HTTP handling:
- _on_send_clicked now works with RequestTabWidget
- Properly handles request/response through widget interface
- Updates history after requests complete

Result: 1237 lines → 841 lines (-396 lines, -32%)
App builds and runs successfully!
2025-12-24 02:05:37 +01:00
a09060e3d4 WIP: Refactoring window.py for per-tab widgets 2025-12-24 01:56:40 +01:00
d912f3479a WIP: Initial AdwTabBar/AdwTabView implementation
This is a work-in-progress implementation of AdwTabBar/AdwTabView.
Current issues:
- Tab bar height is too large
- Large gap on left side of header
- Architecture needs refactoring: AdwTabView should contain per-tab UI widgets

Next step: Properly refactor so each tab has its own complete UI widget tree.
2025-12-24 01:47:45 +01:00
0a5c1c59af Maximize header space and enable tab scrolling
Remove application title from main header bar and wrap tabs in scrollable container. This prevents window resizing when many tabs are open and follows modern GNOME app patterns.
2025-12-23 12:36:59 +01:00
2ff4a39e04 Polish tab UI styling with enhanced visual design
Document tabs (header bar):
- Add rounded corners with subtle backgrounds
- Highlight active tabs with accent color and bottom border
- Improve hover states with smooth 200ms transitions
- Enhance close button visibility and hover effects
- Reduce spacing for more compact appearance
- Increase tab name truncation limit to 25 chars

Stack switchers (Headers/Body tabs):
- Add pill-style rounded buttons (6px radius)
- Style active tabs with accent colors and bold text
- Add smooth crossfade transitions (150ms)
- Improve spacing with 8px top/bottom margins

All styling uses GNOME color tokens for consistent theming across
light and dark modes.
2025-12-23 10:27:40 +01:00
b49d5ab7fd Migrate from HTTPie to libsoup3 for HTTP requests
Replace HTTPie subprocess calls with native libsoup3 async API. This
eliminates external dependencies and uses GNOME-standard async patterns.

Changes:
- Rewrite http_client.py to use libsoup3 Session and Message APIs
- Replace threading with GLib async callbacks in window.py
- Remove HTTPie dependency from Flatpak manifest
- Update documentation to reflect libsoup3 usage

Benefits:
- No external dependencies (HTTPie removed)
- Native GLib async integration (no threading complexity)
- Better performance with connection pooling and HTTP/2 support
- Cleaner codebase following GNOME development patterns
2025-12-22 23:34:05 +01:00
a4b6966bc3 Expand headers area to show multiple rows
The headers scrolled window now fills available vertical space, allowing users to view and edit multiple headers simultaneously without scrolling.
2025-12-22 02:27:38 +01:00
6f65baa37f Add Ctrl+S keyboard shortcut for saving requests 2025-12-22 02:12:01 +01:00
97751df18a Add smart tab management and duplicate request handling
Duplicate Name Detection:
- Warn when saving request with existing name in same project
- Show overwrite confirmation dialog with destructive styling
- Update existing request on overwrite (preserves ID, updates timestamp)
- Request names are unique within projects (but can duplicate across projects)

Save Request Improvements:
- Clear modified flag (•) when request is saved or overwritten
- Pre-fill save dialog with original request name and project
- Pre-fill save dialog with tab name for copy tabs
- Auto-select text in name field for easy editing

Smart Tab Loading:
- Switch to existing tab when loading unmodified saved request
- Create new tab only when needed (modified or doesn't exist)
- Avoid duplicate tabs for same request
- Show toast notification when switching to existing tab

Copy Tab Management:
- Create numbered copies when loading modified request again
- Naming: "ReqA (copy)", "ReqA (copy 2)", "ReqA (copy 3)", etc.
- Copy tabs are NOT linked to saved request (no saved_request_id)
- Copy tabs marked as unsaved (•) to encourage saving with new name
- Unique copy names prevent conflicts

Tab Response Persistence:
- Restore response when switching between tabs
- Each tab maintains independent response state
- Clear response area when switching to tab without response

Project Manager:
- Add find_request_by_name() for duplicate detection
- Add update_request() for overwriting existing requests
- Update request modified_at timestamp on save

Files Modified:
- src/project_manager.py: Duplicate detection and update methods
- src/window.py: Smart tab management and copy handling
2025-12-22 02:03:35 +01:00
47225cf254 Add header change tracking to tab modification detection
Previously, changes to HTTP headers (adding, editing, or removing headers)
were not being tracked, causing tabs to not show the modified indicator (•)
when only header values changed.

Changes:
- Add 'changed' signal to HeaderRow widget that emits when key or value entries change
- Connect HeaderRow 'changed' signal to window's _on_request_changed handler
- Real-time tab modification tracking now includes all header edits

This completes the comprehensive change tracking system for tabs:
- URL changes ✓
- Method changes ✓
- Body changes ✓
- Syntax changes ✓
- Header changes ✓ (now fixed)
2025-12-22 00:49:54 +01:00
c3430058b9 Remove unnecessary warning dialog when loading from history. 2025-12-21 00:23:51 +01:00
f70bf4f36d Add unsaved change tracking and smart tab loading
Change Tracking:
- Track modifications to URL, method, body, syntax, and headers
- Show • indicator on modified tab labels
- Real-time update of tab state on any change
- Each tab independently tracks its modification state

Unsaved Change Warnings:
- Warn when closing tabs with unsaved changes
- Warn when closing application with any unsaved tabs
- Destructive action styling for close confirmations
- Smart messages: single tab vs multiple tabs

Smart Tab Loading:
- Detect empty "New Request" tabs (no URL, body, or headers)
- Replace empty tabs when loading from sidebar/history
- Create new tab when current tab has changes
- Seamless workflow without unnecessary tabs

Application Close Protection:
- Prevent accidental data loss on app close
- Check all tabs for unsaved changes
- Show confirmation dialog before closing
- Works with all close methods (X, Alt+F4, Quit)

Bug Fixes:
- Fix signal handler to accept variable arguments
- Proper handling of notify::selected signals
2025-12-21 00:08:29 +01:00
040f2012d7 Add close tab buttons 2025-12-20 23:43:51 +01:00
df30ad6388 Add Tabbed interface
- Add New Request Button
   - Implement Tab Management System
   - Opening saved requests from sidebar creates new tabs
   - Response Tracking
2025-12-20 18:56:11 +01:00
c76d574832 Add syntax highlighting and formatting for request/response bodies
- Add automatic JSON and XML formatting for response bodies
- Replace TextView with GtkSourceView for syntax highlighting
- Add syntax selector dropdown (RAW/JSON/XML) for request body
- Use Source Code Pro font (12pt) for better readability
- Integrate with GNOME theme (Adwaita light/dark)
- Add line numbers and current line highlighting
- Persist syntax selection when saving/loading requests
- Maintain backward compatibility with existing saved requests
2025-12-20 18:17:22 +01:00
9806333aa6 Add response body color highlighting 2025-12-20 17:52:59 +01:00
871c3cd90b Replace collapsible history panel with resizable vertical pane 2025-12-18 16:58:43 +01:00
1b262bc8be Remove foldable sidebar functionality
Simplify left sidebar by removing fold/unfold functionality while
keeping all project icon selection features:
- Remove GtkStack-based sidebar switching
- Remove fold/unfold buttons
- Delete SlimProjectItem widget
- Keep IconPickerDialog and project icons
- Keep Edit Project dialog with icon selection

The sidebar is now a static pane that cannot be folded or hidden.
2025-12-18 16:19:30 +01:00
3cc96a82d6 Add foldable sidebar with custom project icons
Implement a collapsible sidebar that can be folded to show just project
icons in a slim strip, or expanded to show full project details. Projects
can now have custom icons selected from a 6x6 grid of 36 symbolic icons.

Features:
- Foldable sidebar with toggle button (fold/unfold)
- Slim sidebar view showing only project icons when folded
- Custom project icons with 36 symbolic icon choices
- Icon picker dialog with 6x6 grid layout
- Edit Project dialog (renamed from Rename) with name and icon selection
- Project icons displayed in both full and slim sidebar views
- Smooth transitions between folded/unfolded states
- Click on slim project icon to unfold sidebar

Technical changes:
- Add icon field to Project model with default "folder-symbolic"
- Create constants.py with PROJECT_ICONS list (36 symbolic icons)
- Implement IconPickerDialog with grid layout and selection
- Create SlimProjectItem widget for folded sidebar view
- Update ProjectManager.update_project() to handle icon changes
- Restructure sidebar using GtkStack for full/slim view switching
- Update project-item.ui to display project icon
- Change "Rename" menu to "Edit Project" with icon picker
- Add fold/unfold buttons with sidebar-show icons
- Update build system with new files and resources
2025-12-18 15:37:29 +01:00
ecc9094514 Add left sidebar for managing saved requests in projects
Implement a 3-column layout with a collapsible sidebar for organizing
and managing HTTP requests within projects. Requests are stored in
~/.roster/requests.json for easy git versioning.

Features:
- Create, rename, and delete projects
- Save current request to a project with custom name
- Load saved requests with direct click (no confirmation dialog)
- Delete saved requests with confirmation
- Expandable/collapsible project folders
- Context menu for project actions

Technical changes:
- Add SavedRequest and Project data models with JSON serialization
- Implement ProjectManager for persistence to ~/.roster/requests.json
- Create RequestItem and ProjectItem widgets with GTK templates
- Restructure main window UI to nested GtkPaned (3-column layout)
- Add project management dialogs using AdwAlertDialog
- Update build system with new source files and UI resources
2025-12-18 15:16:21 +01:00
eddaf21a02 Make Request and Response sections equal width
Replaces AdwOverlaySplitView with GtkPaned to allow both sections to have equal width by default. The divider automatically centers at 50/50 split when the window is first shown, while still allowing users to adjust it as needed.
2025-12-18 12:38:07 +01:00
357204b81c Replace tab bars with stack switchers for simpler navigation
Replaces AdwTabView/AdwTabBar with GtkStack/GtkStackSwitcher in both request and response sections to prevent tab reordering and provide a more compact UI without close buttons.
2025-12-18 12:22:47 +01:00