Skip to content

feat: Telegram digest bot + event-detail improvements + VS Code launch - #1

Open
ukurere wants to merge 17 commits into
compare/before-sessionfrom
master
Open

feat: Telegram digest bot + event-detail improvements + VS Code launch#1
ukurere wants to merge 17 commits into
compare/before-sessionfrom
master

Conversation

@ukurere

@ukurere ukurere commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Three features developed in this session, building on top of the earlier admin page, RSS polling, profile tabs, and event-card toggle work:

  • Event-detail page — renders full RSS HTML content via DomSanitizer, functional ★ Save and 📅 Calendar toggle buttons (top + bottom bars), complete SCSS overhaul for article body (images, headings, blockquotes, code blocks, links, tables)
  • Telegram bot notifications — users enter their @username in the profile, send /start to the bot, and the bot links the account automatically; digests are sent in parallel to email + Telegram; /digest command on demand; NullTelegramBotService stub when token is not configured
  • VS Code one-click launch.vscode/launch.json compound config (🚀 Full Stack) builds the .NET backend with debugger + starts ng serve in a dedicated terminal and opens Chrome, all with a single F5

Changes

Backend

  • User model: TelegramUsername, TelegramChatId (long?), TelegramNotificationsEnabled
  • EF migration AddTelegramFields
  • ITelegramBotService / TelegramBotService (Telegram.Bot 22.x, HTML parse mode, auto-split at 4 000 chars)
  • NullTelegramBotService — no-op when Telegram:BotToken is not configured
  • TelegramBotBackgroundService — long polling; /start links account by username; /digest sends on-demand
  • DigestService.SendDigestAsync — sends Telegram message alongside email when enabled
  • DigestService.SendTelegramDigestAsync — Telegram-only path used by /digest command
  • UsersControllerPATCH /{id}/telegram endpoint; telegram fields exposed in MapUser
  • appsettings.example.jsonTelegram:BotToken placeholder added

Frontend

  • User model — telegramNotificationsEnabled, telegramUsername, telegramChatId
  • UsersService.updateTelegram()PATCH call
  • Profile page — mat-slide-toggle to enable/disable, @username input, connection status chip (✅ connected / ⏳ waiting for /start), saveTelegram() method; MatSlideToggleModule added
  • Event-detail — [innerHTML]="safeContent()", toggle buttons, full SCSS for article body
  • EventItem.contentHtml? field added to model

Dev tooling

  • .vscode/tasks.jsonbuild: backend (dotnet build) + serve: frontend (ng serve, background with pattern matcher)
  • .vscode/launch.json — compound 🚀 Full Stack (coreclr + chrome), stopAll: true

Test plan

  • Open repo in VS Code → press F5 → Angular opens in Chrome, .NET starts with debugger
  • Create a bot via @Botfather, add token to appsettings.json, run backend
  • In profile: enable Telegram, enter username, save → status shows "⏳ Waiting for /start"
  • Send /start to bot in Telegram → status changes to "✅ Connected"
  • Send /digest to bot → receives personalized digest
  • Open any event → full article body renders, ★ and 📅 buttons work and persist

🤖 Generated with Claude Code

ukurere and others added 7 commits May 28, 2026 18:48
- Add contentHtml? field to EventItem model
- Render RSS full-text via DomSanitizer.bypassSecurityTrustHtml()
- Save and calendar toggle buttons on detail page (top + bottom bars)
- Load initial saved/calendar state from UsersService on init
- Full SCSS overhaul: article-body styles for images, headings,
  blockquotes, tables, code blocks, links; active-state colours
  for toggle buttons

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Backend:
- Add TelegramUsername / TelegramChatId / TelegramNotificationsEnabled to User
- EF migration AddTelegramFields
- ITelegramBotService + TelegramBotService (Telegram.Bot 22.x, HTML mode, auto-split >4000 chars)
- NullTelegramBotService stub when BotToken not configured
- TelegramBotBackgroundService: long polling, /start links account by username,
  /digest sends on-demand digest
- DigestService: send Telegram message alongside email when enabled
- UsersController: PATCH /{id}/telegram endpoint, telegram fields in MapUser

Frontend:
- User model: telegramNotificationsEnabled / telegramUsername / telegramChatId
- UsersService: updateTelegram() PATCH call
- Profile: mat-slide-toggle, @username input, connection status indicator,
  saveTelegram() method; MatSlideToggleModule added to imports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
F5 (or Run > Start Debugging > 🚀 Full Stack) now:
- builds the .NET backend and attaches the coreclr debugger
- starts ng serve in a dedicated terminal and opens Chrome at localhost:4200
Both processes stop together when debugging ends (stopAll: true)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
launch.json: replaced compound+chrome with single coreclr launch;
serverReadyAction opens localhost:4200 when .NET starts listening;
preLaunchTask now builds .NET first, then waits for Angular

tasks.json: serve: frontend depends on build: backend (sequential);
simplified background pattern matchers for Angular 20 Vite output

RssFeedService: use GetAsync to check HTTP status before parsing;
skip sources returning HTML (instead of crashing); add CheckCharacters=false
to XmlReaderSettings to tolerate invalid chars like 0x02; catch XmlException
gracefully with a warning log instead of propagating the error

DbSeeder: remove 6 broken sources (LIGA.net 404, AIN.EN bad XML,
Harvard/Afisha HTML, Kingston/Stanford 404); add Reuters, AIN.UA,
Hacker News as reliable replacements

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production May 31, 2026 18:16 Inactive
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production May 31, 2026 18:24 Inactive
- AdminOnly policy on AdminController (adamyocardium@gmail.com only)
- Angular adminGuard blocks /admin for non-admin users
- UserKeywords model, migration, API endpoints and frontend UI
- DigestService includes personal keywords in filtering
- Send now buttons (email + telegram) in profile
- Calendar tab label changed to Vidmicheni materialy

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production May 31, 2026 23:44 Inactive
- Added SendNowAsync method with fixed 30-day range
- Controller returns 400 with clear message if no matching events found
- Telegram send-now uses same logic via telegramOnly flag

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production June 1, 2026 00:16 Inactive
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production June 1, 2026 00:37 Inactive
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production June 1, 2026 00:46 Inactive
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production June 3, 2026 14:13 Inactive
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production June 3, 2026 16:25 Inactive
@railway-app
railway-app Bot temporarily deployed to inspiring-wisdom / production June 3, 2026 21:46 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant