Introduction¶
DSH provides a fixed-width dock row below the conversation composer, commonly used to display session statistics, token counts, and the like. For developers who need to keep an eye on market data, this row is an ideal display spot: placing a stock or index’s price and change percentage here lets you glance at the latest quote at any time while conversing. The dsh-stock-bbar plugin implements exactly this need — it displays the SSE Composite Index by default and shows a single ticker’s price, change percentage, and direction arrow in a fixed-width row below the input box. You can manage the ticker list and switch the displayed symbol via the right-click context menu.
Plugin Overview¶
- Name: dsh-stock-bbar
- Category: Web Tools
- Maintainer: yjrqz777
- Repository: https://github.com/yjrqz777/dsh-stock-bbar
- Catalog page: https://www.skillhub.cn/plugins/yjrqz777/dsh-stock-bbar
The problem it solves: in the DSH Web GUI conversation interface, display a single ticker’s real-time price and change percentage in a fixed-width row, so you can keep tracking market quotes during a conversation without opening an external webpage.
Core Features¶
- Single-row display: Shows only one ticker at a time, including name, price, and change percentage (with a direction arrow). No other content is displayed.
- Red for gains, green for losses: Follows the Chinese market convention by default — gains shown in red, losses in green. You can toggle the colors off via the right-click menu; in that case, price distinction relies solely on font weight.
- Fixed width and centering: The row width is fixed at 188px (
ROW_WIDTH), with content centered. Switching tickers does not change the row width, so adjacent statistic pills won’t jitter. Overlong names are truncated with an ellipsis; price and change percentage are always visible. - Click name to rotate: Clicking the name cycles to the next ticker in list order; after the last one it wraps back to the first. If there’s only one code in the list, clicking the name does nothing.
- Click price to toggle red/green: Clicking the price toggles the red-gain/green-loss coloring on or off. The state is exposed via
aria-pressed. - Right-click context menu: Right-click (or
Shift+F10) opens a menu containing: - A toggle for showing gain/loss colors;
- A ticker list input field (comma-separated, up to 20 codes); saving requires all codes to have available quotes;
- A refresh-now button.
- Data refresh strategy: Refreshes every 5 seconds while visible; pauses when the page is hidden; backs off to 10s, 20s, 30s on failure; stops polling if the code list is rejected until the list is modified.
- Quote source: Fetched from Tencent’s
qt.gtimg.cn/q=<codes>endpoint. The plugin’s Host side forwards the request and decodes GBK; the browser does not access that endpoint directly. - Storage: The ticker list and color toggle are saved in the browser’s
localStorageunder the keysdsh-stock-bbar.codeanddsh-stock-bbar.colorrespectively.
Installation & Enablement¶
- Install via the plugin marketplace: Find the plugin in the DSH Plugin Marketplace and install it (once the catalog page is indexed, you can navigate to it from there).
- Local install: In DSH, select “Plugins → Add plugin” and point it to this repository’s directory.
No build step is required at install time. The package is distributed as pure ESM with no additional dependencies.
Typical Usage¶
- Display the SSE Composite Index by default (
sh000001): - Open the DSH Web GUI and enter a conversation. A row appears below the input box, e.g., “SSE Composite 3503.64 -2.07%”.
- Add multiple tickers:
- Right-click the row and enter a ticker list in the menu, e.g.,
600519,sz399001,00700. - Ensure each code is in a supported format (e.g.,
sh000001,sz399001,hk00700,bj430047). All codes must have available quotes when saving. - Switch the displayed ticker:
- Click the name to rotate to the next one in list order.
- Click the price to toggle red-gain/green-loss on or off.
- Manual refresh:
- The “Refresh Now” option in the right-click menu triggers an immediate request.
Use Cases & Caveats¶
- Use cases: You need to keep an eye on the real-time price of one or more tickers during a conversation, especially A-shares, BSE (Beijing Stock Exchange) listings, HK stocks, or indices.
- Caveats:
- Quote display requires DSH 0.2.2-rc.5 or later, and is only visible within Web GUI conversations.
- The plugin runs with the current DSH process privileges. Review the source code and license (MIT) before installing.
- This row is for displaying price and change percentage only; it does not provide charts or a full market data service.
Conclusion¶
This plugin turns the fixed-width dock row into a lightweight market dashboard, making it easy to glance at a single ticker’s real-time price and change percentage while conversing. Installation and configuration are all handled through the right-click context menu, so it doesn’t interfere with conversation input. For more details, see the catalog page or the GitHub repository.