<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Shadcn-Ui on ICE-ICE-BEAR-BLOG</title><link>https://ice-ice-bear.github.io/tags/shadcn-ui/</link><description>Recent content in Shadcn-Ui on ICE-ICE-BEAR-BLOG</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 10 Apr 2026 00:00:00 +0900</lastBuildDate><atom:link href="https://ice-ice-bear.github.io/tags/shadcn-ui/index.xml" rel="self" type="application/rss+xml"/><item><title>Trading Agent Dev Log #10 — UI Overhaul: Tailwind v4 + shadcn/ui</title><link>https://ice-ice-bear.github.io/posts/2026-04-10-trading-agent-dev10/</link><pubDate>Fri, 10 Apr 2026 00:00:00 +0900</pubDate><guid>https://ice-ice-bear.github.io/posts/2026-04-10-trading-agent-dev10/</guid><description>&lt;img src="https://ice-ice-bear.github.io/" alt="Featured image of post Trading Agent Dev Log #10 — UI Overhaul: Tailwind v4 + shadcn/ui" /&gt;&lt;p&gt;The old Trading Agent UI had a structural problem: the most important feature was one click away. Here&amp;rsquo;s how I rebuilt it from the ground up with Tailwind CSS v4 and shadcn/ui — five pages, a persistent Agent Activity panel, and a layout that finally matches how the tool is actually used.&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&lt;a class="link" href="https://ice-ice-bear.github.io/en/posts/2026-04-08-trading-agent-dev9/" &gt;Previous: Trading Agent Dev Log #9&lt;/a&gt; — ATR-based dynamic stop-loss and investment horizon management&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;h2 id="the-problem-core-functionality-was-buried"&gt;The Problem: Core Functionality Was Buried
&lt;/h2&gt;&lt;p&gt;The whole point of the Trading Agent UI is &lt;strong&gt;monitoring agent activity&lt;/strong&gt; — watching in real time which agents fired, what signals they generated, and how decisions were reached. That&amp;rsquo;s the primary use case.&lt;/p&gt;
&lt;p&gt;Yet the old layout had this core feature &lt;strong&gt;hidden in a secondary tab&lt;/strong&gt;. Meanwhile, the chat interface occupied a prominent chunk of the screen at all times. The thing I used 80% of the time required an extra click to see. That&amp;rsquo;s not something you patch — it&amp;rsquo;s a structural problem that demands a full redesign.&lt;/p&gt;
&lt;h2 id="design-first"&gt;Design First
&lt;/h2&gt;&lt;p&gt;Rather than jumping straight to code, I dedicated a separate session (Session 3) entirely to design. I built an HTML mockup to nail down the layout, wrote a spec document, then broke the implementation into 12 discrete tasks.&lt;/p&gt;
&lt;p&gt;The core principles for the new layout:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Agent Activity is always visible&lt;/strong&gt; — fixed right panel, visible from every page&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Header tabs for page navigation&lt;/strong&gt; — Dashboard / Signals / Research / Reports / Settings&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chat is on-demand&lt;/strong&gt; — available when needed, not always on screen&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="mermaid" style="visibility:hidden"&gt;graph LR
 subgraph Header["Header Tab Navigation"]
 D["Dashboard"]
 S["Signals"]
 R["Research"]
 RP["Reports"]
 ST["Settings"]
 end

 subgraph Main["Main Layout"]
 direction LR
 subgraph Left["Left: Page Content"]
 D --&gt; DV["Hero Card &amp;lt;br/&amp;gt; Positions &amp;lt;br/&amp;gt; Performance &amp;lt;br/&amp;gt; Recent Orders"]
 S --&gt; SV["Signal Cards &amp;lt;br/&amp;gt; Scenarios &amp;lt;br/&amp;gt; Expert Panel &amp;lt;br/&amp;gt; Filters"]
 R --&gt; RV["Watchlist Sidebar &amp;lt;br/&amp;gt; Price Chart &amp;lt;br/&amp;gt; Fundamentals &amp;lt;br/&amp;gt; Signal History"]
 RP --&gt; RPV["Report List &amp;lt;br/&amp;gt; Markdown Reader"]
 end
 subgraph Right["Right: Fixed Panel"]
 AP["Agent Activity &amp;lt;br/&amp;gt; Panel"]
 AP --&gt; TL["Timeline Feed"]
 AP --&gt; AS["Agent Status"]
 AP --&gt; DL["Decision Log"]
 end
 end&lt;/pre&gt;&lt;h2 id="implementation-building-from-scratch"&gt;Implementation: Building from Scratch
&lt;/h2&gt;&lt;h3 id="step-1-foundation--tailwind-css-v4--shadcnui"&gt;Step 1: Foundation — Tailwind CSS v4 + shadcn/ui
&lt;/h3&gt;&lt;p&gt;I stripped out all the existing styles and started fresh with &lt;strong&gt;Tailwind CSS v4&lt;/strong&gt; and &lt;strong&gt;shadcn/ui&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The case for shadcn/ui was straightforward:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Copy-paste architecture means full customization freedom&lt;/li&gt;
&lt;li&gt;Built on Radix UI, so accessibility comes for free&lt;/li&gt;
&lt;li&gt;Pairs perfectly with Tailwind&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this step I set up &lt;strong&gt;17 UI components&lt;/strong&gt; in one go: Button, Badge, Card, Command, Dialog, Table, and more. This added roughly 4,900 lines — mostly shadcn/ui component code.&lt;/p&gt;
&lt;h3 id="step-2-layout-shell"&gt;Step 2: Layout Shell
&lt;/h3&gt;&lt;p&gt;I rewrote &lt;code&gt;app.tsx&lt;/code&gt; from scratch. The old 190 lines were replaced with a new 277-line structure.&lt;/p&gt;
&lt;p&gt;Key components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;header.tsx&lt;/code&gt;&lt;/strong&gt; — five-tab navigation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;main-layout.tsx&lt;/code&gt;&lt;/strong&gt; — split layout with left content area and right Agent Activity panel&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="step-3-agent-activity-panel"&gt;Step 3: Agent Activity Panel
&lt;/h3&gt;&lt;p&gt;The most important component in the whole redesign. It has three sub-views:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Sub-view&lt;/th&gt;
 &lt;th&gt;Purpose&lt;/th&gt;
 &lt;th&gt;Key Components&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Timeline&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Real-time event stream&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;timeline-feed.tsx&lt;/code&gt;, &lt;code&gt;flow-event.tsx&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Agent Status&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Current state of each agent&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;activity-panel.tsx&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Decision Log&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Decision chain tracing&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;decision-chain.tsx&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Since this panel is pinned to the right side on every page, you never lose sight of what the agents are doing.&lt;/p&gt;
&lt;h3 id="step-4-five-main-pages"&gt;Step 4: Five Main Pages
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Dashboard&lt;/strong&gt; — The heaviest page (+631 lines). A Hero Card summarizes the portfolio, Positions Table shows current holdings, Performance Chart tracks returns over time, and Recent Orders shows the latest trade history at a glance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Signals&lt;/strong&gt; — Signal cards, scenario rows, an expert panel, and filters. You can see at a glance which scenario generated each signal and where each expert agent stands on it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Research&lt;/strong&gt; — Watchlist Sidebar on the left, Price Chart and Fundamentals Card in the main area, Signal History at the bottom. The deep-dive view for a single ticker.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reports&lt;/strong&gt; — Report list on the left, Markdown Reader on the right. For reading the analysis reports generated by the agents.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Settings&lt;/strong&gt; — Placeholder for now.&lt;/p&gt;
&lt;h2 id="commit-history"&gt;Commit History
&lt;/h2&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;#&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Delta&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;1&lt;/td&gt;
 &lt;td&gt;Tailwind CSS v4 + shadcn/ui foundation&lt;/td&gt;
 &lt;td&gt;+793/-73&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;2&lt;/td&gt;
 &lt;td&gt;17 shadcn/ui components&lt;/td&gt;
 &lt;td&gt;+4,896/-50&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;3&lt;/td&gt;
 &lt;td&gt;Layout shell (header tabs, split panel)&lt;/td&gt;
 &lt;td&gt;+277/-190&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;4&lt;/td&gt;
 &lt;td&gt;Agent Activity panel&lt;/td&gt;
 &lt;td&gt;+358/-3&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;5&lt;/td&gt;
 &lt;td&gt;Dashboard page&lt;/td&gt;
 &lt;td&gt;+631/-1&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;6&lt;/td&gt;
 &lt;td&gt;Signals page&lt;/td&gt;
 &lt;td&gt;+194/-1&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;7&lt;/td&gt;
 &lt;td&gt;Research page&lt;/td&gt;
 &lt;td&gt;+289/-1&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;8&lt;/td&gt;
 &lt;td&gt;Reports page&lt;/td&gt;
 &lt;td&gt;+115/-1&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;56 files changed, &lt;strong&gt;+7,747 / -514 lines&lt;/strong&gt; total.&lt;/p&gt;
&lt;h2 id="retrospective"&gt;Retrospective
&lt;/h2&gt;&lt;h3 id="what-went-well"&gt;What Went Well
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Design first&lt;/strong&gt;: Doing the HTML mockup, spec document, and 12-task plan before writing a single line of production code kept implementation on track. No mid-session course corrections.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rewrite over patch&lt;/strong&gt;: The old code had structural problems, so structural fixes were required. Layering patches on top would have just moved the debt around.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Always-on core feature&lt;/strong&gt;: Pinning the Agent Activity panel as a fixed sidebar means you can check agent state at any time without switching tabs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="whats-next"&gt;What&amp;rsquo;s Next
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Implement the Settings page&lt;/li&gt;
&lt;li&gt;Live WebSocket data (currently using mock data throughout)&lt;/li&gt;
&lt;li&gt;Responsive layout (handling the Agent Activity panel on mobile)&lt;/li&gt;
&lt;li&gt;Dark mode support&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Continued in the next entry of the Trading Agent series.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>