mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-20 15:21:30 +02:00
Repo-wide sweep of every user-facing string: frontend components, routes, config and stores; API details and route docs; shared definitions and models; stage config help; report prose; MCP, toolbox, interest and connector text; notification and worker messages. Descriptions that explained, reassured, justified or restated their title are deleted. Confirm dialogs name what is removed and stop. Failed actions read "<Noun> not <verbed>", successes "<Noun> <verbed>". No reader address, no product-as-subject, no em-dashes or parentheticals in prose. Mirrors updated on both sides: EPSS band help, compare refusal reasons, interest labels. Four tests asserting on old wording follow the new text. The rules are condensed into CLAUDE.md under Writing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SK5o8xR96cbSnAfjYSTPSe
49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
from reports.base import RenderContext, Section
|
|
from reports.config import SectionConfig, choice, flag, paragraph, text
|
|
from shared.definitions.reports import SectionGroup
|
|
|
|
|
|
class CustomTextConfig(SectionConfig):
|
|
heading: str = text("Notes", title="Heading")
|
|
body: str = paragraph(
|
|
"",
|
|
title="Body",
|
|
description="Markdown.",
|
|
)
|
|
style: str = choice(
|
|
"plain",
|
|
title="Presentation",
|
|
options={
|
|
"plain": "Plain text",
|
|
"callout": "Callout",
|
|
"warning": "Warning callout",
|
|
"quiet": "Quiet note",
|
|
},
|
|
)
|
|
new_page: bool = flag(True, title="Start on a new page")
|
|
|
|
|
|
class CustomTextSection(Section):
|
|
name = "custom_text"
|
|
title = "Custom text"
|
|
description = "Free text in Markdown."
|
|
group = SectionGroup.SUMMARY.value
|
|
order = 60
|
|
repeatable = True
|
|
default_enabled = False
|
|
config_model = CustomTextConfig
|
|
|
|
def build(self, ctx: RenderContext, cfg: CustomTextConfig) -> dict | None:
|
|
del ctx
|
|
if not cfg.body.strip():
|
|
return None
|
|
kind = {"callout": "", "warning": "warn", "quiet": "quiet"}.get(cfg.style)
|
|
return {
|
|
"title": cfg.heading,
|
|
"body": cfg.body,
|
|
"callout": cfg.style != "plain",
|
|
"kind": kind,
|
|
}
|