From bf6ee2f71da3008bf01bd5be030f5bff62410d0e Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 13 Jan 2026 00:06:02 +0530 Subject: [PATCH] fix: show new rule once created --- core/core.ts | 2 ++ gui/src/pages/config/sections/RulesSection.tsx | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core.ts b/core/core.ts index 2985c0486..e61c7240e 100644 --- a/core/core.ts +++ b/core/core.ts @@ -414,6 +414,7 @@ export class Core { msg.data.blockType, msg.data.baseFilename, ); + walkDirCache.invalidate(); await this.configHandler.reloadConfig( "Local block created (config/addLocalWorkspaceBlock message)", ); @@ -422,6 +423,7 @@ export class Core { on("config/addGlobalRule", async (msg) => { try { await createNewGlobalRuleFile(this.ide, msg.data?.baseFilename); + walkDirCache.invalidate(); await this.configHandler.reloadConfig( "Global rule created (config/addGlobalRule message)", ); diff --git a/gui/src/pages/config/sections/RulesSection.tsx b/gui/src/pages/config/sections/RulesSection.tsx index e80e83536..205f1ddaa 100644 --- a/gui/src/pages/config/sections/RulesSection.tsx +++ b/gui/src/pages/config/sections/RulesSection.tsx @@ -132,8 +132,6 @@ interface RuleCardProps { const RuleCard: React.FC = ({ rule }) => { const dispatch = useAppDispatch(); - const ideMessenger = useContext(IdeMessengerContext); - const mode = useAppSelector((store) => store.session.mode); const policy = useAppSelector((state) => rule.name ? state.ui.ruleSettings[rule.name] || DEFAULT_RULE_SETTING @@ -397,6 +395,7 @@ function RulesSubSection() { const dispatch = useAppDispatch(); const isLocal = selectedProfile?.profileType === "local"; const [globalRulesMode, setGlobalRulesMode] = useState("workspace"); + const configLoading = useAppSelector((store) => store.config.loading); const handleAddRule = (mode?: string) => { const currentMode = mode || globalRulesMode; @@ -487,6 +486,11 @@ function RulesSubSection() { {sortedRules.map((rule, index) => ( ))} + {configLoading && ( +
+ Reloading rules from your config... +
+ )} ) : (