Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quo-client-ui"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
license = "GPL-3"
authors = ["Protoqol <open-source@protoqol.nl"]
Expand Down
61 changes: 56 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
![Quo Preview](https://cms.protoqol.nl/assets/2ecc5f44-5fe5-4f15-95d6-ba365f4fcd5c)

![Latest Release](https://img.shields.io/github/v/release/Protoqol/Quo?style=flat-square&color=%23ec135b)

Quo is a cross-platform variable dumper designed to make debugging easier. It receives data from your application and
displays it in a clean desktop interface, allowing you to inspect complex values in real-time without cluttering your
terminal or browser console.

> **Note**: Quo is currently undergoing a significant rebuild, transitioning from Electron to Tauri for better
> performance and a smaller footprint.

## Features

- **Real-time Inspection**: See variables as they are dumped from your code.
Expand All @@ -18,7 +17,7 @@ terminal or browser console.

Integrating Quo into your workflow is a simple two-step process.

1. **Install the Desktop App**: [Download the latest version here](/download) or via the release page on GitHub for your
1. **Install the Desktop App**: [Download the latest version here](https://quo.protoqol.sh/download?utm_source=github) or via the release page on GitHub for your
operating system.
2. **Add a Companion Package**: Choose the package for your language below and follow the installation instructions.

Expand All @@ -28,9 +27,61 @@ Integrating Quo into your workflow is a simple two-step process.

Use the `quo-rust` crate to send variables with simple macro calls.

Add `quo` to your `Cargo.toml` under `dependencies`:

```toml
[dependencies]
quo = { version = "0.1", package = "quo-rust" }
```

To enable additional data capture, use feature flags:

```toml
[dependencies]
# Enable specific features
quo = { version = "0.1", package = "quo-rust", features = ["stack-trace", "system-info", "hashing"] }

# Or enable everything
quo = { version = "0.1", package = "quo-rust", features = ["full"] }
```

### Available Features

- `stack-trace`: Captures the call stack and the caller function name.
- `system-info`: Captures current CPU and memory usage of the process.
- `hashing`: Generates a reproducible grouping hash for variables (`var_type:name:origin`), allowing the Quo client to group and diff values over time.
- `full`: Enables all the above features.

Basic info like **Thread ID/Name**, **Runtime Environment** (OS/Arch), and **Memory Address** are included by default.

### Quick Start

Using `quo!()` macro:

```rust
use quo::quo;

#[derive(Debug)]
struct User {
id: u32,
username: String,
}

fn main() {
let user_id = 42;
let user = User { id: 1, username: "jdoe".to_string() };

// Dump a single variable
quo!(user_id);

// Dump multiple variables at once
quo!(user_id, user);
}
```

---

## PHP (work in progress)
## PHP [`quo-php`](https://github.com/Protoqol/Quo-php)

The PHP companion package allows you to dump values from any PHP application.

Expand Down
6 changes: 3 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema" : "https://schema.tauri.app/config/2",
"productName": "quo-client",
"version" : "0.1.0",
"productName": "Quo debugger",
"version" : "0.1.1",
"identifier" : "protoqol.quo-client.com",
"build" : {
"beforeDevCommand" : "trunk serve",
Expand All @@ -14,7 +14,7 @@
"windows" : [
{
"fullscreen" : false,
"title" : "Quo",
"title" : "Quo debugger",
"width" : 1600,
"height" : 900,
"minWidth" : 600,
Expand Down
10 changes: 5 additions & 5 deletions src/atoms/test_dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use leptos::prelude::*;
pub fn TestDump() -> impl IntoView {
#[cfg(debug_assertions)]
{
use quo::quo;
//

fn test_str() {
let cool_variable = "Test variable";
quo!(cool_variable);
// quo!(cool_variable);
}

fn test_struct() {
Expand All @@ -28,15 +28,15 @@ pub fn TestDump() -> impl IntoView {
array: ["This".to_string(), "is".to_string(), "array".to_string()],
};

quo!(cool_variable);
// quo!(cool_variable);
}

fn test_expression() {
quo!(42 * 42);
// quo!(42 * 42);
}

fn test_grouped() {
quo!("string", 32, 43.53);
// quo!("string", 32, 43.53);
}

view! {
Expand Down
15 changes: 13 additions & 2 deletions src/utils/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,27 @@ fn format_rust(dump: &IncomingQuoPayload) -> String {
Ok(formatted) => {
let trimmed = formatted.trim();
if let Some(start) = trimmed.find('{') {

if let Some(end) = trimmed.rfind('}') {
let content = &trimmed[start + 1..end];
let lines: Vec<&str> = content.lines().collect();

if lines.is_empty() {
return String::new();
}

// Determine common indentation to strip
let mut min_indent = usize::MAX;

for line in lines.iter().skip(1) {
let trimmed = line.trim_end();

if trimmed.is_empty() {
continue;
}

let indent = trimmed.chars().take_while(|c| c.is_whitespace()).count();

if indent < min_indent {
min_indent = indent;
}
Expand All @@ -104,8 +110,10 @@ fn format_rust(dump: &IncomingQuoPayload) -> String {
}

let mut result = String::new();

for (i, line) in lines.iter().enumerate() {
let line = line.trim_end();

let trimmed_line = if i == 0 {
line.trim_start()
} else if line.len() >= min_indent {
Expand All @@ -114,15 +122,18 @@ fn format_rust(dump: &IncomingQuoPayload) -> String {
line.trim_start()
};
result.push_str(trimmed_line);

if i < lines.len() - 1 {
result.push('\n');
}
}

let result = result.trim();

if result.ends_with(';') {
return result[..result.len() - 1].trim().to_string();
}

return result.to_string();
}
}
Expand Down Expand Up @@ -162,12 +173,12 @@ fn format_javascript_typescript(dump: &IncomingQuoPayload) -> String {
fn format_php(dump: &IncomingQuoPayload) -> String {
// @TODO find better way display type UI wise
format!(
"// @var {}\n{}{} = {}",
"\n// @var {}\n{}{} = {}",
dump.meta.variable.var_type,
if dump.meta.variable.is_constant {
"const "
} else {
"$"
""
},
dump.meta.variable.name,
format_code_snippet(&dump.meta.variable.value, 4),
Expand Down
Loading