add AdGuard syntax highlighting to custom filter rule editor#264
add AdGuard syntax highlighting to custom filter rule editor#264
Conversation
Summary of ChangesHello @0xCUB3, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience in the custom filter rule editor by integrating real-time AdGuard syntax highlighting. This visual aid improves the readability and maintainability of filter rules, making it easier for users to author and manage their custom AdGuard configurations on both macOS and iOS. The implementation leverages native text views for optimal performance and user interaction. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces AdGuard syntax highlighting to the custom filter rule editor on both macOS and iOS. The changes involve creating a new AdGuardSyntaxHighlighter class responsible for tokenizing and applying NSAttributedString colors to AdGuard rules using regular expressions, and a SyntaxHighlightingTextView SwiftUI representable that wraps native NSTextView/UITextView to display the highlighted text while preserving cursor position. The existing TextEditor in EditUserListView is replaced with this new custom view. A review comment highlights that the htmlFiltering color is defined using a magic number and suggests using a named constant or system color for better maintainability.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1df5f4515
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Fixed both in b233375. Gemini: extracted the amber color to Codex: good catch. The two comments on the design doc are about the plan file, not the actual code. |
Syntax highlighting for the custom filter rule editor. Tokenizer handles all AdGuard rule types (comments, element hiding, URL blocking, exceptions, modifiers, extended CSS, scriptlets, HTML filtering, regex). Wired into EditUserListView on both macOS and iOS via native NSTextView/UITextView wrappers.
Closes #263
Test plan: