It could work this way: each edict should have an enabling condition, and if this condition is not met edict button is hidden (or shown in "disabled" state), and if that edict was chosen it automatically switches to "No Edict".
- Advancement Effort: any province has growing institution
- Centralization Effort: any province has local autonomy higher than minimum
- Defensive Edict: country is at war
- Encourage Development: always possible
[*]
- Feudal De Jure Law: always possible, or when any province has positive unrest
- Religion Enforced: country religion is Catholic and there is any Catholic province in state
- Edict of Absolutism: any province has devastation higher than 0
- Increased Enlistment: always possible
- Protect Trade: always possible
- Enforce Religious Unity: any province has heretic or heathen religion
Similar principle can be applied to "Improve Inland Routes" trade policy: it could require being at war and having any uncontrolled hostile fort in trade node for enabling, and disable itself when condition becomes false. "Hostile Trading" and "Establish Communities" are more tricky though, they can be disabled if they have no possible targets, but it won't be useful most of the time, and relying on presence of diplomats in countries can lead to unwanted results.
[*] Can be used to nerf Encourage Development, see also
https://forum.paradoxplaza.com/forum/threads/fixing-inflation-of-development-cost-in-game.1499450/