From b51a4c914157cab6f9ac282776a7d87dd685db35 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Mon, 16 Mar 2026 21:47:37 -0700 Subject: [PATCH] fix: keyword suggestions visibility, wizard identity autofill, dynamic sync label - Settings: add st.rerun() after storing _kw_suggestions so chips appear immediately without requiring a tab switch (#18) - Setup wizard step 4: prefill name/email/phone from parsed resume when identity fields are blank; saved values take precedence on re-visit (#17) - Home dashboard: sync section shows provider name when Notion is connected, or 'Set up a sync integration' with a settings link when not configured (#16) --- app/Home.py | 35 ++++++++++++++++++++++------------- app/pages/0_Setup.py | 7 ++++--- app/pages/2_Settings.py | 1 + 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/app/Home.py b/app/Home.py index 78d444c..ee5d4e8 100644 --- a/app/Home.py +++ b/app/Home.py @@ -24,6 +24,9 @@ from scripts.db import init_db, get_job_counts, purge_jobs, purge_email_data, \ from scripts.task_runner import submit_task from app.cloud_session import resolve_session, get_db_path +_CONFIG_DIR = Path(__file__).parent.parent / "config" +_NOTION_CONNECTED = (_CONFIG_DIR / "integrations" / "notion.yaml").exists() + resolve_session("peregrine") init_db(get_db_path()) @@ -234,20 +237,26 @@ with mid: with right: approved_count = get_job_counts(get_db_path()).get("approved", 0) - st.subheader("Send to Notion") - st.caption("Push all approved jobs to your Notion tracking database.") - if approved_count == 0: - st.info("No approved jobs yet. Review and approve some listings first.") + if _NOTION_CONNECTED: + st.subheader("Send to Notion") + st.caption("Push all approved jobs to your Notion tracking database.") + if approved_count == 0: + st.info("No approved jobs yet. Review and approve some listings first.") + else: + if st.button( + f"📤 Sync {approved_count} approved job{'s' if approved_count != 1 else ''} → Notion", + use_container_width=True, type="primary", + ): + with st.spinner("Syncing to Notion…"): + from scripts.sync import sync_to_notion + count = sync_to_notion(get_db_path()) + st.success(f"Synced {count} job{'s' if count != 1 else ''} to Notion!") + st.rerun() else: - if st.button( - f"📤 Sync {approved_count} approved job{'s' if approved_count != 1 else ''} → Notion", - use_container_width=True, type="primary", - ): - with st.spinner("Syncing to Notion…"): - from scripts.sync import sync_to_notion - count = sync_to_notion(get_db_path()) - st.success(f"Synced {count} job{'s' if count != 1 else ''} to Notion!") - st.rerun() + st.subheader("Set up a sync integration") + st.caption("Connect an integration to push approved jobs to your tracking database.") + if st.button("⚙️ Go to Integrations", use_container_width=True): + st.switch_page("pages/2_Settings.py") st.divider() diff --git a/app/pages/0_Setup.py b/app/pages/0_Setup.py index c936b39..3aed1af 100644 --- a/app/pages/0_Setup.py +++ b/app/pages/0_Setup.py @@ -403,9 +403,10 @@ elif step == 4: st.caption("Used in cover letter PDFs, LLM prompts, and the app header.") c1, c2 = st.columns(2) - name = c1.text_input("Full Name *", saved_yaml.get("name", "")) - email = c1.text_input("Email *", saved_yaml.get("email", "")) - phone = c2.text_input("Phone", saved_yaml.get("phone", "")) + _parsed = st.session_state.get("_parsed_resume", {}) + name = c1.text_input("Full Name *", saved_yaml.get("name") or _parsed.get("name", "")) + email = c1.text_input("Email *", saved_yaml.get("email") or _parsed.get("email", "")) + phone = c2.text_input("Phone", saved_yaml.get("phone") or _parsed.get("phone", "")) linkedin = c2.text_input("LinkedIn URL", saved_yaml.get("linkedin", "")) # Career summary with optional LLM generation — resume text available now (step 3 ran first) diff --git a/app/pages/2_Settings.py b/app/pages/2_Settings.py index df0e41d..937e336 100644 --- a/app/pages/2_Settings.py +++ b/app/pages/2_Settings.py @@ -786,6 +786,7 @@ with tab_resume: try: _kw_sugg = _suggest_resume_keywords(RESUME_PATH, _kw_current) st.session_state["_kw_suggestions"] = _kw_sugg + st.rerun() except RuntimeError as _e: st.warning( f"No LLM backend available: {_e}. "