Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The published application is available at <https://daggerok.github.io/iShares/>.

Every column of the ETF catalog and of the Watchlist, Holdings, History and Distributions tabs has a type: text (`ABC`), number (`123`), percentage (`%`), money (`$`), date (`D`), date and time (`DT`) or time of day (`T`). The type is detected from the texts the column shows (80% of the filled cells must agree, otherwise text) and is written in the badge next to the column title: click it to cycle the type, Shift+click to return to auto-detection. Dates are read as `2024-06-15`, `6/15/2024`, `15.06.2024`, `Jun 15, 2024` or `15-Jun-2024`, date and time as `2024-06-15T09:30:00Z` or `2024-06-15 09:30`, time as `09:30`, `16:00:00` or `9:30 PM`

A row of filter inputs sits under the column headers (the `Filters` button hides it, `Clear filters` empties it). Filters of different columns are combined with AND, the search box applies on top, and Copy Tickers and the exports use the filtered rows. Filters and type overrides are remembered in the browser. `Sticky #` (next to `Filters`, off by default, remembered in the browser) numbers the rows by their rank in the table sorted by the current column before the column filters, so a filtered fund keeps its rank and the numbers keep gaps; the sort, the search and the category and blacklist choices rank again. The catalog starts sorted by Net Assets, largest first, unavailable values sort last in both directions, and every export starts with the `#` column. The action buttons (Copy Tickers, Upload / Drop N-PORT XML, Export .csv, Export .txt, Clear, Blacklist) sit in the ☰ menu at the left start of the toolbar: `Enter`, `Space` or the down arrow opens it, the arrows move between the items, `Esc` or a click outside closes it. The red `Clear` item opens a dialog that lists what can be reset (the selection, searches, sort order, open tab, shown columns, column filters, remembered table views and the blacklist), all ticked the first time and afterwards as they were left at the last OK; `Enter` confirms, `Esc` or a click outside cancels, the theme is always kept, so the page looks like a first visit (also after a reload)
A row of filter inputs sits under the column headers (the `Filters` button hides it, `Clear filters` empties it). Filters of different columns are combined with AND, the search box applies on top, and Copy Tickers and the exports use the filtered rows. Filters and type overrides are remembered in the browser. `Sticky #` (next to `Filters`, off by default, remembered in the browser) numbers the rows by their rank in the table sorted by the current column before the column filters, so a filtered fund keeps its rank and the numbers keep gaps; the sort, the search and the category and blacklist choices rank again. The catalog starts sorted by Net Assets, largest first, unavailable values sort last in both directions, and every export starts with the `#` column. The action buttons (Copy Tickers, Upload / Drop N-PORT XML, Export .csv, Export .txt, Clear, Blacklist) sit in the ☰ menu at the right end of the toolbar: `Enter`, `Space` or the down arrow opens it, the arrows move between the items, `Esc` or a click outside closes it. The red `Clear` item opens a dialog that lists what can be reset (the selection, searches, sort order, open tab, shown columns, column filters, remembered table views and the blacklist), all ticked the first time and afterwards as they were left at the last OK; `Enter` confirms, `Esc` or a click outside cancels, the theme is always kept, so the page looks like a first visit (also after a reload)

Inside one filter: a space means AND, a comma means OR, a leading `!` means NOT, `?` matches an empty or unavailable value and `!?` a value that is there; a value that is unavailable matches only `?` and negated conditions. An unquoted space ends the value, so quote values that contain one (`>="2024-06-15 09:30"`)

Expand Down
19 changes: 15 additions & 4 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,27 @@
.range52w-cell{background-image:linear-gradient(to right,rgb(59 130 246 / .7) 0 var(--range52w,0%),rgb(148 163 184 / .35) var(--range52w,0%) 100%);background-repeat:no-repeat;background-size:calc(100% - 2rem) 3px;background-position:1rem calc(100% - .3rem)}
.range52w-cell.range52w-young{background-image:linear-gradient(to right,rgb(245 158 11 / .75) 0 var(--range52w,0%),rgb(148 163 184 / .35) var(--range52w,0%) 100%)}

/* Actions menu (☰ at the left start of the toolbar, see setupActionsMenu in main.tsx): the action buttons as menu items, each with its old color as an accent bar */
/* Actions menu (☰ at the right end of the toolbar, owner 2026-11-15, see setupActionsMenu in main.tsx): the action buttons as menu items, each with its old color as an accent bar.
.am-bar is the toolbar, .am-root (☰ and its panel) its last child, .am-row the search. From lg ☰ is pushed to the right end of its row; below lg it sits right of the search
on the first row: a column toolbar (flex-col, brands) becomes a two-column grid there, a wrapping row toolbar (hub, Stocks) puts the search and ☰ first by order */
.am-row{display:flex;align-items:center;gap:.5rem;min-width:0}
.am-row > .am-root{flex:none}
.am-row > :not(.am-root){flex:1 1 auto;min-width:0}
.am-bar > .am-root{flex:none}
@media (min-width:64rem){.am-bar > .am-root{margin-left:auto}}
@media (max-width:63.999rem){
.am-bar.flex-col{display:grid;grid-template-columns:minmax(0,1fr) auto;justify-items:center;align-items:center;column-gap:.5rem}
.am-bar.flex-col > *{grid-column:1 / -1}
.am-bar.flex-col > .am-row{grid-column:1;grid-row:1;justify-self:stretch}
.am-bar.flex-col > .am-root{grid-column:2;grid-row:1}
.am-bar:not(.flex-col) > .am-row{order:-2;flex:1 1 calc(100% - 3.5rem)}
.am-bar:not(.flex-col) > .am-root{order:-1}
}
.am-row > *{flex:1 1 auto;min-width:0}
.am-trigger{display:inline-flex;align-items:center;justify-content:center;width:2.375rem;height:2.375rem;flex:none;border-radius:.5rem;border:1px solid #e2e8f0;background:#fff;color:#334155;font-size:1.125rem;line-height:1;cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}
.am-trigger:hover,.am-trigger[aria-expanded="true"]{background:#f1f5f9;border-color:#cbd5e1}
.dark .am-trigger{background:#0f172a;border-color:#334155;color:#e2e8f0}
.dark .am-trigger:hover,.dark .am-trigger[aria-expanded="true"]{background:#1e293b;border-color:#475569}
.am-trigger:focus-visible,.am-item:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}
.am-panel{position:fixed;left:0;top:0;z-index:1000;display:flex;flex-direction:column;gap:.125rem;min-width:13rem;max-width:calc(100vw - 1rem);overflow:auto;padding:.375rem;background:#fff;border:1px solid #e2e8f0;border-radius:.75rem;box-shadow:0 12px 30px rgb(15 23 42 / .16),0 2px 6px rgb(15 23 42 / .06);opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top left;transition:opacity .14s ease,transform .14s ease}
.am-panel{position:fixed;left:0;top:0;z-index:1000;display:flex;flex-direction:column;gap:.125rem;min-width:13rem;max-width:calc(100vw - 1rem);overflow:auto;padding:.375rem;background:#fff;border:1px solid #e2e8f0;border-radius:.75rem;box-shadow:0 12px 30px rgb(15 23 42 / .16),0 2px 6px rgb(15 23 42 / .06);opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right;transition:opacity .14s ease,transform .14s ease}
.am-panel[hidden]{display:none}
.am-panel.is-open{opacity:1;transform:none}
.dark .am-panel{background:#0f172a;border-color:#334155;box-shadow:0 12px 30px rgb(0 0 0 / .5),0 2px 6px rgb(0 0 0 / .3)}
Expand Down
42 changes: 21 additions & 21 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,11 @@ <h1 class="min-w-0 text-xl font-bold tracking-tight text-slate-900 dark:text-whi
</nav>

<!-- Search, Tabs & Action Bar -->
<div class="max-lg:mb-6 flex flex-col lg:flex-row lg:flex-wrap lg:justify-start justify-between items-center gap-4 bg-white dark:bg-slate-800/80 p-4 rounded-xl border border-slate-200 dark:border-slate-700 shadow-xs backdrop-blur-sm">
<div class="am-bar max-lg:mb-6 flex flex-col lg:flex-row lg:flex-wrap lg:justify-start justify-between items-center gap-4 bg-white dark:bg-slate-800/80 p-4 rounded-xl border border-slate-200 dark:border-slate-700 shadow-xs backdrop-blur-sm">

<!-- Search is view-scoped: each tab keeps its own query. The ✕ button
clears only the active tab's filter (same glyph as the Use-column blacklist). -->
<!-- Actions menu (☰, owner 2026-11-14): the action buttons keep their ids and handlers, setupActionsMenu() in main.tsx opens and closes it -->
<div class="am-row w-full lg:w-auto shrink-0">
<div class="am-root">
<button type="button" id="actions-btn" class="am-trigger" aria-haspopup="menu" aria-expanded="false" aria-controls="actions-panel" aria-label="Actions" title="Actions: copy tickers, export, clear, blacklist">☰</button>
<div id="actions-panel" class="am-panel" role="menu" aria-label="Actions" hidden>
<button id="copy-btn" disabled class="am-item am-copy" role="menuitem" data-am-keep>Copy Tickers</button>
<!-- Integrated Drag & Drop Upload (same feature as daggerok/iShares, N-PORT flavor) -->
<div id="dropzone" class="am-item am-upload" title="Upload SEC Form N-PORT-P primary_doc.xml (holdings of any ETF from EDGAR). Parsed in your browser; uploads live for this session only." role="menuitem">
<input type="file" id="file-input" accept=".xml" class="hidden" />
<svg class="w-4 h-4 text-blue-500 dark:text-blue-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
</svg>
<span id="dropzone-text" class="dz-label font-medium">Upload / Drop N-PORT XML</span>
</div>
<button id="export-csv-btn" disabled class="am-item am-csv" role="menuitem">Export .csv</button>
<button id="export-txt-btn" disabled class="am-item am-txt" role="menuitem">Export .txt</button>
<div class="am-sep" role="separator"></div>
<button id="reset-btn" disabled title="Choose what to reset to the first-visit view (the choice is remembered, the theme is kept)" class="am-item am-clear" role="menuitem">Clear</button>
<button id="blacklist-btn" class="am-item am-blacklist" title="Manage the blacklist of ETFs hidden from All ETFs (kept in browser localStorage)" aria-expanded="false" role="menuitem">Blacklist</button>
</div>
</div>
<div class="relative flex items-center lg:w-96">
<input
type="text"
Expand All @@ -104,6 +84,26 @@ <h1 class="min-w-0 text-xl font-bold tracking-tight text-slate-900 dark:text-whi
<button id="filters-btn" type="button" aria-pressed="true" class="bg-slate-100 dark:bg-slate-800 text-slate-700 dark:text-slate-200 border border-slate-200 dark:border-slate-700 px-3 py-2 rounded-lg text-sm font-medium transition active:scale-95 hover:bg-slate-200 dark:hover:bg-slate-700 disabled:opacity-50 disabled:cursor-not-allowed" title="Show or hide the row of filter inputs under the column headers">Filters: <span id="filters-summary">on</span><span id="filters-badge" hidden class="ml-1.5 text-[0.7rem] leading-none font-semibold px-1.5 py-0.5 rounded-full bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700/50"></span></button>
<button id="clear-filters-btn" type="button" hidden class="bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-700/50 px-3 py-2 rounded-lg text-sm font-medium transition active:scale-95 hover:bg-blue-100 dark:hover:bg-blue-900/50" title="Clear every column filter of the shown table">Clear filters</button>
<button id="rank-btn" type="button" aria-pressed="false" class="bg-slate-100 dark:bg-slate-800 text-slate-700 dark:text-slate-200 border border-slate-200 dark:border-slate-700 px-3 py-2 rounded-lg text-sm font-medium transition active:scale-95 hover:bg-slate-200 dark:hover:bg-slate-700 disabled:opacity-50 disabled:cursor-not-allowed" title="Sticky #: number the rows by their rank in the sorted table before the column filters, so filtered rows keep their rank (1, 4, 7...). Off: 1..N of the shown rows">Sticky #: <span id="rank-summary">off</span></button>
<!-- Actions menu (☰ at the right end of the toolbar, owner 2026-11-15): the action buttons keep their ids and handlers, setupActionsMenu() in main.tsx opens and closes it -->
<div class="am-root">
<button type="button" id="actions-btn" class="am-trigger" aria-haspopup="menu" aria-expanded="false" aria-controls="actions-panel" aria-label="Actions" title="Actions: copy tickers, export, clear, blacklist">☰</button>
<div id="actions-panel" class="am-panel" role="menu" aria-label="Actions" hidden>
<button id="copy-btn" disabled class="am-item am-copy" role="menuitem" data-am-keep>Copy Tickers</button>
<!-- Integrated Drag & Drop Upload (same feature as daggerok/iShares, N-PORT flavor) -->
<div id="dropzone" class="am-item am-upload" title="Upload SEC Form N-PORT-P primary_doc.xml (holdings of any ETF from EDGAR). Parsed in your browser; uploads live for this session only." role="menuitem">
<input type="file" id="file-input" accept=".xml" class="hidden" />
<svg class="w-4 h-4 text-blue-500 dark:text-blue-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
</svg>
<span id="dropzone-text" class="dz-label font-medium">Upload / Drop N-PORT XML</span>
</div>
<button id="export-csv-btn" disabled class="am-item am-csv" role="menuitem">Export .csv</button>
<button id="export-txt-btn" disabled class="am-item am-txt" role="menuitem">Export .txt</button>
<div class="am-sep" role="separator"></div>
<button id="reset-btn" disabled title="Choose what to reset to the first-visit view (the choice is remembered, the theme is kept)" class="am-item am-clear" role="menuitem">Clear</button>
<button id="blacklist-btn" class="am-item am-blacklist" title="Manage the blacklist of ETFs hidden from All ETFs (kept in browser localStorage)" aria-expanded="false" role="menuitem">Blacklist</button>
</div>
</div>

</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1710,13 +1710,14 @@ function range52wCellHtml(metrics: any, tdClass: string): string {

/**
* Actions menu (owner 2026-11-14): the action buttons of the toolbar (Copy Tickers, Upload / Drop N-PORT XML where the app has it,
* Export .csv, Export .txt, Clear, Blacklist) live in one ☰ menu at the left start of the toolbar. The buttons keep their ids
* Export .csv, Export .txt, Clear, Blacklist) live in one ☰ menu at the right end of the toolbar (owner 2026-11-15; right of the
* search on a phone). The buttons keep their ids
* and their own click handlers: the menu only moves them into its panel, so Clear still opens its dialog, Export still downloads
* and the file input still opens. Enter, Space or ArrowDown on ☰ opens the menu and focuses the first enabled item, the arrows,
* Home and End move, Esc or Tab closes it (Esc returns focus to ☰), a click outside closes it. An item closes the menu when
* clicked, except Copy Tickers (`data-am-keep`) so its "Copied!" feedback stays visible. Dragging a file over ☰ opens the menu
* so the file can be dropped on the upload item. The panel moves to <body> (position: fixed under ☰, like the dropdown panels),
* so no card or sticky wrapper clips it.
* so no card or sticky wrapper clips it; its right edge lines up with the right edge of ☰ and it never leaves the window.
*/
function setupActionsMenu(): void {
const trigger = document.getElementById('actions-btn');
Expand All @@ -1730,7 +1731,7 @@ function setupActionsMenu(): void {
const place = (): void => {
const rect = trigger.getBoundingClientRect();
const width = panel.offsetWidth;
const left = Math.max(8, Math.min(rect.left, window.innerWidth - width - 8));
const left = Math.max(8, Math.min(rect.right - width, window.innerWidth - width - 8));
panel.style.left = `${Math.round(left)}px`;
panel.style.top = `${Math.round(rect.bottom + 6)}px`;
panel.style.maxHeight = `${Math.max(160, Math.round(window.innerHeight - rect.bottom - 16))}px`;
Expand Down
Loading