Skip to content

Add a status_bar component - #1608

Merged
lovasoa merged 4 commits into
mainfrom
codex/status-bar
Nov 21, 2026
Merged

lovasoa merged 4 commits into
mainfrom
codex/status-bar

Conversation

@lovasoa

@lovasoa lovasoa commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Use status_bar to keep connection state, counts, or a short action visible while scrolling. Each SQL row adds a segment. The last of several segments aligns to the far edge, and the bar scrolls horizontally on narrow screens.

select 'status_bar' as component;
select 'Connected' as title, 'wifi' as icon, 'green' as color;
select '24 rows' as title;
select 'Query history' as title, '/history.sql' as link;

The bar sits over the bottom of the viewport by default. Set false as fixed to display it inline.

Fixed, light theme

A status bar along the bottom of the viewport showing Connected, 24 rows, and a Query history link.

Inline, dark theme

The same status bar in dark mode, inline above the stock table.

Thanks to @TouchClickApp for the proposal.

@TouchClickApp TouchClickApp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good and thank you!

@lovasoa
lovasoa added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit d65bda4 Nov 21, 2026
60 checks passed
@TouchClickApp

TouchClickApp commented Nov 22, 2026 •

Copy link
Copy Markdown

not sure if its possible but, can we add a row-level parameter something like : true AS live , to show a live info like a textual clock in the status bar.. AI provided below suggestion:

{{#if live}}
  <span
    class="sqlpage-status-bar-live"
    data-sqlpage-status-bar-live="{{live}}"
    {{#unless (eq live 'clock')}}aria-live="polite"{{/unless}}
  >{{default title (default text (default contents message))}}</span>
{{else}}
  {{default title (default text (default contents message))}}
{{/if}}

JS

<script nonce="{{@csp_nonce}}">
(() => {
  if (window.sqlpageStatusBarLiveInit) return;
  window.sqlpageStatusBarLiveInit = true;

  const pad = (n) => String(n).padStart(2, '0');
  const formatClock = (d) => `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;

  const tick = () => {
    const now = new Date();
    document.querySelectorAll('[data-sqlpage-status-bar-live]').forEach((el) => {
      const mode = el.getAttribute('data-sqlpage-status-bar-live');
      if (mode === 'clock' || mode === 'true' || mode === '1') {
        el.textContent = formatClock(now);
      }
    });
  };

  tick();
  setInterval(tick, 1000);
})();
</script>

mockup:

sqlpage-timer-status-bar

@lovasoa

lovasoa commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator Author

sqlpage currently doesn't have a great option for live updating contents based on the database. live updating based on time alone can be done with js as you suggested (but it has limited usefulness)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants