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)
This commit is contained in:
pyr0ball 2026-03-16 21:47:37 -07:00
parent b6e16eb6e9
commit b51a4c9141
3 changed files with 27 additions and 16 deletions

View file

@ -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 scripts.task_runner import submit_task
from app.cloud_session import resolve_session, get_db_path 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") resolve_session("peregrine")
init_db(get_db_path()) init_db(get_db_path())
@ -234,20 +237,26 @@ with mid:
with right: with right:
approved_count = get_job_counts(get_db_path()).get("approved", 0) approved_count = get_job_counts(get_db_path()).get("approved", 0)
st.subheader("Send to Notion") if _NOTION_CONNECTED:
st.caption("Push all approved jobs to your Notion tracking database.") st.subheader("Send to Notion")
if approved_count == 0: st.caption("Push all approved jobs to your Notion tracking database.")
st.info("No approved jobs yet. Review and approve some listings first.") 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: else:
if st.button( st.subheader("Set up a sync integration")
f"📤 Sync {approved_count} approved job{'s' if approved_count != 1 else ''} → Notion", st.caption("Connect an integration to push approved jobs to your tracking database.")
use_container_width=True, type="primary", if st.button("⚙️ Go to Integrations", use_container_width=True):
): st.switch_page("pages/2_Settings.py")
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.divider() st.divider()

View file

@ -403,9 +403,10 @@ elif step == 4:
st.caption("Used in cover letter PDFs, LLM prompts, and the app header.") st.caption("Used in cover letter PDFs, LLM prompts, and the app header.")
c1, c2 = st.columns(2) c1, c2 = st.columns(2)
name = c1.text_input("Full Name *", saved_yaml.get("name", "")) _parsed = st.session_state.get("_parsed_resume", {})
email = c1.text_input("Email *", saved_yaml.get("email", "")) name = c1.text_input("Full Name *", saved_yaml.get("name") or _parsed.get("name", ""))
phone = c2.text_input("Phone", saved_yaml.get("phone", "")) 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", "")) linkedin = c2.text_input("LinkedIn URL", saved_yaml.get("linkedin", ""))
# Career summary with optional LLM generation — resume text available now (step 3 ran first) # Career summary with optional LLM generation — resume text available now (step 3 ran first)

View file

@ -786,6 +786,7 @@ with tab_resume:
try: try:
_kw_sugg = _suggest_resume_keywords(RESUME_PATH, _kw_current) _kw_sugg = _suggest_resume_keywords(RESUME_PATH, _kw_current)
st.session_state["_kw_suggestions"] = _kw_sugg st.session_state["_kw_suggestions"] = _kw_sugg
st.rerun()
except RuntimeError as _e: except RuntimeError as _e:
st.warning( st.warning(
f"No LLM backend available: {_e}. " f"No LLM backend available: {_e}. "