feat(rag): align LightRAG native citations and MCP bridge

This commit is contained in:
lix-2026
2026-06-09 09:20:56 +08:00
parent 0e8b03daf8
commit 8e3be8b0b7
39 changed files with 2255 additions and 2732 deletions
@@ -2156,8 +2156,8 @@ pub(crate) const SPIKE_STYLE: &str = r#"
.editor-surface .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p,
.editor-surface .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p span {
opacity: 0.5;
text-decoration: line-through;
color: rgba(60, 60, 67, 0.48);
text-decoration: none;
}
.editor-surface .ProseMirror ul[data-type="taskList"] li label {
@@ -2195,15 +2195,15 @@ pub(crate) const SPIKE_STYLE: &str = r#"
transform: translate(-50%, -50%);
width: 0.75em;
height: 0.75em;
background-color: #ffffff;
background-color: #8A8F98;
opacity: 0;
-webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;
mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;
}
.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span {
background: var(--accent-strong);
border-color: var(--accent-strong);
background: transparent;
border-color: transparent;
}
.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span::before {
@@ -485,6 +485,17 @@ mod tests {
assert!(SPIKE_STYLE.contains("z-index: 130;"));
assert!(!SPIKE_STYLE.contains("z-index: 11;"));
}
#[test]
fn task_list_checked_style_uses_gray_check_without_strike() {
assert!(SPIKE_STYLE.contains("li[data-checked=\"true\"] > div > p"));
assert!(SPIKE_STYLE.contains("color: rgba(60, 60, 67, 0.48);"));
assert!(SPIKE_STYLE.contains("text-decoration: none;"));
assert!(SPIKE_STYLE.contains("background-color: #8A8F98;"));
assert!(SPIKE_STYLE.contains("border-color: transparent;"));
assert!(!SPIKE_STYLE.contains("text-decoration: line-through;"));
assert!(!SPIKE_STYLE.contains("background: var(--accent-strong);"));
}
}
fn editor_block_by_id(block_id: &str) -> Option<Element> {