From 661cfd6d1a00f60c7e660910d7b3f31643738a95 Mon Sep 17 00:00:00 2001 From: zjp Date: Sat, 31 Jan 2026 14:14:22 +0000 Subject: [PATCH 1/5] feat(ui): add help button and render README --- ui/app/components/code/Help.vue | 80 +++++++++++++++++++++++++++++ ui/app/components/widget/TopBar.vue | 9 ++++ ui/nuxt.config.ts | 1 + 3 files changed, 90 insertions(+) create mode 100644 ui/app/components/code/Help.vue diff --git a/ui/app/components/code/Help.vue b/ui/app/components/code/Help.vue new file mode 100644 index 0000000..93d01b8 --- /dev/null +++ b/ui/app/components/code/Help.vue @@ -0,0 +1,80 @@ + + + diff --git a/ui/app/components/widget/TopBar.vue b/ui/app/components/widget/TopBar.vue index ccbd91c..0f47e76 100644 --- a/ui/app/components/widget/TopBar.vue +++ b/ui/app/components/widget/TopBar.vue @@ -60,6 +60,15 @@ + + + + + + + diff --git a/ui/nuxt.config.ts b/ui/nuxt.config.ts index 83627fa..dd423e9 100644 --- a/ui/nuxt.config.ts +++ b/ui/nuxt.config.ts @@ -35,6 +35,7 @@ export default defineNuxtConfig({ 'tabler:hexagon-letter-f-filled', // field 'tabler:hexagon-letter-a-filled', // argument 'tabler:hexagon-letter-l-filled', // locals + 'tabler:question-mark', // help ], } }, From 4c8ffb9c9eb03252e2a2b2b8033dfdb38b3afa91 Mon Sep 17 00:00:00 2001 From: zjp Date: Sat, 31 Jan 2026 14:18:25 +0000 Subject: [PATCH 2/5] data(adt): add body src if available --- data | 2 +- src/output/utils.rs | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/data b/data index aafdd70..7d71849 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit aafdd706df0de038b0bcf661962fb12e0013b5bf +Subproject commit 7d718494630194493aa4e4cb12d04bd81ed117a9 diff --git a/src/output/utils.rs b/src/output/utils.rs index 6f4d889..03897d5 100644 --- a/src/output/utils.rs +++ b/src/output/utils.rs @@ -43,12 +43,23 @@ pub fn span(item: T, tcx: TyCtxt) -> String { src_map.span_to_string(span, rustc_span::FileNameDisplayPreference::Remapped) } -pub fn src(item: T, tcx: TyCtxt) -> String { - src_from_span(item.span(), tcx) +pub fn src(item: T, tcx: TyCtxt) -> String { + let span = if let Some(did) = did(item, tcx).as_local() + && let rustc_hir::Node::Item(item) = tcx.hir_node_by_def_id(did) + { + tcx.hir_span_with_body(item.hir_id()) + } else { + internal(tcx, item.span()) + }; + src_from_span_internal(span, tcx) } pub fn src_from_span(span: Span, tcx: TyCtxt) -> String { let span = internal(tcx, span); + src_from_span_internal(span, tcx) +} + +fn src_from_span_internal(span: rustc_span::Span, tcx: TyCtxt) -> String { let src_map = tcx.sess.source_map(); src_map.span_to_snippet(span).unwrap_or_default() } From 657206158783a93d042261df47aa3929cf4c8bf1 Mon Sep 17 00:00:00 2001 From: zjp Date: Sat, 31 Jan 2026 15:25:54 +0000 Subject: [PATCH 3/5] ui: adjust margins --- ui/app/components/code/AdtPopup.vue | 2 +- ui/app/components/code/Help.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/components/code/AdtPopup.vue b/ui/app/components/code/AdtPopup.vue index e151538..2cfe525 100644 --- a/ui/app/components/code/AdtPopup.vue +++ b/ui/app/components/code/AdtPopup.vue @@ -1,6 +1,6 @@