Skip to content

UI for edit and run tests #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 114 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
e4d59b5
Add initial release for continously running UI
donhardman Apr 13, 2025
75b701e
Fix issue when we unable to run with no color with clt -d
donhardman Apr 15, 2025
39f3605
Use separate autosave and run test
donhardman Apr 18, 2025
9dc1acc
Display output from the rep file istead of cmp after failed test
donhardman Apr 18, 2025
5a81e3c
Add possibility to share edited test with url
donhardman Apr 18, 2025
658119a
Fix issue with incorrect cmp output when we have diff and missing lin…
donhardman Apr 18, 2025
2be596f
Add wasm module and try to integrate it in Editor
donhardman Apr 18, 2025
b3e4b1f
Fix minor issues and styles
donhardman Apr 18, 2025
896eb46
Add auto expand/collaps of output on focus/blur
donhardman Apr 21, 2025
83c9134
Add github auth
donhardman Apr 21, 2025
e20dfd4
Add possibility to use dynamic ports for frontend and backend
donhardman Apr 21, 2025
644ed5c
Add support of multiple ports
donhardman Apr 21, 2025
32b78e1
Add .patterns support to UI and update readme
donhardman Apr 22, 2025
a51ac00
Use API_URL everywhere
donhardman Apr 22, 2025
eb25a1c
Fix auth issue with github
donhardman Apr 22, 2025
86ee24e
Highlight input in real type as user types
donhardman Apr 22, 2025
8f8803b
Add possibility to move and delete files
donhardman Apr 22, 2025
08cc1e8
Add possibility to move and delete folders
donhardman Apr 22, 2025
3040858
Follow symlinks and pull request creation in root repository
donhardman Apr 22, 2025
d3700ce
Block and comment support
donhardman Apr 22, 2025
8d87c8f
Add fixes for proper saving of files, block, commands and comments, s…
donhardman Apr 22, 2025
299a4a7
Update code to work properly with github API
donhardman Apr 24, 2025
d5c9700
Fetch current branch and make possible to reset the branch to a given…
donhardman Apr 24, 2025
23738fc
Fetch current branch and make possible to reset the branch to a given…
donhardman Apr 24, 2025
0be1feb
Add syncing of the auth state on frontend with backend in case backed…
donhardman Apr 24, 2025
bb93239
Variouse fixes to make it work
donhardman Apr 28, 2025
a650444
use simple git
donhardman Apr 28, 2025
f160fe7
Fix known issue with reseting branch and getting proper default one
donhardman Apr 28, 2025
2ec83a7
Refactor some methods and fix issue with patters in server.js
donhardman Apr 28, 2025
7dcc050
Fix issue with whitespaces was trimmed when we compare rec with rep
donhardman Apr 28, 2025
5383dc3
Refactor git authentification
donhardman Apr 29, 2025
96482c4
Use different approach for configure user token for git repository
donhardman Apr 29, 2025
cc9cb08
Fix issue with require is undefined in create-pr
donhardman Apr 30, 2025
9838cb7
Improve editor styles and auto scroll logic
donhardman Apr 30, 2025
2f720d2
Update ui/public/auth/login.html
donhardman Apr 30, 2025
2da5cba
Change text for empty output in actual output section
donhardman Apr 30, 2025
29fd329
Merge branch 'main' into feature/ui
donhardman Jun 17, 2025
3503e7d
docs(ui): add detailed README with architecture and setup instructions
donhardman Jun 17, 2025
bcdde3f
feature(ui): ask ai agent
donhardman Jun 17, 2025
4c64fae
Improve interface to be more compact with up/down
donhardman Jun 17, 2025
820740a
Add syntax highliting in interface
donhardman Jun 17, 2025
5581b0f
docs(theming): add detailed CodeMirror light theme guide
donhardman Jun 18, 2025
1b779db
feat(ui): use pre-built themes for syntax highlighting inputs
donhardman Jun 18, 2025
976fe12
fix(server): load env before importing auth config to fix server run
donhardman Jun 18, 2025
050c264
refactor(mcp): reuse parser module for structured test logic
donhardman Jun 18, 2025
8881393
Draft: use new wasm module
donhardman Jun 18, 2025
257efad
Draft: trying next, see test_wasm.js before continue
donhardman Jun 18, 2025
6c56105
New test
donhardman Jun 18, 2025
3c6af3d
Add validation
donhardman Jun 18, 2025
6b978d6
update readme
donhardman Jun 18, 2025
868abd9
Unfinished business
donhardman Jun 18, 2025
6282e36
Restore buttons interface
donhardman Jun 19, 2025
3b9eaaf
Nestedblocks
donhardman Jun 19, 2025
8139e95
Fix
donhardman Jun 19, 2025
beb80dd
fix save
donhardman Jun 19, 2025
c428988
fix run test wasm
donhardman Jun 19, 2025
7167694
Do not need it
donhardman Jun 19, 2025
0e8bbb7
Try to fix but still failed and run test show validateion error while…
donhardman Jun 19, 2025
fd7e30a
Logging logging
donhardman Jun 19, 2025
57e00c6
OMG FINALLY
donhardman Jun 19, 2025
24636a9
Sync it up
donhardman Jun 19, 2025
b82d563
Fix ui
donhardman Jun 19, 2025
3b36a41
Remove legacy
donhardman Jun 19, 2025
fbbf8b0
Fix
donhardman Jun 19, 2025
d300f03
Refactor step comopnent
donhardman Jun 19, 2025
b091f6b
line numbers
donhardman Jun 19, 2025
833b436
Show modified files
donhardman Jun 19, 2025
08ac195
Add VSCODE like edition
donhardman Jun 19, 2025
b451188
Styles
donhardman Jun 19, 2025
bf1abc1
Fix interface output render
donhardman Jun 19, 2025
6cec830
Fix clear selection issue when we inside folder
donhardman Jun 19, 2025
48448ce
Remove share button
donhardman Jun 19, 2025
e1de2d6
Fix render issue in header
donhardman Jun 19, 2025
fdf1572
Try to fix console errors
donhardman Jun 19, 2025
456947b
TRY TO FIX error on backend
donhardman Jun 19, 2025
0e39a12
Fix statsu report
donhardman Jun 19, 2025
8941cba
Fix diff
donhardman Jun 19, 2025
7e32ea7
Fix styling
donhardman Jun 19, 2025
5e8eeae
line gutter is the problem
donhardman Jun 19, 2025
a6b2eb1
tune text
donhardman Jun 19, 2025
9d724f4
Sycn outputs
donhardman Jun 19, 2025
f8c8702
fix
donhardman Jun 19, 2025
aea9856
highlight fix
donhardman Jun 19, 2025
d46ccf6
RENAME
donhardman Jun 19, 2025
85fb4c0
fix
donhardman Jun 20, 2025
885fe43
Pass WORKDIR_PATH as env to ai command runner
donhardman Jun 20, 2025
e52aa12
server.js refactor
donhardman Jun 20, 2025
d14d7a0
Editor.svelte refactor
donhardman Jun 20, 2025
2eca674
Fix delete coloring issue on hover
donhardman Jun 20, 2025
dc9ea85
Step.svelte refactor
donhardman Jun 20, 2025
23d643e
Do not show outputs on load;
donhardman Jun 20, 2025
0d551a9
Update binaries
donhardman Jun 20, 2025
c041d40
fix sync issue
donhardman Jun 20, 2025
3797cd0
remove garbage
donhardman Jun 20, 2025
9bddc33
remove what we do not need
donhardman Jun 20, 2025
fdce9b9
Allow anyu domain
donhardman Jun 20, 2025
8097e1c
Fix wasm highlighting
donhardman Jun 20, 2025
371cb81
Fixing collapsing
donhardman Jun 20, 2025
f92caa5
fix(mcp): add warnings for string-encoded test_structure in write_test
donhardman Jun 23, 2025
08fbefb
refactor(cmp): replace seek with stream_position for correctness
donhardman Jun 23, 2025
84ae1bf
fix
donhardman Jun 23, 2025
57c4d12
fix(run_test): improve error reporting and clarify status codes
donhardman Jun 23, 2025
982ddc4
refactor(mcp): move McpServer implementation to dedicated module
donhardman Jun 23, 2025
295f5ea
fix(file-explorer): parse URL params and handle invalid file paths
donhardman Jun 23, 2025
beede87
docs(ui): expand API and component docs with Git features and file tr...
donhardman Jun 23, 2025
ccabb78
Draft: sessions
donhardman Jun 23, 2025
e6ec1b0
docs(ui): expand API and component docs with Git features and file tr...
donhardman Jun 23, 2025
d5bd31c
feat(editor): add checkout button to discard file changes
donhardman Jun 24, 2025
6ace98f
Merge branch 'feature/ui' into feature/sessions
donhardman Jun 24, 2025
c02f6f1
Sessions
donhardman Jun 24, 2025
9bd9f28
Fix issue with session interraction
donhardman Jun 24, 2025
f905f2b
Fix
donhardman Jun 24, 2025
ac6523e
fix(auth): suppress auth error display during initial check
donhardman Jun 24, 2025
979e6a2
Fix texts
donhardman Jun 25, 2025
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
11 changes: 11 additions & 0 deletions .noindex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ui/node_modules/**
ui/dist/**
ui/workdir/**
ui/pkg/**
ui/public/**
wasm/target/**
rec/target/**
cmp/target/**
parser/target/**
mcp/target/**
wasm/pkg/**
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ echo $?

The exit code will be 0 if the test passed (outputs match) or 1 if there are differences.

## Web-based UI

CLT includes a web-based user interface for editing and running tests. The UI provides an intuitive interface for managing test files, with real-time pattern matching and diff comparison. To learn more about the UI, its features, and how to set it up, see the [UI documentation](ui/README.md).

Key UI features include:
- File tree explorer for navigating test files
- Real-time comparison with pattern matching
- Docker image configuration for test validation
- GitHub authentication for access control

We utilize bash to initiate an interactive environment when you record a test. It's important to note that we reset the environment to ensure maximum compatibility with various operating systems. As of now, there is no option to pass environment variables from outside into the test environment.

### Refining Tests

After recording, you can refine your test to handle dynamic outputs:
Expand Down
Binary file added bin/aarch64/clt-mcp
Binary file not shown.
Binary file modified bin/aarch64/cmp
Binary file not shown.
Binary file modified bin/aarch64/rec
Binary file not shown.
16 changes: 8 additions & 8 deletions bin/cross-build
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash
set -e

for folder in rec cmp; do
cd $folder
declare -A bin_map
bin_map=([rec]="rec" [cmp]="cmp" [mcp]="clt-mcp")
for folder in rec cmp mcp; do
# https://github.com/joseluisq/rust-linux-darwin-builder
parser_src="$(pwd)/../parser"
docker run --network host --rm -v "${parser_src}:/root/parser" -v "$(pwd):/root/src" -w /root/src -it joseluisq/rust-linux-darwin-builder:1.84.1 bash -c "\
docker run --network host --rm -v "$(pwd):/root/src" -w /root/src -it joseluisq/rust-linux-darwin-builder:1.84.1 bash -c "\
cd $folder; \
cargo clean; \
cargo build --target=x86_64-unknown-linux-musl --release; \
cargo build --target=aarch64-unknown-linux-musl --release; \
"
cd ..
binary=${bin_map[$folder]}
# Copy binaries
cp "$folder/target/x86_64-unknown-linux-musl/release/$folder" bin/x86_64/
cp "$folder/target/aarch64-unknown-linux-musl/release/$folder" bin/aarch64/
cp "$folder/target/x86_64-unknown-linux-musl/release/$binary" bin/x86_64/
cp "$folder/target/aarch64-unknown-linux-musl/release/$binary" bin/aarch64/
done
Binary file added bin/x86_64/clt-mcp
Binary file not shown.
Binary file modified bin/x86_64/cmp
Binary file not shown.
Binary file modified bin/x86_64/rec
Binary file not shown.
81 changes: 81 additions & 0 deletions cmp/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl PatternMatcher {
let mut config: HashMap<String, String> = HashMap::new();

let file_path = std::path::Path::new(&file_name);
let file = File::open(&file_path)?;
let file = File::open(file_path)?;
let reader = BufReader::new(file);

for line in reader.lines() {
Expand Down
35 changes: 16 additions & 19 deletions cmp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use std::env;
use std::path::Path;
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
use std::io::Write;
use tempfile;

// Import from lib
pub use cmp::{PatternMatcher, MatchingPart};
Expand Down Expand Up @@ -118,7 +117,7 @@ fn main() {
},
parser::Statement::Output => {

let pos = file1_reader.seek(SeekFrom::Current(0)).unwrap();
let pos = file1_reader.stream_position().unwrap();

let mut line = String::new();
file1_reader.read_line(&mut line).unwrap();
Expand Down Expand Up @@ -203,24 +202,22 @@ fn main() {
print_diff(&mut stdout, l1, Diff::Minus);
print_diff(&mut stdout, l2, Diff::Plus);
}
} else if debug_mode {
} else {
writeln!(stdout, "{}", l1).unwrap();
}
},
_ => {},
}
}
} else {
if debug_mode {
// Show all lines when in debug mode
for line in &lines1 {
writeln!(stdout, "{}", line).unwrap();
}
} else {
// Just show OK when no differences and not in debug mode
writeln!(stdout, "OK").unwrap();
}
} }
} else if debug_mode {
// Show all lines when in debug mode
for line in &lines1 {
writeln!(stdout, "{}", line).unwrap();
}
} else {
// Just show OK when no differences and not in debug mode
writeln!(stdout, "OK").unwrap();
} }
}
_ => {
// For any other section we simply print the next line from either file.
Expand All @@ -241,7 +238,7 @@ fn move_cursor_to_line<R: BufRead + Seek>(reader: &mut R, command_prefix: &str)
let mut line = String::new();

loop {
let pos = reader.seek(SeekFrom::Current(0))?;
let pos = reader.stream_position()?;
let len = reader.read_line(&mut line)?;

if len == 0 {
Expand All @@ -261,7 +258,7 @@ fn move_cursor_to_line<R: BufRead + Seek>(reader: &mut R, command_prefix: &str)

/// Peek the statement and return it from the given reader
fn peek_statement<R: BufRead + Seek>(reader: &mut R) -> io::Result<Option<parser::Statement>> {
let pos = reader.seek(SeekFrom::Current(0))?;
let pos = reader.stream_position()?;
let mut line = String::new();
let len = reader.read_line(&mut line)?;
reader.seek(SeekFrom::Start(pos))?;
Expand All @@ -281,7 +278,7 @@ fn buffer_block<R: BufRead + Seek>(reader: &mut R) -> io::Result<Vec<String>> {
let mut parsed = false;

loop {
let pos = reader.seek(SeekFrom::Current(0))?;
let pos = reader.stream_position()?;
line.clear();
let len = reader.read_line(&mut line)?;
if len == 0 {
Expand Down Expand Up @@ -315,7 +312,7 @@ fn buffer_block<R: BufRead + Seek>(reader: &mut R) -> io::Result<Vec<String>> {
///
fn reader_at_end<R: BufRead + Seek>(reader: &mut R) -> bool {
match reader.fill_buf() {
Ok(buf) if buf.is_empty() => true,
Ok([]) => true,
_ => false,
}
}
Expand Down Expand Up @@ -428,7 +425,7 @@ fn block_has_differences(lines1: &[String], lines2: &[String], pattern_matcher:
// A helper to skip non-Input/Output blocks in the reader.
fn skip_non_command_blocks<R: BufRead + Seek>(reader: &mut R) -> io::Result<()> {
loop {
let pos = reader.seek(SeekFrom::Current(0))?;
let pos = reader.stream_position()?;
if let Some(stmt) = peek_statement(reader)? {
if stmt == parser::Statement::Input || stmt == parser::Statement::Output {
// Found a valid command block, so rewind and exit.
Expand Down
17 changes: 13 additions & 4 deletions lib/container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
# ! We are handling exit codes so we cannot use set -e here

# Detect proper path to the binary to run
ARCH=$(arch)
Expand All @@ -27,11 +27,13 @@ container_exec() {
directory=${3:-tests}
interactive=${4:-}
if [ ! -d "$directory" ]; then
>&2 echo "Directory with tests does not exist: $directory" && exit 1
>&2 echo "Directory with tests does not exist: $directory"
return 1
fi

if [ -z "$image" ] || [ -z "$command" ]; then
>&2 echo 'Usage: container_exec "image" "command"' && exit 1
>&2 echo 'Usage: container_exec "image" "command"'
return 1
fi

# Merge base of patterns
Expand Down Expand Up @@ -63,14 +65,21 @@ container_exec() {

if [ -n "$interactive" ]; then
eval "$process"
exit_code=$?
else
eval "$process" & pid=$!

trap "kill -s INT '$pid'; exit 130" SIGINT
trap "kill -s TERM '$pid'; exit 143" SIGTERM
wait "$pid"
exit_code=$?

trap - SIGINT SIGTERM
wait "$pid"
fi

# Clean up temp file
rm -f "$temp_file"

return $exit_code
}

Loading