The Progress module provides visual feedback during long-running vault operations, including multi-step progress indicators with messages and completion status.
Progress indicators improve user experience by showing operation status and preventing timeout confusion during network operations. All major vault operations (upload, download, share, delete, purge) use progress feedback.
Display a progress step with step number and message.
Function Signature:
func PrintProgressStep(step int, totalSteps int, message string)Parameters:
step: Current step number (1-indexed)totalSteps: Total number of steps in operationmessage: Status message to display
Example Output:
[1/5] Encrypting file...
[2/5] Uploading to GitHub...
[3/5] Updating vault index...
[4/5] Finalizing...
[5/5] Complete!
Display a completion message with checkmark.
Function Signature:
func PrintCompletionLine(message string)Parameters:
message: Success message to display
Example Output:
✔ Upload successful.
Display an error message with error symbol.
Function Signature:
func PrintErrorLine(message string)Parameters:
message: Error message to display
Example Output:
❌ Upload failed: insufficient permissions
Clear progress lines from terminal (currently a no-op for compatibility).
Function Signature:
func ClearProgress()func Upload(session *Session, vaultPath string, localPath string) error {
PrintProgressStep(1, 5, "Reading file...")
// Read file...
PrintProgressStep(2, 5, "Generating encryption key...")
// Generate key...
PrintProgressStep(3, 5, "Encrypting file content...")
// Encrypt...
PrintProgressStep(4, 5, "Pushing to GitHub...")
// Push...
PrintProgressStep(5, 5, "Updating vault index...")
// Update index...
PrintCompletionLine("Upload successful.")
return nil
}err := Download(session, vaultPath, localPath)
if err != nil {
PrintErrorLine(fmt.Sprintf("Download failed: %v", err))
return err
}| Operation | Steps | Purpose |
|---|---|---|
| Upload | 5 | Read → Encrypt → Upload → Index → Complete |
| Download | 5 | Fetch → Decrypt → Write → Verify → Complete |
| Share | 4 | Fetch → Encrypt → Share → Index |
| Delete | 4 | Fetch → Remove → Push → Update |
| Purge | 3 | Prepare → Wipe → Clean |
Steps are displayed as [current/total] followed by the message:
[1/5] Message here...
[2/5] Next step...
- ✔ (checkmark) - Success/completion
- ❌ (cross mark) - Error/failure
Progress messages are printed to standard output using fmt.Println() and fmt.Printf(). The terminal handles line wrapping and character encoding.
Progress updates introduce minimal overhead:
- Single
fmt.Printcall per step - No network delays
- Straightforward string formatting
The visual feedback improvement outweighs the negligible performance cost.
Potential improvements to progress module:
- Progress bars with percentage completion
- Spinner animations for indeterminate operations
- Custom progress output formats
- Suppression flag for non-interactive mode
- Speed/rate display (e.g., "2.3 MB/s")
- Time estimates for long operations
- Upload Module - File upload with progress
- Download Module - File download with progress
- Share Module - File sharing with progress
- Delete Module - File deletion with progress
- Purge Module - Vault wipe with progress