Skip to content

Commit

Permalink
create rough "show execution count as"
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk committed Jan 14, 2024
1 parent 4deb53a commit 2c092bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const Cell = ({ cellId }: { cellId: string }) => {
const { executeCell, cellState, executionCount } = useCell(cellId);

let actionIcon = "▶";
let showExecutionCountAs = executionCount === null ? " " : executionCount;

switch (cellState) {
case "idle":
Expand All @@ -18,6 +19,7 @@ const Cell = ({ cellId }: { cellId: string }) => {
case "busy":
case "queued":
actionIcon = "⏹";
showExecutionCountAs = "*";
break;
}

Expand All @@ -29,7 +31,7 @@ const Cell = ({ cellId }: { cellId: string }) => {
onClick={executeCell}
>
[<div className="group-hover:block hidden">{actionIcon}</div>
<span className="group-hover:hidden">{executionCount}</span>]
<span className="group-hover:hidden">{showExecutionCountAs}</span>]
</Button>
<Editor cellId={cellId} className="mr-2 pt-0 pb-0 text-sm" language="python"/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useCell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function useCell(cellId: string) {

// Execution count is only set by the backend.

const executionCount = 0; // TODO: get from backend
const executionCount = null; // TODO: get from backend

// Queued, busy, and errored are set by the backend. However, we have to
// have our own state for queued for before the backend has acknowledged the
Expand Down

0 comments on commit 2c092bf

Please sign in to comment.