Skip to content

(feat) Add Grid Lines Toggle Feature with Dynamic Icon#82

Open
HarK-github wants to merge 1 commit into
seetadev:mainfrom
HarK-github:ui-improve
Open

(feat) Add Grid Lines Toggle Feature with Dynamic Icon#82
HarK-github wants to merge 1 commit into
seetadev:mainfrom
HarK-github:ui-improve

Conversation

@HarK-github
Copy link
Copy Markdown

@HarK-github HarK-github commented May 14, 2026

Description

This PR adds a visual grid lines toggle feature to the Invoice Co-Pilot spreadsheet editor. Users can now easily show/hide grid lines with a single click, with the icon updating dynamically to reflect the current state.

  • Added showGrid state to track grid lines visibility
  • Created toggleGrid function that calls AppGeneral.toggleGridLinesCSS() and updates state
  • Dynamic icon switching - Icon changes between grid (grid visible) and gridOutline (grid hidden) based on current state

Technical Implementation

const [showGrid, setShowGrid] = useState(true);

const toggleGrid = () => {
  const isVisible = AppGeneral.toggleGridLinesCSS();
  setShowGrid(isVisible);
};

// In JSX
<IonIcon 
  icon={showGrid ? grid : gridOutline}
  onClick={toggleGrid}
/>

Testing Performed

  • Click toggles grid lines on/off
  • Icon changes correctly between grid and gridOutline
  • State persists across toggles
  • No console errors

Screenshots

Grid Visible Grid Hidden
image image

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.

1 participant