chore: restructure llm plugin to be more coherent & fix various bugs in llm ui
C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 30s
Rust / build (pull_request) Successful in 49s
Python / verify (pull_request) Successful in 1m35s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 54s

This commit is contained in:
2026-10-18 12:58:38 +02:00
parent fc81be922f
commit 1fe8a3a959
54 changed files with 3022 additions and 2559 deletions
+37 -3
View File
@@ -1,20 +1,54 @@
#pragma once
#include <QObject>
#include <QString>
#include <QtQml>
namespace ZShell::llm {
class LlmMarkdown : public QObject {
class MarkdownBlock : public QObject {
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("Blocks are produced by LlmSegment")
QML_UNCREATABLE("Blocks are produced by LlmTextSegment")
Q_PROPERTY(Type type READ type CONSTANT)
Q_PROPERTY(QString id READ id CONSTANT)
Q_PROPERTY(QString text READ text CONSTANT)
Q_PROPERTY(QString latex READ latex CONSTANT)
Q_PROPERTY(QString code READ code CONSTANT)
Q_PROPERTY(QString language READ language CONSTANT)
Q_PROPERTY(int level READ level CONSTANT)
public:
enum class Type : int { Text = 0, Heading, Code, Math };
Q_ENUM(Type)
explicit LlmMarkdown(QObject* parent = nullptr) : QObject(parent) {}
MarkdownBlock(
Type type,
const QString& id,
const QString& text,
const QString& latex,
const QString& code,
const QString& language,
int level,
QObject* parent = nullptr);
[[nodiscard]] Type type() const { return m_type; }
[[nodiscard]] QString id() const { return m_id; }
[[nodiscard]] QString text() const { return m_text; }
[[nodiscard]] QString latex() const { return m_latex; }
[[nodiscard]] QString code() const { return m_code; }
[[nodiscard]] QString language() const { return m_language; }
[[nodiscard]] int level() const { return m_level; }
private:
Type m_type;
QString m_id;
QString m_text;
QString m_latex;
QString m_code;
QString m_language;
int m_level = 0;
};
} // namespace ZShell::llm