-
Notifications
You must be signed in to change notification settings - Fork 876
Visualize progress notifications #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
max-width: 1280px; | ||
margin: 0 auto; | ||
padding: 2rem; | ||
text-align: center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird default CSS that was causing the window to look weird at large sizes
<div className="w-64 bg-white shadow-md p-4 overflow-hidden flex flex-col h-full"> | ||
<div className="flex-1 overflow-y-auto mb-4 border-b pb-4"> | ||
<h2 className="text-lg font-semibold mb-4">History</h2> | ||
{requestHistory.length === 0 ? ( | ||
<p className="text-sm text-gray-500 italic">No history yet</p> | ||
) : ( | ||
<ul className="space-y-3"> | ||
{requestHistory | ||
.slice() | ||
.reverse() | ||
.map((request, index) => ( | ||
<li | ||
key={index} | ||
className="text-sm text-gray-600 bg-gray-100 p-2 rounded" | ||
> | ||
<div | ||
className="flex justify-between items-center cursor-pointer" | ||
onClick={() => | ||
toggleRequestExpansion(requestHistory.length - 1 - index) | ||
} | ||
> | ||
<span className="font-mono"> | ||
{requestHistory.length - index}.{" "} | ||
{JSON.parse(request.request).method} | ||
</span> | ||
<span> | ||
{expandedRequests[requestHistory.length - 1 - index] | ||
? "▼" | ||
: "▶"} | ||
</span> | ||
</div> | ||
{expandedRequests[requestHistory.length - 1 - index] && ( | ||
<> | ||
<div className="mt-2"> | ||
<div className="flex justify-between items-center mb-1"> | ||
<span className="font-semibold text-blue-600"> | ||
Request: | ||
</span> | ||
<button | ||
onClick={() => copyToClipboard(request.request)} | ||
className="text-blue-500 hover:text-blue-700" | ||
> | ||
<Copy size={16} /> | ||
</button> | ||
</div> | ||
<pre className="whitespace-pre-wrap break-words bg-blue-50 p-2 rounded"> | ||
{JSON.stringify(JSON.parse(request.request), null, 2)} | ||
</pre> | ||
</div> | ||
{request.response && ( | ||
<div className="mt-2"> | ||
<div className="flex justify-between items-center mb-1"> | ||
<span className="font-semibold text-green-600"> | ||
Response: | ||
</span> | ||
<button | ||
onClick={() => copyToClipboard(request.response!)} | ||
className="text-blue-500 hover:text-blue-700" | ||
> | ||
<Copy size={16} /> | ||
</button> | ||
</div> | ||
<pre className="whitespace-pre-wrap break-words bg-green-50 p-2 rounded"> | ||
{JSON.stringify( | ||
JSON.parse(request.response), | ||
null, | ||
2, | ||
)} | ||
</pre> | ||
</div> | ||
)} | ||
</> | ||
)} | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The joy of Tailwind 🤮 Nothing has changed here, just some light touch-ups to make the History list only take up the top half of the right sidebar.
<> | ||
<span className="flex-1">{tool.name}</span> | ||
<span className="text-sm text-gray-500">{tool.description}</span> | ||
<span className="text-sm text-gray-500 text-right"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right-aligning the description text because it looks better
package.json
Outdated
"start": "concurrently \"yarn start-server\" \"yarn start-client\"", | ||
"prettier-fix": "prettier --write .", | ||
"update:mcp": "git subtree pull --prefix=packages/mcp-typescript https://github.com/modelcontextprotocol/typescript-sdk.git main --squash" | ||
"update:mcp": "git subtree pull --prefix=packages/mcp-typescript https://github.com/modelcontextprotocol/typescript-sdk.git ashwin/progress --squash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will undo this once modelcontextprotocol/typescript-sdk#20 is in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7d70db8 Merge pull request #20 from modelcontextprotocol/ashwin/progress 65a8613 fix schema definitions for RequestSchema git-subtree-dir: packages/mcp-typescript git-subtree-split: 7d70db805740c53f21153d72be6f34d70818a9da
f23b4d8
to
247dae5
Compare
Depends on modelcontextprotocol/typescript-sdk#20, based on #17.
CleanShot.2024-10-16.at.16.31.30.mp4