Skip to content

Commit 58e429e

Browse files
bug fixes and dosc updates
1 parent 01d32fa commit 58e429e

File tree

8 files changed

+146
-13
lines changed

8 files changed

+146
-13
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/************************************************************************
2+
* Copyright (C) 2025 Code Forge Temple *
3+
* This file is part of agentic-signal project *
4+
* See the LICENSE file in the project root for license details. *
5+
************************************************************************/
6+
7+
import * as React from 'react';
8+
import Button, {ButtonProps} from '@mui/material/Button';
9+
import Menu from '@mui/material/Menu';
10+
import MenuItem from '@mui/material/MenuItem';
11+
import {CircularProgress} from "@mui/material";
12+
13+
14+
export interface DropdownMenuItem {
15+
id: string;
16+
value: string;
17+
}
18+
19+
interface DropdownButtonProps {
20+
buttonLabel: React.ReactNode;
21+
loading?: boolean;
22+
noItemsAvailable: string;
23+
disabled: boolean;
24+
onButtonClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
25+
menuItems: DropdownMenuItem[];
26+
onMenuItemClick?: (item: DropdownMenuItem) => void;
27+
sx?: ButtonProps['sx'];
28+
}
29+
30+
export function DropdownButton ({
31+
buttonLabel,
32+
loading,
33+
noItemsAvailable,
34+
onButtonClick,
35+
menuItems,
36+
onMenuItemClick,
37+
disabled,
38+
sx
39+
}: DropdownButtonProps) {
40+
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
41+
const open = Boolean(anchorEl);
42+
43+
const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {
44+
setAnchorEl(event.currentTarget);
45+
46+
if (onButtonClick) {
47+
onButtonClick(event);
48+
}
49+
};
50+
51+
const handleMenuItemClick = (item: DropdownMenuItem) => {
52+
setAnchorEl(null);
53+
54+
if (onMenuItemClick) {
55+
onMenuItemClick(item);
56+
}
57+
};
58+
59+
const handleClose = () => {
60+
setAnchorEl(null);
61+
};
62+
63+
const loadingItemElement = (
64+
<MenuItem disabled>
65+
<CircularProgress size={24} />
66+
</MenuItem>
67+
);
68+
const noItemsAvailableElement = (
69+
<MenuItem disabled>
70+
{noItemsAvailable}
71+
</MenuItem>
72+
);
73+
74+
return (
75+
<div>
76+
<Button
77+
id="dropdown-button"
78+
disabled={disabled}
79+
aria-controls={open ? 'dropdown-menu' : undefined}
80+
aria-haspopup="true"
81+
aria-expanded={open ? 'true' : undefined}
82+
onClick={handleButtonClick}
83+
variant="contained"
84+
size="large"
85+
sx={sx}
86+
>
87+
{buttonLabel}
88+
</Button>
89+
<Menu
90+
id="dropdown-menu"
91+
anchorEl={anchorEl}
92+
open={open}
93+
onClose={handleClose}
94+
MenuListProps={{
95+
'aria-labelledby': 'dropdown-button',
96+
}}
97+
>
98+
{
99+
loading ? loadingItemElement : (
100+
menuItems.length === 0 ? noItemsAvailableElement : (
101+
menuItems.map(item => (
102+
<MenuItem
103+
key={item.id}
104+
onClick={() => handleMenuItemClick(item)}
105+
>
106+
{item.value}
107+
</MenuItem>
108+
))
109+
)
110+
)
111+
}
112+
</Menu>
113+
</div>
114+
);
115+
}

client/src/components/nodes/DataSourceNode/DataSourceNode.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import {LogsDialog} from "../../LogsDialog";
1616
import {useDebouncedState} from "../../../hooks/useDebouncedState";
1717
import {useTimerTrigger} from "../../../hooks/useTimerTrigger";
1818
import {TimerTriggerPort} from "../TimerNode/TimerTriggerPort";
19-
import { Icon } from "./constants";
20-
import { AppNode } from "../workflow.gen";
21-
import { assertIsEnhancedNodeData } from "../../../types/workflow";
19+
import {Icon} from "./constants";
20+
import {AppNode} from "../workflow.gen";
21+
import {assertIsEnhancedNodeData} from "../../../types/workflow";
2222

2323

2424
const DATA_SOURCE_TYPES = {

client/src/hooks/useLatestValue.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/************************************************************************
2+
* Copyright (C) 2025 Code Forge Temple *
3+
* This file is part of agentic-signal project *
4+
* See the LICENSE file in the project root for license details. *
5+
************************************************************************/
6+
7+
import {useRef, useEffect} from "react";
8+
9+
/**
10+
* Returns a ref that always contains the latest value.
11+
* Useful for accessing current values in callbacks without stale closures.
12+
*/
13+
export function useLatestValue<T> (value: T) {
14+
const ref = useRef(value);
15+
16+
useEffect(() => {
17+
ref.current = value;
18+
}, [value]);
19+
20+
return ref;
21+
}

docs/docs/nodes/output/reddit-post.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import TabItem from '@theme/TabItem';
2929
</TabItem>
3030
<TabItem value="post-config" label="Post Configuration">
3131
Configure your post details:
32+
- **Post Provided by Upstream**: Enable to receive post configuration from connected nodes
3233
- **Subreddit**: Target subreddit (e.g., "test" or "r/test")
3334
- **Post Type**: Text Post or Link Post
3435
- **Post Title**: Title for your post
@@ -49,6 +50,7 @@ import TabItem from '@theme/TabItem';
4950
2. **AI Content Sharing**: Post AI-generated content to relevant communities
5051
3. **Workflow Results**: Share workflow outputs or summaries
5152
4. **Community Updates**: Automated announcements or updates
53+
5. **Dynamic Content**: Use upstream nodes to generate post content dynamically
5254

5355
## Best Practices
5456

@@ -57,6 +59,7 @@ import TabItem from '@theme/TabItem';
5759
- **Test with safe subreddits**: Use r/test or similar for testing
5860
- **Respect rate limits**: Avoid spamming or excessive posting
5961
- **Secure credentials**: Keep your Client Secret private
62+
- **Use upstream data**: Enable "Post Provided by Upstream" to receive dynamically generated content from AI or data processing nodes
6063

6164
## Troubleshooting
6265

@@ -71,4 +74,5 @@ import TabItem from '@theme/TabItem';
7174

7275
- Use [Timer Node](/docs/nodes/input/timer-node) for scheduled posting
7376
- Combine with AI Data Processing for dynamic content
74-
- Use Data Validation to ensure post content meets requirements
77+
- Use Data Validation to ensure post content meets requirements
78+
- Enable "Post Provided by Upstream" to automatically post content from upstream connected nodes

docs/src/pages/markdown-page.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
-2.24 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agentic-signal",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Visual AI Workflow Automation Platform with Local Agent Intelligence",
55
"author": "Code Forge Temple",
66
"type": "module",

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
33
"productName": "agentic-signal",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"identifier": "com.agentic-signal",
66
"build": {
77
"frontendDist": "../client/dist",

0 commit comments

Comments
 (0)