Skip to content

Conversation

@Zwendle
Copy link
Contributor

@Zwendle Zwendle commented Dec 21, 2025

Changes

  • Created box for Add Rule/Add Rule Section buttons. The box appears when you click on the "+" icon for any rule/rule section on the Edit Rules tab

Notes

  • Merged branch 3647-rulesdashboard---ruleset-table into my branch because I wanted the file organization changes that Kinsey did in her/Mimo's pr. Currently set it so that my branch will merge into that branch just so it's easier for you guys to see the changes for this ticket, but I'll make sure my branch merges into feature/rules-dashboard once it's approved... hopefully...
  • Changed the RuleActions component a bit so it's less abstract now. Aryan let me know if that's okay, if not I might need your help to revert it back to how it was lol sorry
  • Added files for AddRuleModal and AddRuleSectionModal. They're just placeholders for now, need to be done in a separate ticket

Test Cases

  • Add rule/rule section box sticks with its plus icon when scrolling (haven't tested this out yet but I'm assuming it'll work)
  • Color scheme changes btwn light and dark mode (haven't tested this either but I don't think it'll work well because some of the colors are hardcoded lol)

Screenshots

Tadaaaa
Screenshot 2025-12-21 at 02 32 34

To Do

  • Mrs. Claus >:0

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #3723

@Zwendle Zwendle self-assigned this Dec 21, 2025
@Zwendle Zwendle changed the base branch from 3647-rulesdashboard---ruleset-table to feature/rules-dashboard December 21, 2025 07:46
Copy link
Contributor

@cielbellerose cielbellerose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

interface RuleActionsProps {
ruleId: string;
onAdd: (ruleId: string) => void;
onAdd: (ruleId: string, anchorEl: HTMLElement) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a prop shouldn't take in an anchorEl because it tightly couples this component with its parent. Instead, we need to figure out what information the onAdd needs, and extract that from the element before passing it through (if we need it at all)

const defaultTab = 'edit-rules';

const [showAddMenu, setShowAddMenu] = useState(false);
const [addMenuAnchorEl, setAddMenuAnchorEl] = useState<HTMLElement | null>(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I'm understanding this correctly this useState is to keep track of which element the addMenu is on, in which case keeping track of the html element is too tightly coupling this component with its children. Instead I think it might make more sense to just have a single optional useState for which rule to show the addMenu on

console.log('Add rule to:', ruleId);
const handleOpenAddMenu = (ruleId: string, anchorEl: HTMLElement) => {
// trying to make tests run lol this comment can get deleted later
if (showAddMenu && addMenuAnchorEl === anchorEl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be handled in the child component because it should know whether or not it has a menu open. This will also make it so we don't have to pass the anchor element through at all

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.

4 participants