fix: dedupe history and improve Discord channel parsing#77
Merged
jackwener merged 1 commit intojackwener:mainfrom Mar 19, 2026
Merged
fix: dedupe history and improve Discord channel parsing#77jackwener merged 1 commit intojackwener:mainfrom
jackwener merged 1 commit intojackwener:mainfrom
Conversation
History CLI: filter out date headers, numeric-only entries and model path strings, deduplicate titles while preserving first occurrence, and reindex results to produce a clean list. Discord channels CLI: switch to channel anchor links and robustly parse aria-labels (skip categories/placeholders, strip status prefixes, extract name and type), add support for stage/forum/announcement/voice types, and index results reliably to avoid spurious entries.
There was a problem hiding this comment.
Pull request overview
Improves Playwright DOM scraping for two UI-driven CLIs by (1) making Discord channel discovery more precise and (2) filtering/deduping noisy ChatWise history entries.
Changes:
- Update Discord channel scraping to parse channel name/type from
aria-labelon channel<a>links. - Post-process ChatWise history results to drop headers/noise entries and dedupe titles.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/clis/discord-app/channels.ts | Switches to parsing channel entries from /channels/... link aria-label for improved accuracy. |
| src/clis/chatwise/history.ts | Adds filtering + deduplication to remove non-conversation entries from sidebar history. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+39
to
+40
| // Discord channel names are ASCII-only; skip placeholder entries (e.g. locked channels) | ||
| if (!name || !/^[\x20-\x7E]+$/.test(name)) return; |
| if (seen.has(t)) return false; | ||
| seen.add(t); | ||
| return true; | ||
| }).map((item: { Index: number; Title: string }, i: number) => ({ Index: i + 1, Title: item.Title })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix DOM retrieval issues in some playwright-based applications—for example