This commit is contained in:
2025-07-24 00:18:09 +01:00
parent 9c50db2b62
commit c3ae04ab75
7 changed files with 13 additions and 24 deletions
-8
View File
@@ -3,14 +3,6 @@ on: [push, pull_request]
name: Continuous integration
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo check
build:
name: build
runs-on: ubuntu-latest
+2 -2
View File
@@ -1,6 +1,6 @@
use egui::Color32;
use egui::TextBuffer;
use egui::widgets::text_edit::TextEditOutput;
use egui::{Color32, text::LayoutJob};
use std::hash::{Hash, Hasher};
@@ -123,7 +123,7 @@ impl CodeEditor {
}
}
pub fn format(&self, string: &str) -> egui::text::TextFormat {
pub fn format(&self, _string: &str) -> egui::text::TextFormat {
let font_id = egui::FontId::monospace(self.fontsize);
let color = Color32::WHITE;
egui::text::TextFormat::simple(font_id, color)
+2 -2
View File
@@ -1,4 +1,4 @@
use egui::{TextEdit, text};
use egui::TextEdit;
use egui_commonmark::{CommonMarkCache, CommonMarkViewer};
use serde::{self, Deserialize, Serialize};
@@ -264,7 +264,7 @@ impl MainEditor {
}
fn editor_ui(&mut self, ui: &mut egui::Ui) {
let response = egui::ScrollArea::both()
let _response = egui::ScrollArea::both()
.auto_shrink([false, false])
.id_salt("editor_scroll")
.show(ui, |ui| {
+2
View File
@@ -15,6 +15,7 @@ pub struct ProjectContext {
}
impl ProjectContext {
#[allow(dead_code)]
pub fn new() -> Self {
Self::default()
}
@@ -37,6 +38,7 @@ impl ProjectContext {
std::fs::write(path, content).unwrap();
}
#[allow(dead_code)]
pub fn ui(&mut self, ui: &mut egui::Ui) {
// table
egui::Grid::new("context_editor")
+1 -1
View File
@@ -1,4 +1,4 @@
use egui::{Response, RichText, TextEdit, UiBuilder};
use egui::{Response, RichText, TextEdit};
use serde::{Deserialize, Serialize};
use crate::{PROJECT_FOLDER, util};
+5 -10
View File
@@ -249,7 +249,7 @@ impl Explorer {
});
})
.body(|ui| {
let mut entries: Vec<_> = WalkDir::new(PROJECT_FOLDER.join("assets"))
let entries: Vec<_> = WalkDir::new(PROJECT_FOLDER.join("assets"))
.min_depth(1)
.max_depth(1) // Only immediate children
.sort_by(|a, b| {
@@ -269,17 +269,12 @@ impl Explorer {
.collect();
for entry in entries {
self.render_entry(ui, to_load, &entry);
Self::render_entry(ui, to_load, &entry);
}
});
}
fn render_entry(
&mut self,
ui: &mut egui::Ui,
to_load: &mut Option<RightPanelContent>,
entry: &DirEntry,
) {
fn render_entry(ui: &mut egui::Ui, to_load: &mut Option<RightPanelContent>, entry: &DirEntry) {
let file_type = entry.file_type();
let is_dir = file_type.is_dir();
let file_name = entry.file_name().to_string_lossy();
@@ -302,13 +297,13 @@ impl Explorer {
.show_header(ui, |ui| {
ui.horizontal(|ui| {
ui.label(file_name);
let clicked = ui.button("+").on_hover_text("Add new item").clicked();
let _clicked = ui.button("+").on_hover_text("Add new item").clicked();
});
})
.body(|ui| {
// recursive call to render the next level of documents
for entry in entries {
self.render_entry(ui, to_load, &entry);
Self::render_entry(ui, to_load, &entry);
}
});
} else {
+1 -1
View File
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
pub fn continue_content(
context: &str,
instruction: &str,
max_tokens: usize,
_max_tokens: usize,
) -> Result<String, Box<dyn std::error::Error>> {
let client = reqwest::blocking::Client::new();